Skip to main content

Get Workflow

The Get Workflow task retrieves the details of a workflow execution using its workflow ID.

note

You can get the workflow details only if you have at least read permission for the workflow. Otherwise, the workflow will fail with an error message:

Error message on having no access to workflow execution

Task parameters

Configure these parameters for the Get Workflow task.

ParameterDescriptionRequired/ Optional
inputParameters. idThe workflow ID of the workflow to be retrieved. It can be passed as a dynamic variable.Required.
inputParameters. includeTasksWhether to retrieve the task details or not. The default value is false.Required.

The following are generic configuration parameters that can be applied to the task and are not specific to the Get Workflow task.

Other generic parameters

Here are other parameters for configuring the task behavior.

ParameterDescriptionRequired/ Optional
optionalWhether the task is optional.

If set totrue, any task failure is ignored, and the workflow continues with the task status updated to COMPLETED_WITH_ERRORS. However, the task must reach a terminal state. If the task remains incomplete, the workflow waits until it reaches a terminal state before proceeding.
Optional.

Task configuration

This is the task configuration for a Get Workflow task.

{
"name": "get_workflow",
"taskReferenceName": "get_workflow_ref",
"inputParameters": {
"id": "<WORKFLOW-ID>",
"includeTasks": true
},
"type": "GET_WORKFLOW"
}

Task output

The Get Workflow task returns the execution details of the workflow identified by the specified workflow ID, including task execution details when Include tasks is enabled.

Adding a Get Workflow task in UI

To add a Get Workflow task:

  1. In your workflow, select the (+) icon and add a Get Workflow task.
  2. Enter the Workflow ID.
  3. (Optional) Select Include tasks if you need to retrieve the task details.

Screenshot of Get Workflow Task in Orkes Conductor

Examples

Here are some examples for using the Get Workflow task.

Using the Get Workflow task in a workflow

The following example demonstrates how to configure a workflow that retrieves the details of another workflow execution.

To create a workflow:

  1. Go to Definitions > Workflow, from the left navigation menu on your Conductor cluster.
  2. Select + Define workflow.
  3. In the Code tab, paste the following workflow definition:
{
"name": "GetWorkflowDemo",
"description": "Sample Workflow",
"version": 1,
"tasks": [
{
"name": "get_workflow",
"taskReferenceName": "get_workflow_ref",
"inputParameters": {
"id": "${workflow.input.workflowId}",
"includeTasks": true
},
"type": "GET_WORKFLOW"
}
],
"inputParameters": [
"workflowId"
],
"schemaVersion": 2
}
  1. Select Save > Confirm.

To run the workflow:

  1. Go to the Run tab, and enter the Input params. For example:
{
"workflowId": "8440b876-e7c5-11f0-a0ca-c60c4ebc4813"// Replace with your workflow ID
}
  1. Select Execute.

Once the workflow starts, the Get Workflow task retrieves the details of the specified workflow execution.

To verify the result, select the Get Workflow task in the execution view and open the Output tab. The output contains the workflow execution details for the provided workflow ID.

If Include tasks is set to true, the output also includes the list of tasks associated with the workflow execution. If set to false, only workflow-level metadata is returned.

Output of the Get Workflow task

This allows you to inspect the current state, status, and execution details of an existing workflow from within another workflow.