OpenClaw TaskFlow: Why Your Agent Now Has a State Machine
OpenClaw's April 2026 cycle added TaskFlow orchestration — durable, inspectable flows that survive crashes, restarts, and human handoffs. Here's why it's the single most structurally important update of the year.
If you ran OpenClaw before April 2026, you ran a powerful single-session agent. It could plan, call tools, retrieve memory, and produce output — but when the session ended, the process ended with it. There was no "what was I in the middle of," because there was no notion of "in the middle of" at all.
The 2026.4.29 release changed that with TaskFlow orchestration. It is, structurally, the most important update OpenClaw has shipped this year.
Key Takeaways
- TaskFlow is a durable flow primitive — a long-lived, inspectable, recoverable unit of agent work.
- Before TaskFlow, OpenClaw context dissolved when a session ended. Serious work rarely fits inside a single session.
- A flow has its own state: it can be inspected mid-run, routed to a different worker, cancelled, paused, or recovered after a crash.
- TaskFlow pairs with the provenance-rich memory updates so that flow state and the agent's reasoning trace stay correlated.
- The 2026.5.7 release built on TaskFlow with computed status fields and stale context invalidation.
- For Claude Code users, TaskFlow occupies the niche that Claude Code's new
/goalcommand points at — long-running work with a defined completion condition.
The Problem TaskFlow Solves
The standard agent loop looks like:
user input → plan → call tool → observe → plan → call tool → ... → final answer
This is fine for things that complete in one sitting. It fails badly for work that:
- Spans hours or days.
- Needs human approval midway.
- Calls external systems that may be unavailable for an hour.
- Should survive a process restart.
- Needs to be picked up by a different agent operator.
In each of those cases, the agent runtime has to remember "where it is" outside of in-process memory. That is exactly what TaskFlow gives OpenClaw.
What a Flow Looks Like
A TaskFlow has three first-class concepts:
- Steps. Discrete units of work, each with inputs, outputs, and an idempotency key.
- Edges. Conditional transitions between steps, including waits and human-in-the-loop gates.
- State. A durable record of every step's status, results, and any in-flight context.
Conceptually:
flow: refund-customer-flow
inputs:
- order_id
- reason
steps:
- id: validate
runs: agent.tool("stripe.lookup", order_id)
- id: approve
requires: human_approval(role="ops")
- id: refund
runs: agent.tool("stripe.refund", order_id, reason)
- id: notify
runs: agent.tool("email.send_template", "refund-confirmation")
The flow state is persisted after every step. If the process crashes between approve and refund, the next worker can resume exactly there.
Inspectability
A flow is not a black box. Each step records:
- Inputs and outputs.
- Tool calls made.
- Memory items written or read.
- The model and effort level used.
- A stable correlation ID linking it to the originating agent session.
In practice this means support and ops teams can look at a stuck flow and see what happened. No more "I think the agent retried three times but I'm not sure."
Routing, Cancellation, Recovery
Three operations become trivial once flows have durable state:
- Routing. A flow can be handed from one operator (a particular agent instance, or a particular human reviewer) to another. The state moves with it.
- Cancellation. A flow can be cancelled cleanly. In-flight steps run to completion or abort according to their declared cancellation policy; downstream steps are skipped.
- Recovery. After a crash, a flow resumes from the last completed step. Combined with the stale context invalidation in 2026.5.7, recovery does not silently reuse old tool outputs.
How TaskFlow Compares to Claude Code's /goal
Claude Code's /goal command, shipped in spring 2026, also targets multi-turn work with a defined completion condition. The two differ in where the durability lives.
| Property | Claude Code /goal | OpenClaw TaskFlow |
|---|---|---|
| Primary surface | CLI session | Server runtime |
| Durability | In-session; survives turns | Persistent; survives restarts |
| Inspectability | Overlay panel in the CLI | Server-side state + dashboards |
| Concurrency | One session at a time | Many concurrent flows |
| Best for | A focused coding session you don't want to abandon | A business process that needs to run across days and operators |
You can use both. A common pattern is to use TaskFlow as the durable outer loop, and have it spawn Claude Code sessions (via print mode or tmux) for the coding-heavy steps.
How TaskFlow Pairs With the May 2026 Reliability Wins
TaskFlow was the headline of April. May's 2026.5.7 release shipped the unglamorous fixes that make TaskFlow trustworthy in production:
- Computed status so a flow's
doneflag reflects the terminal step's actual output. - False delivery prevention so a notification step does not advance the flow until the message is confirmed.
- Plugin artifact verification so a third-party step cannot be silently swapped.
- Boundary credential resolution so a step only sees the credentials it is scoped for.
- Stale context invalidation so a flow that resumes after hours does not reuse data that may no longer be true.
Together, April + May give OpenClaw the durability and the discipline. One without the other would not have been enough.
Practical Adoption
Three patterns that work well today:
- Convert your nightly cron jobs to flows. Anything that runs more than a handful of steps and currently has bespoke retry logic is a candidate.
- Wrap human-in-the-loop processes. Refund approval, content moderation review, vendor onboarding — anywhere a human reviews mid-process — fits TaskFlow's
requires: human_approvalgate. - Use flows for cross-channel customer interactions. Start the flow when a customer messages on Telegram, continue it when they reply on email an hour later. The flow holds the conversation state.
Bringing It Back Together
OpenClaw before TaskFlow was a fast single-session agent. OpenClaw after TaskFlow is a runtime for serious, long-running, supervised work. The April release got the architecture in. The May release made it production-grade.
For the broader picture, read OpenClaw vs Hermes Agent: 2026 Platform Comparison and OpenClaw vs Hermes vs Claude Code.
Sources
- OpenClaw releases overview — https://openclaw.com.au/updates
- OpenClaw GitHub releases — https://github.com/openclaw/openclaw/releases
- OpenClaw documentation — https://docs.openclaw.ai
- Related: OpenClaw 2026.5.7 Reliability Wins
- Related: OpenClaw Provenance-Rich Memory
- Related: Claude Code
/goaland the new agent loops