To create a nested workflow, you need to set up two workflows:
- Nested Workflow: Executes actions like logging a ticket.
- Parent Workflow: Calls the nested workflow to complete an action such as a notification when a workflow fails.
Tip
For a detailed use case, refer to Tutorial: Creating a troubleshooting workflow using nested workflows or check out our video.
Fig 1: Illustration of the nested workflow creation process
Procedure
1. Create a nested workflow
- Click Configuration > Workflows.
- Add a workflow.
- In the Begin block, set the Actions to Nested Workflow.
- If you want to pass data from the parent to the nested workflow, create an external variable.
- In the sidebar, click Variables tab , and then click the External Variables tab.
- Click ADD VARIABLE.
- Specify the Variable name and the Data type.
- Click Submit
- Add the other elements that you need to complete the workflow. If you created an external variable, apply it to a workflow block so that the nested workflow can retrieve the data from the parent workflow.
You can pass simple data, such as a ticket number, by creating a short text variable. To pass complex data with multiple attributes, create an object variable. For further details see Creating a workflow variable
Fig 2: Begin block Actions must be set to Nested
2. Create a parent workflow
Once you have created the nested workflow, you can then create the parent workflow.
- Create a new workflow. Select the same object that you selected when you created the nested workflow.
- Add the nested workflow block.
- In the nested workflow block, complete the following actions:
- Select the nested workflow you created.
- Assign a value to the variable you created in the nested workflow. This can be a hardcoded value or a value stored in another variable.
- Enter a timeout period. When the timeout period expires, the parent workflow block will continue to run.
- Best practice is to specify follow-up action depending on whether the nested workflow block completes successfully, fails, or times out.
- True: The nested workflow completes successfully and the parent workflow continues to run.
- Timeout: The nested workflow doesn't complete within the set timeout period, possibly because it's stuck, halted, or taking longer than anticipated. The parent workflow cancels the nested workflow and continues its operation.
- False: The nested workflow encounters an error, fault, or other issue causing it to return an error message.
- Add the other elements that you need to complete the workflow.
- If the variable has an Oomnitza object, like Users, as its data type, you can pass the all of the object's data by referencing the object field, such as
{{created_by}}
, or you can use dot notation to access the object's values in the parent or nested workflow. For example,{{created_by.address}}
). See Adding metadata to workflow blocks. - You can use Jinja to modify or alter nested workflow variables, for example
{{created_by.address|upper}}
Fig 3: Nested workflow process
3. Run the workflow
Before you run the workflow
- Ensure that both the nested and the parent workflows are saved, validated, and activated.
- Ensure that the criteria in the 'Begin' block of the parent workflow targets the records that you want to process. For example, in an onboarding workflow, you'd target "New" user entries.
Upon activation, the parent workflow kickstarts the nested workflow. The parent's subsequent actions are determined by the response it receives, leading it down either a positive, timed-out or a negative trajectory. You can check the status of each workflow by reviewing the workflow logs.
Comments
0 comments
Please sign in to leave a comment.