# Workflow Core Mechanics and Scheduling Principles

> An in-depth explanation of FastGPT's graph scheduling engine, in-edge readiness groupings, skip propagation, and interactive checkpoints.

Source: https://doc.fastgpt.io/guide/build/workflow/intro
Last Updated: 2026-11-12

FastGPT Workflows are powered by a graph execution engine. Visual node orchestration allows builders to decompose complex multi-step business logic into deterministic, auditable, and easily debugged execution pipelines.

![Initial canvas state with workflow start node](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/workflow-start-chat.png.webp)

## Graph Dispatch Engine Mechanics

Workflows initiate execution from the "Workflow Start" node. The scheduler drives graph traversal based on in-edge dependencies:

![Branch execution and skip propagation](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/diagrams/workflow-branches.en.light.svg)

### 1. In-Edge Grouping Readiness Evaluation

The scheduler evaluates node execution conditions against incoming edges:

* **Execution Ready**: When all predecessor edges in a dependency group complete waiting and at least one edge is `active`, the node joins the ready queue and begins execution immediately.
* **Concurrent Dispatch**: Independent nodes that reach readiness simultaneously execute concurrently, maximizing I/O efficiency.

### 2. The Three-State Edge Model

Every edge on the canvas assumes one of three discrete states during execution:

| Edge State | Meaning and System Behavior                                                                                    |
| ---------- | -------------------------------------------------------------------------------------------------------------- |
| `waiting`  | Initial pending state. Upstream predecessor nodes have not finished executing; downstream nodes wait.          |
| `active`   | Activated state. Upstream nodes executed successfully and met branch criteria; downstream nodes are triggered. |
| `skipped`  | Skipped state. Upstream conditional branches omitted this route, propagating skips downstream.                 |

### 3. Skip Propagation Mechanics

When an upstream Condition or Classify node selects a route, its other outlets become `skipped`. A node skips execution and propagates `skipped` through its outlets when every incoming edge group is skipped. A qualifying incoming group makes the node runnable; remaining states keep it waiting.

![AI Chat node structure and input/output ports](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/optimized/current/node-ai-chat.png.webp)

***

## Exception Branches and Circuit Breakers

To maintain workflow resilience against upstream service degradation, the platform provides explicit exception paths:

1. **Explicit Exception Outlets**: For nodes with "Error catch" enabled (such as HTTP or Code run), execution errors or timeouts trigger the exception edge immediately, skipping standard business outputs and routing error diagnostics to fallback nodes.
2. **Default Error Interception**: When nodes without "Error catch" enabled encounter errors, the system skips downstream edges automatically while recording execution traces, allowing parallel branches to finalize cleanly.
3. **Execution Step Quotas**: To guard against infinite loops, each request enforces a maximum step limit. Upon reaching this quota, the scheduler halts further node execution and records the termination in the execution result.

***

## Interactive Checkpoints

FastGPT supports human-in-the-loop interactions and state checkpoints during workflow runs:

![Pause and resume on the next request](https://cdn.jsdelivr.net/gh/labring/fastgpt-img@main/diagrams/workflow-interaction.en.light.svg)

1. **Execution Suspension**: On the first visit to a "User Select" or "Form input" node, the system returns the interactive payload and saves entry nodes, edge states, node outputs, the skip queue, and usage identifiers in the chat interaction record.
2. **State Restoration**: After the user submits a selection or form, the next request restores the saved conversation state. The interaction node consumes the new input, then downstream execution continues.
3. **Cooperative Cancellation**: When users click "Stop" during streamed responses, the system writes a cancellation flag. The scheduler exits cooperatively at the next scheduling cycle and persists all generated records.

## Orchestration Best Practices

1. **Left-to-Right Layout**: Structure pipelines to flow naturally from "Workflow Start" on the left toward response nodes on the right.
2. **Output Control and Aggregation**: Let "AI Chat" reply directly in simple flows; when combining static copy or multiple node outputs, enable **Hide AI output** on upstream AI nodes and emit the final response from an **Assigned Reply** node.
3. **Standard Variable Naming**: Define clean identifiers in start nodes and global settings to support reliable downstream variable referencing.

## Next Steps

* Node contract specifications: [Node Reference Manual](https://doc.fastgpt.io/guide/build/workflow/nodes/ai_chat).
* Autonomous agents: [Chat Agent V2 Settings](https://doc.fastgpt.io/guide/build/agentv2/settings).
* Automation pipelines: [Scheduled Triggers](https://doc.fastgpt.io/guide/build/scheduled-triggers).
