Sending Signals to Workflows
You can manage and automate workflows by sending signals to pause, resume, terminate, restart, rerun workflows, and more. Using Conductor SDKs or APIs, you can integrate and programmatically control workflows during production and in case of failure.
Pause workflow
You can pause a workflow to wait for external signals.
- Using API
- Using SDK
- Using UI
Use the Pause Workflow API on a running workflow.
Endpoint: PUT /api/workflow/{workflowId}/pause
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
BulkResponse pauseWorkflow(List<String> workflowIds) throws ApiException
func (e *WorkflowExecutor) Pause(workflowId string) error
WorkflowResourceApi.pause_workflow1(self, workflow_id, **kwargs)
void WorkflowResourceApi.PauseWorkflow(string workflowId)
WorkflowExecutor.pauseWorkflow(
workflowId: string,
): CancelablePromise<any>
WorkflowExecutor.pauseWorkflow(
workflowId: string,
): CancelablePromise<any>
(workflow-resource/pause-workflow [options workflow-id])
In the workflow execution page (Executions > Workflow > someWorkflow), select Actions > Pause.
Resume workflow
Once an external signal is received, you can resume the paused workflow.
- Using API
- Using SDK
- Using UI
Use the Resume Workflow API on a paused workflow.
Endpoint: PUT /api/workflow/{workflowId}/resume
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
BulkResponse resumeWorkflow(List<String> workflowIds) throws ApiException
func (e *WorkflowExecutor) Resume(workflowId string) error
WorkflowResourceApi.resume_workflow1(self, workflow_id, **kwargs)
void WorkflowResourceApi.ResumeWorkflow(string workflowId)
WorkflowExecutor.resume(
workflowId: string,
): CancelablePromise<any>
WorkflowExecutor.resume(
workflowId: string,
): CancelablePromise<any>
(workflow-resource/resume-workflow [options workflow-id])
In the workflow execution page (Executions > Workflow > someWorkflow), select Actions > Resume.
Restart workflow
If a workflow execution fails for any reason and enters a terminal state, you can restart it from the beginning. There are two options for restarting workflows:
- Restart with Current Definitions—Restart using the same workflow definition that was referenced in the initial execution. This is useful if the workflow definition has changed and the original definition needs to be retained.
- Restart with Latest Definitions—Restart using the latest workflow definition and version. If you’ve changed the definition, you can use this option to rerun the execution with the latest version.
When restarting workflows, the same inputs will be used. To use different workflow inputs, rerun the workflow instead.
- Using API
- Using SDK
- Using UI
Use the Restart Workflow API on a terminal workflow to restart the workflow from the beginning with the same input.
Endpoint: POST /api/workflow/{workflowId}/restart
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
BulkResponse restartWorkflow(List<String> workflowIds, Boolean useLatestDefinitions) throws ApiException
func (e *WorkflowExecutor) Restart(workflowId string, useLatestDefinition bool) error
WorkflowResourceApi.restart1(self, workflow_id, **kwargs)
void WorkflowResourceApi.Restart(string workflowId, bool? useLatestDefinitions = null)
WorkflowExecutor.restart(
workflowId: string,
useLatestDefinitions: boolean,
): CancelablePromise<void>
WorkflowExecutor.restart(
workflowId: string,
useLatestDefinitions: boolean,
): CancelablePromise<void>
(workflow-resource/restart-workflow [options workflow-id])
In the workflow execution page (Executions > Workflow > someWorkflow), select Actions > Restart with current definitions or Restart with latest definitions.
Rerun workflow
You can rerun a terminal workflow from the start if you need to change the workflow inputs, correlation ID, or task-to-domain mapping. The workflow ID from the original run will be retained.
- Using API
- Using SDK
- Using UI
Use the Rerun Workflow API to rerun the workflow from the beginning with updated inputs.
Endpoint: POST /api/workflow/{workflowId}/rerun
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
String rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflowRequest)
func (e *WorkflowExecutor) ReRun(workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error)
WorkflowResourceApi.rerun(self, body, workflow_id, **kwargs)
string WorkflowResourceApi.Rerun(RerunWorkflowRequest body, string workflowId)
WorkflowExecutor.rerun(
workflowId: string,
requestBody: RerunWorkflowRequest,
): CancelablePromise<string>
WorkflowResourceService.rerun(
workflowId: string,
requestBody: RerunWorkflowRequest,
): CancelablePromise<string>
(workflow-resource/rerun-workflow [options workflow-id rerun-wf-request])
In the UI, there is no option to rerun the workflow using the same workflow ID. However, you can rerun it by creating a new execution instance.
In the workflow execution page (Executions > Workflow > someWorkflow), select Actions > Re-run Workflow. You will be redirected to the Run Workflow page, where you can update the workflow inputs, correlation ID, and task-to-domain mapping to run a new workflow instance.
Rerun workflow from task
In certain cases, you may wish to rerun an ongoing or terminal workflow from a specific task instead.
- Using API
- Using SDK
- Using UI
Use the Rerun Workflow API to rerun the workflow from a specific task, with the option to provide updated task inputs.
Endpoint: POST /api/workflow/{workflowId}/rerun
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
String rerunWorkflow(String workflowId, RerunWorkflowRequest rerunWorkflowRequest)
func (e *WorkflowExecutor) ReRun(workflowId string, reRunRequest model.RerunWorkflowRequest) (id string, error error)
WorkflowResourceApi.rerun(self, body, workflow_id, **kwargs)
string WorkflowResourceApi.Rerun(RerunWorkflowRequest body, string workflowId)
WorkflowExecutor.rerun(
workflowId: string,
requestBody: RerunWorkflowRequest,
): CancelablePromise<string>
WorkflowResourceService.rerun(
workflowId: string,
requestBody: RerunWorkflowRequest,
): CancelablePromise<string>
(workflow-resource/rerun-workflow [options workflow-id rerun-wf-request])
In the workflow execution page (Executions > Workflow > someWorkflow), select a task in the visual diagram, then select Re-Run from Task. The task will be rerun, and the previous attempt(s) will be marked as CANCELED.
If you need to provide updated task inputs, use the API instead.
Retry from failed task
If the workflow fails, you can retry it from its last failed task.
- Using API
- Using SDK
- Using UI
Use the Retry Failed Workflow API to retry the workflow from its last failed task.
Endpoint: POST /api/workflow/{workflowId}/retry
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
BulkResponse retryWorkflow(List<String> workflowIds) throws ApiException
func (e *WorkflowExecutor) Retry(workflowId string, resumeSubworkflowTasks bool) error
WorkflowResourceApi.retry1(self, workflow_id, **kwargs)
void WorkflowResourceApi.Retry(string workflowId, bool? resumeSubworkflowTasks = null)
WorkflowExecutor.retry(
workflowId: string,
resumeSubworkflowTasks: boolean,
): CancelablePromise<void>
WorkflowExecutor.retry(
workflowId: string,
resumeSubworkflowTasks: boolean,
): CancelablePromise<void>
(workflow-resource/retry-last-failed-task [options workflow-id resume-subworkflow-tasks])
In the workflow execution page (Executions > Workflow > someWorkflow), select Actions > Retry - from failed task. The task will be rerun, and the previous attempt(s) will be marked as CANCELED.
Update task status
In some cases, you may need to update the task status in an ongoing workflow with a signal, such as updating the status of a signal-type Wait task.
- Using API
- Using SDK
- Using UI
Use the Update Task Status in Workflow API to update the task status to one of the following options:
- FAILED
- FAILED_WITH_TERMINAL_ERROR
- COMPLETED
You can also provide the task output in the request body.
Endpoint: POST /api/tasks/{workflowId}/{taskRefName}/{status}
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
String OrkesTaskClient.updateTaskByRefName(Map<String, Object> output, String workflowId, String taskRefName, String status) throws ApiException
func (*WorkflowExecutor) UpdateTaskByRefName(taskRefName string, workflowInstanceId string, status model.TaskResultStatus, output interface{}) error
TaskResourceApi.update_task1(taskOutput, workflow_id, task_ref_name, status, **kwargs)
string TaskResourceApi.UpdateTask(Dictionary<string, Object> taskOutput, string workflowId, string taskRefName, string status, string workerid = null)
TaskResourceService.updateTask(
workflowId: string,
taskRefName: string,
status: 'IN_PROGRESS' | 'FAILED' | 'FAILED_WITH_TERMINAL_ERROR' | 'COMPLETED',
taskOutput: Record<string, any>,
): CancelablePromise<string>
TaskResourceService.updateTask(
workflowId: string,
taskRefName: string,
status: 'IN_PROGRESS' | 'FAILED' | 'FAILED_WITH_TERMINAL_ERROR' | 'COMPLETED',
taskOutput: Record<string, any>,
): CancelablePromise<string>
(task-resource/update-task-by-reference-name options workflow-id task-reference-name status update-req)
- In the workflow execution page (Executions > Workflow > someWorkflow), select a task in the visual diagram.
- In the Summary tab, select a status in the Update task field.
- (Optional) Add the task outputs in the Code field.
- Select Update.
Terminate workflow
In some cases, you may need to terminate the workflow with a signal. For example, if a user terminates an ongoing indexing process.
- Using API
- Using SDK
- Using UI
Use the Terminate Workflow API to terminate an ongoing workflow.
Endpoint: DELETE /api/workflow/{workflowId}
- Java
- Go
- Python
- C#
- JavaScript
- Typescript
- Clojure
void terminateWorkflow(String workflowId, String reason)
func (e *WorkflowExecutor) Terminate(workflowId string, reason string) error
WorkflowResourceApi.terminate1(self, workflow_id, **kwargs)
void WorkflowResourceApi.Terminate(string workflowId, string reason = null, bool? triggerFailureWorkflow = null)
WorkflowExecutor.terminate(
workflowId: string,
reason: string,
): CancelablePromise<any>
WorkflowExecutor.terminate(
workflowId: string,
reason: string,
): CancelablePromise<any>
(workflow-resource/terminate-workflow [options workflow-id & args])
In the workflow execution page (Executions > Workflow > someWorkflow), select Actions > Terminate.