Build your first workflow
Use “customer feedback routing” as an example. Python first performs deterministic cleanup, an Agent classifies and recommends an action, and a rule decides whether a person must review it. This expands the minimal Agent from the quickstart into a production-shaped flow.
Start → Prepare data (Process) → Classify and recommend (Agent) → High risk? ├─ Yes → Human Review → End └─ No ─────────────────→ EndDefine the state contract first
Section titled “Define the state contract first”Before connecting the canvas, list the fields every step produces and consumes.
| Node | Reads | Writes | Publish to global state? |
|---|---|---|---|
| Start | — | feedback |
Yes; later nodes need it. |
| Prepare data (Process) | feedback |
normalized_feedback, is_high_risk |
Yes; the Agent and branch need them. |
| Classify and recommend (Agent) | normalized_feedback |
category, priority, recommendation |
Yes; review and End need them. |
| Human Review | recommendation |
approved |
Yes; the branch or End may need it. |
On nodes that produce output, enter these keys in Publish to global state → Published output keys, separated by commas. Output is node-private by default; downstream nodes cannot assume they can read it until it is published and they have been granted read access.
Assign responsibilities
Section titled “Assign responsibilities”- Process: read input, normalize fields, apply fixed rules, or query internal systems.
- Agent: make semantic judgments and return fixed fields such as
category,priority, andrecommendation. - If/Else or Switch: branch only on declared state fields.
- Human Review: give a person decisions that affect customers, funds, permissions, or public content.
Configure the branch and review
Section titled “Configure the branch and review”- Set an If/Else condition such as
is_high_risk == true || priority == "high". - Connect the “yes” output to Human Review, and the “no” output to End.
- In Review request, set the content key to
recommendationand context keys tocategory, priority, normalized_feedback. - Enable Allow editing if the reviewer should be able to rewrite the recommendation.
- Connect both the approved and rejected outputs. Do not silently end a rejection; route it to more information, a rewritten recommendation, or an explicit terminal node.
Media placeholder · screenshot
workflows/01-state-publication.png
Show the Process node’s “Publish to global state” section with multiple output keys entered. Explain that producing output and exposing it to the workflow are separate actions.
Media placeholder · video
workflows/02-branch-and-review.mp4(45–60 seconds)
Add If/Else, enter the condition, configure Human Review, then run to a pause and approve it to resume.
Design notes
Section titled “Design notes”- Make each node do one describable job.
- Define node output before writing prompts and code.
- Use readable state field names rather than stuffing whole documents into every node.
- Put side-effecting operations after review and enable human confirmation for Agent tool calls.
Run three examples before moving to evaluation: ordinary feedback, clearly high-risk feedback, and feedback with missing information. They become your first evaluation cases.