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
In your current workflow, add the nested workflow operator.
Click the three-dot menu next to Parameters and select Run by workflow ID.
Enter the ID of the workflow you want to run. For example:
{{ $.event.workflow_id }}
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.