Originally published at lumbox.co
LangGraph pushed LangChain into a direction many people had been asking for: explicit state, explicit transitions, deterministic control flow. It's a better fit for production agents than a freeform ReAct loop. It's also a perfect fit for modeling email-driven workflows — because "wait for email" is literally a state.
Email workflows as graphs
Consider the most common agent task: sign up for a service, verify the email, complete the flow. Modeled as a graph:
create_inbox → submit_signup → wait_for_otp → submit_otp → done
Each node is a concrete step with inputs and outputs. The edges are deterministic. If OTP times out, transition to retry or fail . This is exactly what LangGraph's StateGraph was built for.
Wiring Lumbox as graph nodes
from langgraph.graph import StateGraph , END from typing import TypedDict from lumbox import Lumbox
lumbox = Lumbox ( api_key = os .…