Sim

Workflow

The Workflow block allows you to execute other workflows as reusable components within your current workflow. This enables modular design, code reuse, and the creation of complex nested workflows that can be composed from smaller, focused workflows.

Workflow Block

Workflow blocks enable modular design by allowing you to compose complex workflows from smaller, reusable components.

Overview

The Workflow block serves as a bridge between workflows, enabling you to:

Reuse existing workflows: Execute previously created workflows as components within new workflows

Create modular designs: Break down complex processes into smaller, manageable workflows

Maintain separation of concerns: Keep different business logic isolated in separate workflows

Enable team collaboration: Share and reuse workflows across different projects and team members

How It Works

The Workflow block:

  1. Takes a reference to another workflow in your workspace
  2. Passes input data from the current workflow to the child workflow (available via start.input)
  3. Executes the child workflow in an isolated context
  4. Returns the result back to the parent workflow for further processing

Configuration Options

Workflow Selection

Choose which workflow to execute from a dropdown list of available workflows in your workspace. The list includes:

  • All workflows you have access to in the current workspace
  • Workflows shared with you by other team members
  • Both enabled and disabled workflows (though only enabled workflows can be executed)

Execution Context

The child workflow executes with:

  • Its own isolated execution context
  • Access to the same workspace resources (API keys, environment variables)
  • Proper workspace membership and permission checks
  • Nested tracespan in the execution log

Cycle Detection: The system automatically detects and prevents circular dependencies between workflows to avoid infinite loops.

Inputs and Outputs

  • Workflow Selection: Choose which workflow to execute

  • Input Data: Variable or block reference to pass to child workflow

  • Execution Context: Isolated environment with workspace resources

  • workflow.success: Boolean indicating completion status

  • workflow.childWorkflowName: Name of executed child workflow

  • workflow.result: Result returned by the child workflow

  • workflow.error: Error details if workflow failed

  • Workflow Response: Primary output from child workflow

  • Execution Status: Success status and error information

  • Access: Available in blocks after the workflow

Example Use Cases

Modular Customer Onboarding

Scenario: Break down complex onboarding into reusable components

  1. Main workflow receives customer data
  2. Workflow block executes validation workflow
  3. Workflow block executes account setup workflow
  4. Workflow block executes welcome email workflow

Microservice Architecture

Scenario: Create independent service workflows

  1. Payment processing workflow handles transactions
  2. Inventory management workflow updates stock
  3. Notification workflow sends confirmations
  4. Main workflow orchestrates all services

Conditional Processing

Scenario: Execute different workflows based on conditions

  1. Condition block evaluates user type
  2. Enterprise users → Complex approval workflow
  3. Standard users → Simple approval workflow
  4. Free users → Basic processing workflow

Best Practices

  • Keep workflows focused: Design child workflows to handle specific, well-defined tasks with clear inputs and outputs
  • Minimize nesting depth: Avoid deeply nested workflow hierarchies for better maintainability and performance
  • Handle errors gracefully: Implement proper error handling for child workflow failures and provide fallback mechanisms
  • Test independently: Ensure child workflows can be tested and validated independently from parent workflows
  • Use semantic naming: Give workflows descriptive names that clearly indicate their purpose and functionality
Workflow