Log inBook a Demo
BuildSeniorData / MLAuto-graded

Build a pipeline that hands state between agents

Multi-step automation only works if each step sees the last one's output and one failure doesn't halt everything.Real agent systems are rarely one giant prompt. They are a chain of specialists — planner, retriever, writer, critic — where each stage reads what the previous ones produced and passes an updated shared state forward. The code that threads that state, stops the chain early when a stage says the work is done, and keeps going when a stage blows up is the pipeline runner. The one that ships here does none of those three things reliably. Make run_pipeline(agents, state) carry state forward, honour an early finish, and survive a raising agent.
35 min
python

You're done when

  • The pipeline runs the agents in the order it was given, and completes without crashing.
  • Each agent sees the state the previous agents wrote — state is threaded forward, not reset between stages.
  • The final state contains every write made along the chain, not just the last agent's.
  • When an agent signals it is done, the remaining agents are skipped rather than run anyway.
  • That done signal is still visible in the final state the caller receives.
  • An agent that raises does not kill the run — the pipeline continues to the next stage.
  • The failure is recorded as structured data, and the following agent still sees the state as it was before the failure.

What it measures

Agent engineeringComposing specialists into a chain that behaves predictably, rather than hoping a single large prompt covers every case.
Context engineeringDeciding what each stage needs to see and making state flow forward intact, which is what separates a working handoff from a chain that silently drops work.
Designing for partial failureTreating a flaky stage as normal rather than exceptional — isolating it, recording it in a form the next stage can use, and continuing.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

35 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo