Skip to course content
Free LangGraph course

LangGraph for Agentic Workflows

Unit 07.04: The pattern that makes an agent deployable

Everything in the last three modules combines into one pattern. It is what separates an agent you can put in front of real consequences from a demo.

Seven pieces, all required together

Durable state, a pause point, inspectable state, editable state, explicit approval, a guarded effect, and an audit record.

The code lists all seven with the mechanism behind each.

PATTERN = [
    ("durable state",      "the run survives a restart",            "checkpointer"),
    ("pause point",        "stops before the irreversible step",    "interrupt_before"),
    ("inspectable state",  "a reviewer sees exactly what will happen", "get_state"),
    ("editable state",     "a reviewer can correct it",             "update_state"),
    ("explicit approval",  "a field the node checks",               "state flag"),
    ("guarded effect",     "resuming twice does not act twice",     "idempotency key"),
    ("audit record",       "who approved what, and when",           "log"),
]

print(f"{'requirement':20} {'why':42} mechanism")
for requirement, why, mechanism in PATTERN:
    print(f"{requirement:20} {why:42} {mechanism}")

print(f"""
{len(PATTERN)} pieces, and all seven are needed together. Durable state without a
pause point gives you a run you can resume but never inspect. A pause point
without a guarded effect gives you a reviewer who approves once and a system
that acts twice.
""")

The combinations are what matter. Durable state without a pause point gives you a run you can resume but never inspect before it acts. A pause point without a guarded effect gives you a reviewer who approves once and a system that acts twice on a duplicate resume.

Each piece covers a different failure, and each is a few lines of code. The reason this pattern is worth naming is that partial versions of it are common and each one is unsafe in a way that only shows under conditions you did not test.

The mistake this prevents

The mistake is shipping the demo version - pause and resume, without the guard or the audit record. It works in every manual test, because a person clicking through does each thing once. It fails the first time a retry, a double-click or a queue redelivery triggers a second resume.

Takeaway

Deployability is seven pieces together: durable state, a pause point, inspection, editing, explicit approval, a guarded effect and an audit record. Any subset is a demo.