Skip to main content

Wiring Parameters

In Conductor, various workflow and task parameters can be hard-coded or dynamically referenced from elsewhere (including its workflow parameters, prior task parameters, workflow variables, environment variables, and secrets). As long as it can be passed as a string, any workflow or task parameter can make use of a dynamic reference instead of a hard-coded value.

These dynamic references are formatted as dot-notation expressions, taking after JSONPath syntax.

Basic expression

All dynamic references are formatted as the following expression:

"key" : "${type.jsonpath}"
Expression ComponentDescription
keyA string representing the parameter name for a workflow or task parameter.
${...}The root notation indicating that the variable will be dynamically replaced at runtime.
typeThe type of reference. Supported values:
  • workflow—Refers to the current workflow instance.
  • workflow.input—Refers to the workflow’s input parameters.
  • workflow.output—Refers to the workflow’s output parameters.
  • workflow.secrets—Refers to the secrets available in your Conductor cluster.
  • workflow.variables—Refers to the workflow variables set in the workflow using the Set Variable task.
  • workflow.env—Refers to the environment variables available in your Conductor cluster.
  • taskReferenceName—Refers to a task in the current workflow instance by its reference name. (For example, “http_ref”).
  • taskReferenceName.input—Refers to the task’s input parameters.
  • taskReferenceName.output—Refers to the task’s output parameters.
jsonpathJSONPath expression in dot-notation. The path is based on the reference type’s JSON object.

Sample expressions

Depending on where the data is being referenced from, here is a non-exhaustive list of possible dynamic references:

Dynamic ReferencesDescription
${taskReferenceName.input}References a prior task’s input object. Returns null if the task has not started when this reference was looked up.
${taskReferenceName.output}References a prior task’s output object. Returns null if the task has not started when this reference was looked up.
${taskReferenceName.input.someKey}References a prior task’s input parameter someKey. Returns null if the task has not started when this reference was looked up.
${taskReferenceName.output.someKey}References a prior task’s output parameter someKey. Returns null if the task has not started when this reference was looked up.
${workflow.input}References the workflow’s input object.
${workflow.output}References the workflow’s output object.
${workflow.input.someKey}References the current workflow’s input parameter someKey.
${workflow.output.someKey}References the current workflow’s output parameter someKey.
${workflow.status}References the current workflow’s status. Possible values: RUNNING, PAUSED, TIMED_OUT, TERMINATED, FAILED, or COMPLETED.
${workflow.workflowId}References the current workflow ID.
${workflow.parentWorkflowId}(Used in sub-workflows) References the parent workflow ID.
${workflow.parentWorkflowTaskId}(Used in sub-workflows) References the task execution ID for Sub Workflow task in the parent workflow.
${workflow.workflowType}References the current workflow name.
${workflow.version}References the current workflow version.
${workflow.createTime}References the workflow execution time.
${workflow.correlationId}References the current workflow’s correlation ID.
${workflow.taskToDomain.domainName}References the workflow’s domain name that was invoked during its execution.
${workflow.variables.someKey}References the workflow variable someKey, which has been set earlier in a Set Variable task.
${workflow.env.someKey}References the environment variable someKey, which has been defined previously in the Conductor cluster.
${workflow.secrets.someKey}References the secret someKey, which has been defined previously in the Conductor cluster.
When inspected, the secret value will not be exposed and instead retain its reference value ${workflow.secrets.someKey}.
During execution, if the workflow doesn't have permission to read the secret, it will fail with an error saying so.

Examples

Here are some examples for using dynamic references in workflows.

Referencing workflow inputs​​

For the given workflow input:

{
"userID": 1,
"userName": "SAMPLE",
"userDetails": {
"country": "nestedValue",
"age": 50
}
}

You can reference these workflow inputs elsewhere using the following expressions:

{
"user": "${workflow.input.userName}",
"userAge": "${workflow.input.userDetails.age}"
}

At runtime, the parameters will be:

{
"user": "SAMPLE",
"userAge": 50
}
Referencing other task outputs​​

If a task previousTaskReference produced the following output:

{
"taxZone": "A",
"productDetails": {
"nestedKey1": "outputValue-1"
"nestedKey2": "outputValue-2"
}
}

You can reference these task outputs elsewhere using the following expressions:

{
"nextTaskInput1": "${previousTaskReference.output.taxZone}",
"nextTaskInput2": "${previousTaskReference.output.productDetails.nestedKey1}"
}

At runtime, the parameters will be:

{
"nextTaskInput1": "A",
"nextTaskInput2": "outputValue-1"
}
Referencing secrets​​

If a secret named api_key with the value Xxhhjiu0nbfdinvdHyj is stored in your Conductor cluster, you can reference it in a workflow using the following expression:

{
"auth": "${workflow.secrets.api_key}"
}

At runtime, the parameter auth will take on the value USXxhhjiu0nbfdinvdHyj. This value will not be exposed in the workflow execution JSON, and users will only see the reference expression while inspecting the JSON object:

{
"auth": "${workflow.secrets.api_key}"
}
Referencing workflow variables

If a workflow variable is set using the Set Variable task:

{
"name": "Orkes"
}

The variable can be referenced in the same workflow using the following expression:

{
"user": "${workflow.variables.name}"
}
note

Workflow variables cannot be re-referenced across workflows, even between parent workflow and sub-workflow.

Referencing environment variables​

If an environment variable named location with the value US is stored in your Conductor cluster, you can reference it in a workflow using the following expression:

{
"place": "${workflow.env.location}"
}

At runtime, the parameters will be:

{
"place": "US"
}
Referencing data between parent workflow and sub-workflow​

Tab: From parent workflow

To pass parameters from a parent workflow into its sub-workflow, you must declare them as input parameters for the Sub Workflow task.

Example

// 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": {}
}

If needed, these inputs can then be set as workflow variables within the sub-workflow definition itself using a Set Variable task.

Tab: From sub-workflow

To pass parameters from a sub-workflow back to its parent workflow, you must pass them as the sub-workflow’s output parameters in the sub-workflow definition.

// 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}"
}
}

In the parent workflow, these sub-workflow outputs can be referenced using the expression format ${*sub_workflow_ref*.output.*someKey*}.

Troubleshooting errors

You can verify if the data was passed correctly by checking the input/output values of the task execution in Executions > Workflow. 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.