Skip to course content
Free LangGraph course

LangGraph for Agentic Workflows

Module 04 Activity

Scenario

The graph works on the happy path. Everything in this module is about the paths nobody has run yet.

What you build

A routing layer with an error branch, a bounded retry, and a coverage report showing every destination has been exercised.

Steps

  1. Rewrite every router to read named state fields only. If any router inspects free text or asks a model, change the upstream node to set a validated field instead.
  2. Add error handling to every node that can raise: catch the expected exceptions into an error field and route on it.
  3. Add a bounded retry with a counter, a ceiling, and a give-up node distinct from success. Check success before the ceiling.
  4. Run the dead-end and unreachable-node checks over your edge list and fix what they find.
  5. Write one test per router destination, asserting on which branch was taken, and compute branch coverage.

Evidence to hand in

Review checklist