Graph<S>. Sources under examples/graphs/.
How to run
Most graph examples are offline (no LLM needed):See also
Graphs and state
The user guide.
Checkpointing
Time travel and resume.
Patterns → HITL approval
Interrupts in a real flow.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Stateful workflows — polling state machines, checkpointing, HITL interrupts, semantic routing, topic channels.
Graph<S>. Sources under examples/graphs/.
| Name | Scenario | Source |
|---|---|---|
graphs_state_machine | Polling loop — check up to 5 times whether an external job is done; give up if not. | src |
graphs_with_checkpoints | Resumable 5-step ETL pipeline — extract / validate / transform / load / notify, snapshot per step. | src |
graphs_interrupts | HITL pause-for-approval — agent drafts an email, graph stops before the send node so a reviewer can approve. | src |
graphs_semantic_router | Customer-support intent routing — "refund" → refund_flow, "cancel" → cancel_flow, else general help. | src |
graphs_topic_channels | Onboarding agent that collects (name, hobbies, todo) across turns — reducers per field (last_value vs. append). | src |
cargo run -p cognis-examples --example graphs_state_machine
cargo run -p cognis-examples --example graphs_with_checkpoints
cargo run -p cognis-examples --example graphs_interrupts