Trigger a Subworkflow
This action allows you to trigger one or more workflows for sub-data within your original workflow.
Common examples for subworkflows include:
- Order > Line Items (multiple)
- Order > Customer
- Order > Fulfillments (multiple)
- Product > Variants (multiple)
In the subworkflow action, select the data you want to create a subworkflow for. Order example:
After you select the data you want to send to the subworkflow you can edit it:
In your subworkflow, you can now add conditions and actions based on the data that is passed. Be sure to include any condition if you want to exclude certain items from running in the subworkflow.
Additional Notes & Considerations
- To test a Subworkflow, select an item to test with on the main workflow page. Once selected, go back to the subworkflow. The subworkflow edit screen will now allow you to select a relevant test item. For example, select an order and on a line item subworkflow, specific line items will be available for testing.
- You can view subworkflow logs by going to the subworkflow and clicking the "Logs" tab at the top. From there you can view success messages, errors, and what's in queue.
- Subworkflows can generate a lot of actions which can cause delays if you are not careful. Be sure that you have appropriate conditions to only run subworkflows on items you need it to run on. You may run into issues if you try to process too many subworkflow items, such as an order with 50+ line items, or a product with 50+ variants.