Workflow Engine

How Typeflow executes workflows, handles data flow, and manages complex execution patterns.

Overview

Typeflow's workflow engine is a directed acyclic graph (DAG) executor that processes nodes in topological order. Each node receives input data, performs its operation, and passes output to connected nodes.

  • Node-based — each operation is a discrete node with inputs and outputs.
  • Type-safe — data types are validated between node connections.
  • Stateful — execution state persists for debugging and replay.

Execution Model

Sequential Execution
Nodes execute in dependency order
Parallel Execution
Independent branches run concurrently

Data Flow

Input Data Structure
1
2
3
4
5
6
7
8
9
10
11
Expression Variables
$jsonCurrent item's JSON data
$inputAll input items from previous node
$node['Name']Access specific node output
$workflowWorkflow metadata
$executionCurrent execution context

Branching & Merging

IF/Switch Nodes
Route data based on conditions
Merge Node
Combine multiple branches

Loops & Iterations

Processing Multiple Items

By default, nodes process all input items. Each item flows through the node sequentially.

Use the Split Out node to expand arrays into individual items, and Aggregate to collect items back into an array.

Error Handling

Error Handling Strategies

Stop on Error (Default)

Workflow stops immediately when any node fails.

Continue on Error

Skip failed items and continue with remaining.

Retry on Failure

Automatically retry failed operations with backoff.

Error Output
Route errors to a separate path