LangGraph, Temporal or CrewAI: Pick by the Job
Run the same five-step job through each candidate, with the same ugly tests, and pick on what waiting, resuming and retrying actually cost.
Answer first
Choose by the job, not the demo. LangGraph fits an agent whose steps, branches and human pauses you want to draw as a graph with saved state. Temporal fits a process that must survive restarts and long waits with recorded history and retries. CrewAI fits work that really is several roles collaborating, coordinated by a flow. If the job has one approval step and you already run a database and a queue, plain code may be enough. Run the same job through each candidate with the same hard tests before you commit.
The test track
Take one small job with real failure points. Our example: read a contract, find the renewal date and the risky clauses, get a lawyer's approval, publish the summary. That is five steps: retrieval, a model review, code validation, a human approval, then publish. Whatever you pick, put these tests at the end of the track:
- A missing clause: does the system say "not stated" instead of inventing one?
- A false date: does code check that the quoted passage really appears in the document?
- A crash while waiting for approval: after a restart, does it continue and publish exactly once?
- A double click on approve: does the registry get one record?
What each tool is for
| Question | LangGraph | Temporal | CrewAI | | --- | --- | --- | --- | | Core idea | A graph of nodes with shared, typed state | Durable workflow code with recorded history | Crews of role-based agents, coordinated by flows | | How waiting works | interrupt stops the run; a checkpointer saves state; resume with the same thread id | The workflow parks on a wait condition; a worker replays history after restart | Flows manage state and process; check durability for your setup | | Recovery model | Re-run from the saved state; the interrupted node restarts from its start | Replay the workflow code against event history; activities are retried | Check the current documentation; we did not test it | | Main gotcha | Code before the interrupt runs twice | Workflow code must be deterministic; changing it under a parked run can break replay | Extra personas add model calls without adding value | | Fits when | You want an agent with branches and human pauses in Python | You need long waits, timers and retries across several steps | The work is truly multi-role |
The statements about LangGraph and Temporal come from their documentation. The LangGraph interrupts page says the node restarts from the beginning when resumed, and that a checkpointer and a thread id are what let a run resume. The Temporal workflow documentation says workflow code must be deterministic and that activities hold the non-deterministic work, such as calls to external services and model invocations. CrewAI's introduction describes flows as the structure of an application, with state and execution control, and crews as teams that do delegated work; its docs say flows manage state, and we did not test how that survives a restart. We read these pages and did not run any of the three frameworks for this post.
The approval example, step by step
The same shape shows up in a refund. A refund of twenty-five dollars needs a manager's approval and the manager has gone home. Three honest options, in order of weight:
- Plain code and a queue. Write a row saying the refund is waiting and let the worker move on. When the manager approves, a new job reads the row and continues. Nothing sleeps; the database remembers. The new work is the state transitions, permissions and recovery.
- LangGraph. Compile the graph with a durable checkpointer, call
interruptin the approval node, and resume with the same thread id. Put the registry call after the interrupt, not before it, or the approver says yes once and the action runs twice. - Temporal. Put the model call and the payment call in activities, wait on a signal in the workflow, and park. The approval service authenticates the manager first, because the workflow cannot tell who pressed the button. A signal accepted by Temporal means "received", not "applied".
Where schema validation misleads
Typed output from a library such as Pydantic AI guards the shape of an answer. A model can return a perfectly formatted renewal date the contract never stated. Let the model answer "not stated", make it quote the passage it relied on, and have code check that the quote appears in the source.
Step-by-step approach
- Write the five-step job and the four ugly tests above.
- Build option 1 first and see where it hurts: collisions between timers, reminders and cancellations are the signal to move up.
- Prototype the pause-and-resume step in the candidate framework.
- Run the crash test and the double-click test against it.
- Count what you must now operate: a database, a worker fleet, an extra service.
- Pick the lightest tool that passes all four tests.
Risks and limits
- Framework features change quickly; read the current documentation before you build.
- This post compares ideas and documented behavior. We did not benchmark the frameworks or run them.
- Business rules and authorization belong in your application around any of these tools.
Related reading
FAQ
- Is LangGraph or Temporal better for a long-running AI agent?
- Neither is better in general. LangGraph models an agent as a graph of steps with saved state and human pauses. Temporal records a durable history of a workflow and replays it after a failure. Choose by whether the wait, retry and recovery logic is simple enough to own yourself, and by which ecosystem your team already runs.
- What happens when a LangGraph run resumes after an interrupt?
- Per the LangGraph documentation, the node restarts from its beginning, so code before the interrupt runs again. Keep side effects such as publishing below the interrupt, or make them idempotent.
- Why must Temporal workflow code be deterministic?
- Because recovery replays the code against recorded history. If the code issues different commands than the history holds, the execution fails with a non-determinism error. Unpredictable work, including model calls, belongs in activities.
- When does CrewAI make sense?
- When a task benefits from several agents with distinct roles and tools. Its documentation pairs crews with flows that manage state and control the overall process. Add a role only if it earns its model calls.