Skip to main content
All CollectionsBuild AutomationsOperators
Dynamically Select Nested Workflows: Specify IDs from the Context
Dynamically Select Nested Workflows: Specify IDs from the Context

Learn how to dynamically specify nested workflows and their revisions by passing IDs from the workflow context.

Updated over a week ago

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.

Set Up

  1. In your current workflow, add the nested workflow operator.

  2. Click the three-dot menu next to Parameters and select Run by workflow ID.

  3. Enter the ID of the workflow you want to run. For example: {{ $.event.workflow_id }}

  4. Optionally, specify the ID of the workflow revision to execute. The latest published version will be executed by default.

Important Points

  • 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 (you can use a predefined trigger event that can be retrieved according to the workflow ID).

  • You can test with mock outputs by turning on the relevant option.

Did this answer your question?