Laminar
  • Laminar
  • Platform
    • Overview
    • Getting Started
    • Advanced
      • Configurations
      • HTTP Request Batching
      • Workflow Exit Points
      • Invoke Secondary Workflows
      • Managing Notifications
    • Best Practices
    • Keywords
      • lam.resolveThenExecute
      • lam.exit
      • lam.execute
      • lam.asyncExecute
      • lam.httpRequest
      • lam.httpRequests
  • Concepts
    • Workflows
      • Global Workflow Object
    • Flows
      • Flow Types
        • HTTP Request
        • Data Transformations
      • Flow Runs
      • Supported Languages
    • API Key
    • Configurations
    • API
      • Reference
        • Workspaces
          • Issues
          • Users
          • Invitations
            • Decline
            • Accept
            • Received
            • Created
          • Workflows
          • Flows
          • Auth credentials
          • Api keys
          • Api descriptions
        • Workflow
          • Execute
            • External
          • Flows
          • Executions
        • Users
        • Flows
          • Runs
          • Versions
          • Stats
          • Recent runs
          • Read
        • Configurations
          • Properties
          • Flow credentials
          • Workspace
        • Auth credentials
        • Api descriptions
        • Api keys
        • Transform
          • Test
        • Lami
          • Public
          • Direct
        • Auth
          • Signin
          • Register
          • Refresh
          • Me
          • Users
            • Password
    • Changelog
  • External Links
    • Book a Demo
    • Playground
    • Sign In
  • Specification
Powered by GitBook
On this page

Was this helpful?

  1. Platform
  2. Advanced

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 PointsNextManaging Notifications

Last updated 1 month ago

Was this helpful?