Skip to main content

Dynamically Select Nested Workflows: Specify IDs from the Context

Dynamically specify nested workflows and their revisions by passing IDs from the workflow context.

Updated this week

Torq enables dynamic triggering of any workflow revision, published or draft, by specifying the workflow and revision IDs from the workflow context. Use the nested workflow operator to input the workflow's ID and, if needed, a specific revision's ID. This approach eliminates the need for static workflow names, offering more flexibility.

This capability is particularly useful for automated workflow testing. For instance, when a workflow is submitted for review via a webhook, the trigger event will include both the workflow ID and the specific revision ID. This allows you to run tests on the revision to ensure its functionality before publishing it.

How to use

  1. Set up the Workflow operator: Add the Workflow operator. Click the three-dot menu next to Parameters and select Run by workflow ID.

  2. Define the workflow to run:

    1. Enter the workflow ID. For example: {{ $.event.workflow_id }}

    2. Optionally, specify the ID of the workflow revision to execute.
      For example: {{ $.event.revision_id }}
      By default, the latest published version will be executed.

  3. (Optional) Test with mock outputs: Set Test run with mock outputs to Yes to run the nested workflow using mock outputs for steps that have it configured. Mock outputs are available for test executions only.

Due to the dynamic evaluation of the workflow ID, the nested workflow input parameters aren't known in advance. You have to ensure that the trigger event JSON specifies values for the required parameters.

Did this answer your question?