Skip to content

Workflow Engine

The Pipeline

Every ChatObject runs a pre-compiled workflow. The default (step-driven) pipeline:

The strategy block is what changes by mode:

python
# STEP_BODY — one task-loop iteration = one Step
STEP_BODY = NODE_INTRO >> NATIVE_WHILE(iter_cond).ACTION(STEP_EXEC) >> NODE_LEAVE

DI Contexts as the State Layer

Workflow nodes are stateless functions; all state lives in DI contexts injected by parameter type (see Data Layer). This is what makes the same nodes reusable across pipelines.

Pre-Composed Pipelines

amrita_core.builtins.workflows ships ready graphs:

PipelineComposition
STEP_REACT_BLOCKSTRATEGY_INIT >> AGENT_ENTRY >> NATIVE_DO(STEP_BODY).WHILE(task_cond) >> AGENT_POST_PROCESS
SIMPLE_STEP_REACTLOAD_STATE >> JINJA2_RENDER >> BUILD_MESSAGE >> STEP_REACT_BLOCK >> LLM_COMPLETION >> COMMIT_MEMORY
REACT_BLOCK (legacy)STRATEGY_INIT >> AGENT_ENTRY >> WHILE(SINGLE_STRATEGY_CALL).ACTION(REACT_COUNTER) >> AGENT_POST_PROCESS
SIMPLE_REACT (legacy)LOAD_STATE >> ... >> REACT_BLOCK >> LLM_COMPLETION >> COMMIT_MEMORY
SIMPLE_CHATLOAD_STATE >> JINJA2_RENDER >> BUILD_MESSAGE >> LLM_COMPLETION >> COMMIT_MEMORY

ChatObject(workflow=...) accepts any rendered graph; workflow and archived_nodes are mutually exclusive.

The Loop Conditions

ConditionStops when
task_condCall limit hit, _suggested_stop, stall injected, or all DAG nodes done
iter_condCall limit, stall, token budget exhausted, exec_finished, or stop suggested

Both live in amrita_core.components.react and read loop.run_state — the semantic state bridged between the loop and the strategy.

Next

Suspend & Resume — pausing the workflow mid-flight.

Apache 2.0 License