Invoke Secondary Workflows
Learn how to invoke workflows from other workflows
You can trigger other workflows asynchronously from within a primary workflow using the keyword lam.asyncExecute, allowing for more complex automation scenarios without waiting for the secondary workflow to complete.
Imagine you have an e-commerce application with two workflows:
process-new-order: Handles new orders, inventory updatescustomer-communication: Sends various emails to customers
When a new order comes in, you want to process it immediately but handle customer communications separately.
As a first step of the process-new-order workflow, you would invoke the customer-communication workflow as follows:
return {
  "lam.asyncExecute": [
    {
      "lam.workflowId": 39, // customer-communication workflow id
      "lam.payload": { /* payload data */ }
    }
  ]
}You can also invoke multiple workflows asynchronously by appending to the lam.asyncExecute array.
Last updated
Was this helpful?