Dynamic nested workflow selection
  • 30 May 2023
  • 1 Minute to read
  • Dark
    Light

Dynamic nested workflow selection

  • Dark
    Light

Article Summary

Programmatically trigger any revision, whether published or draft, of any workflow by dynamically passing the workflow and revision IDs (the revision ID is optional) from the context in the nested workflow operator (instead of a static workflow name).

This functionality can be used to implement automatic workflow testing. For example, when submitting a workflow for review and selecting a webhook, the trigger event contains the workflow ID and the ID of the specific revision submitted for review. The approval flow workflow can include a test execution of the submitted workflow to check its success before publishing it.

Specify the nested workflow ID from the context

  1. Add the Workflow operator to execute a nested workflow as part of the workflow you're working on.
  2. Click the three-dot menu next to the Workflow parameter and select Run by workflow ID.
    Select a nested workflow by specifying the workflow ID
  3. Specify the ID of the nested workflow to execute from the context. For example: {{ $.event.workflow_id }}
    Note
    Due to the dynamic evaluation of the workflow ID, there is no dependency between the parent and nested workflows. This means you can publish the parent workflow without publishing the nested workflow.
  4. Optional: specify the ID of the workflow revision to execute. The latest published version will be executed by default.
  5. Specify the trigger event JSON. The event JSON is empty by default.
    Note
    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).
  6.  Set the Test run with mock outputs toggle to Yes for the nested workflow steps to use mock outputs if available and enabled.
    Provide the workflow ID and the revision ID from the context

Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.