Wiring Task Inputs
In Conductor, task inputs can be provided in the workflow definition in multiple ways:
- As a hard-coded value –
- As a dynamic reference to the workflow inputs, workflow variables, or the inputs/outputs of prior tasks –
Syntax for dynamic references
All dynamic references are formatted as the following expression:
These dynamic references are formatted as dot-notation expressions, taking after JSONPath syntax.
| Component | Description |
|---|---|
${...} |
The root notation indicating that the variable will be dynamically replaced at runtime. |
| type | The type of reference. Supported values:
|
| jsonpath | The JSONPath expression in dot-notation. |
Sample expressions
Here is a non-exhaustive list of dynamic references you can use:
- To reference a task’s input payload –
- To reference a task’s output payload –
- To reference a task’s input parameter –
- To reference a task’s output parameter –
- To reference the workflow's input payload –
- To reference the workflow's output payload –
- To reference the workflow's input parameter –
- To reference the workflow's output parameter –
- To reference the workflow's current status (RUNNING, PAUSED, TIMED_OUT, TERMINATED, FAILED, or COMPLETED) –
- To reference the workflow's (execution) ID –
- (Used in sub-workflows) To reference the parent workflow (execution) ID –
- (Used in sub-workflows) To reference the task execution ID for the Sub Workflow task in the parent workflow –
- To reference the workflow's name –
- To reference the workflow's version –
- To reference the start time of the workflow execution –
- To reference the workflow's correlation ID –
- To reference the workflow’s domain name that was invoked during its execution –
- To reference the workflow's variable created using the Set Variable task –
Examples
Here are some examples for using dynamic references in workflows.
Referencing workflow inputs
For the given workflow input: You can reference these workflow inputs elsewhere using the following expressions: At runtime, the parameters will be:Referencing other task outputs
If a taskpreviousTaskReference produced the following output:
{
"taxZone": "A",
"productDetails": {
"nestedKey1": "outputValue-1",
"nestedKey2": "outputValue-2"
}
}
Referencing workflow variables
If a workflow variable is set using the Set Variable task: The variable can be referenced in the same workflow using the following expression: Note: Workflow variables cannot be re-referenced across workflows, even between a parent workflow and a sub-workflow.Referencing data between parent workflow and sub-workflow
To pass parameters from a parent workflow into its sub-workflow, you must declare them as input parameters for the Sub Workflow task. If needed, these inputs can then be set as workflow variables within the sub-workflow definition itself using a Set Variable task.// parent workflow definition with task configuration
{
"createTime": 1733980872607,
"updateTime": 0,
"name": "testParent",
"description": "workflow with subworkflow",
"version": 1,
"tasks": [
{
"name": "get_item",
"taskReferenceName": "get_item_ref",
"inputParameters": {
"uri": "https://example.com/api",
"method": "GET",
"accept": "application/json",
"contentType": "application/json",
"encode": true
},
"type": "HTTP",
},
{
"name": "sub_workflow",
"taskReferenceName": "sub_workflow_ref",
"inputParameters": {
"user": "${workflow.variables.name}",
"item": "${previous_task_ref.output.item[0]}"
},
"type": "SUB_WORKFLOW",
"subWorkflowParam": {
"name": "testSub",
"version": 1
}
}
],
"inputParameters": [],
"outputParameters": {}
}
// sub-workflow definition
{
"createTime": 1726651838873,
"updateTime": 1733983507294,
"name": "testSub",
"description": "subworkflow for parent workflow",
"version": 1,
"tasks": [
{
"name": "get-user",
"taskReferenceName": "get-user_ref",
"inputParameters": {
"uri": "https://example.com/api",
"method": "GET",
"accept": "application/json",
"contentType": "application/json",
"encode": true
},
"type": "HTTP",
},
{
"name": "send-notification",
"taskReferenceName": "send-notification_ref",
"inputParameters": {
"uri": "https://example.com/api",
"method": "GET",
"accept": "application/json",
"contentType": "application/json",
"encode": true
},
"type": "HTTP",
}
],
"inputParameters": [],
"outputParameters": {
"location": "${get-user_ref.output.response.body.results[0].location.country}",
"isNotif": "${send-notification_ref.output}"
}
}
Troubleshooting
You can verify if the data was passed correctly by checking the input/output values of the task execution in the UI. Common errors:
- If the reference expression is incorrectly formatted, the referencing parameter value may end up with the wrong data or a null value.
- If the referenced value (such as a task output) has not resolved at the point when it is referenced, the referencing parameter value will be null.