Skip to course content
Free LangGraph course

LangGraph for Agentic Workflows

Module 05 Activity

Scenario

Your graph is about to do something outside itself. Everything in this module exists because retries and outward actions do not mix by default.

What you build

A tool layer where every action is idempotent, validated, safe to fail, and logged with enough to reconstruct what happened.

Steps

  1. Take one action your workflow performs on an external system. Give it an idempotency key derived from the run id and step name, and prove a triple call acts once.
  2. Write a validator for its arguments with shape checks and at least one policy ceiling. Say where the ceiling came from.
  3. Convert every tool to the same result envelope - ok, error, value - and reduce your graph to one error branch.
  4. Log attempt number, outcome and the external system's id for each call, after it returns.
  5. Split one node into its pure and impure halves, guard the impure half with a state flag, and run it three times.

Evidence to hand in

Review checklist