Laminar
  • Laminar
  • Platform
    • Overview
    • Getting Started
    • Advanced
      • Workflows
        • Global Workflow Object
        • HTTP Request Batching
        • Workflow Exit Points
        • Invoke Secondary Workflows
      • Configurations
      • Flows
        • Flow Types
          • HTTP Request
          • Data Transformations
        • Supported Languages
      • Managing Notifications
    • Best Practices
    • Keywords
      • lam.resolveThenExecute
      • lam.exit
      • lam.execute
      • lam.asyncExecute
      • lam.httpRequest
      • lam.httpRequests
  • API
    • Executing a Workflow
    • Creating a Configuration
    • Authentication
    • Changelog
  • External Links
    • Book a Demo
    • Sign In
Powered by GitBook
On this page

Was this helpful?

  1. Platform
  2. Advanced
  3. Workflows

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:

  1. process-new-order: Handles new orders, inventory updates

  2. customer-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.

PreviousWorkflow Exit PointsNextConfigurations

Last updated 2 months ago

Was this helpful?