Trigger a Subworkflow

Screenshot_2020-04-30_13.17.27.png

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:

Screenshot_2020-04-30_13.21.01.png

After you select the data you want to send to the subworkflow you can edit it:

Screenshot_2020-04-30_13.21.35.png

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.

Screenshot_2020-04-30_13.23.28.png

 

Additional Notes & Considerations

  • The "Test Center" will only be available to some types of subworkflows. For example, an "Order > Customer" subworkflow would allow you to test against a customer. An "Order > Line Items" subworkflow would not have Test Center enabled. You can still test your subworkflow by using the "Test Center" on the main order workflow.
  • 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.