Skip to main content
Workflows are DAG-based multi-step pipelines that compose Jobs with dependencies, conditional execution, and parallel step processing. They provide orchestration for complex operations that span multiple jobs.
Workflows execute jobs in dependency order with automatic cycle detection, parallel batching, and per-step error handling.
Nx users: Scaffold with nx g @frontmcp/nx:workflow my-workflow --project my-app. See Workflow Generator.

Why Workflows?

Workflows handle orchestration that individual jobs cannot: Workflows are ideal for:
  • Multi-step data pipelines — extract, transform, load sequences
  • Approval chains — sequential steps with conditional logic
  • Parallel processing — fan-out/fan-in patterns with bounded concurrency
  • Event-driven automation — webhook-triggered multi-job flows

Creating Workflows

Workflows are defined declaratively using the @Workflow decorator with a steps array:

Function Style


Registering Workflows

Add workflows to your app via the workflows array:
Jobs referenced by workflow steps must be registered in the same app or available in the scope’s job registry.

Workflow Steps

Each step defines a job to execute and how it connects to other steps:

Step Dependencies

Steps declare dependencies using dependsOn. The engine validates the DAG before execution:
  • Duplicate ID detection — no two steps can share an ID
  • Missing reference detectiondependsOn must reference existing step IDs
  • Cycle detection — DFS-based cycle detection prevents infinite loops

Dynamic Input

Steps can compute their input dynamically based on previous step outputs:
The steps context provides a get(stepId) method that returns WorkflowStepResult:

Conditional Steps

Steps can be conditionally skipped based on previous step results:
When a condition returns false, the step is marked as skipped and downstream steps that depend on it will still execute (skipped steps are treated as completed for dependency resolution).

Parallel Execution

Steps with no mutual dependencies execute in parallel, bounded by maxConcurrency:

Configuration

Webhook Configuration


Triggers


Execution Flow


Error Handling

When a step fails:
  1. Default behavior — the step is marked as failed, and downstream dependents are skipped
  2. With continueOnError: true — the step is marked as failed but treated as completed for dependency resolution, allowing downstream steps to proceed

MCP Tools

When workflows are enabled, the following MCP tools are automatically registered: Hyphen aliases (list-workflows, execute-workflow, …) still resolve with a deprecation log line for one release — agents and code that hardcoded the old form keep working.

Best Practices

Do:
  • Keep steps focused on a single job each
  • Use dependsOn to make data flow explicit
  • Set continueOnError: true for non-critical steps
  • Use dynamic input functions to pass data between steps
  • Set appropriate maxConcurrency based on resource constraints
Don’t:
  • Create deeply nested dependency chains when parallel execution is possible
  • Skip DAG validation by referencing non-existent step IDs
  • Set maxConcurrency too high for resource-intensive jobs
  • Use workflows for single-step operations (use jobs directly)

Next Steps

Jobs

Define the jobs that workflows orchestrate

@Workflow

Decorator reference

WorkflowRegistry

Registry API reference

DirectClient

Programmatic workflow execution