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

Workflow Exit Points

Learn how to stop a workflow execution gracefully

When building integrations, you may wish to terminate a workflow early if some preconditions are not met.

Laminar solves this with the lam.exit keyword which can be used to stop a workflow execution and optionally return a payload providing more context on the exit.

(payload) => {
  const { step_1 } = payload;
  if (step_1.inventory.quantity < 1) {
    return {
      "lam.exit": true,
      // payload to be returned
      "data": { 
        "error": "Out of stock"
      }
    };
  }
  // Continue with normal processing...

PreviousHTTP Request BatchingNextInvoke Secondary Workflows

Last updated 1 month ago

Was this helpful?