flow: durable agentic workflow — HITL pause + per-tool-call checkpointing
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.1k
- Forks
- 2.4k
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 23
Description
Context (from the gap audit — architectural, human-led, NOT for autonomous auto-merge)
flow/ is close on the deterministic axis (it checkpoints and resumes without replaying completed steps) but not yet a first-class durable agentic workflow — the convergence leg Dapr-Agents leads with, and the thing Mu had to hand-roll (agent/flows.go).
Two gaps make an agent loop non-durable:
- No human-in-the-loop pause —
flow/steps.go:107has nowaitingstate; a step needing external input must block the process or fail. NoResume(runID, injectedInput). - The agent's dynamic loop is opaque to checkpointing —
flow/steps.go:269(Dispatch)/flow.go:306(callAgent): a wholeAgent.Chatturn is one flow step, so a crash mid-turn replays every tool call. The durable unit is a fixed step list, not the agent's pausable per-tool-call loop. - Secondary:
flow/loop.go:82Loopnot per-iteration checkpointed;steps.go:457at-least-once (duplicate side effects on resume) not exactly-once;:158no run leasing for multi-replica.
Why human-led
This is a core primitive design touching the agent↔flow seam, exactly-once semantics, and multi-replica leasing — architectural, ambiguous, and high-blast-radius. It should be designed 1:1, not auto-built. Mu is the reference deployment to validate it against.
Rough shape (to be designed, not prescriptive)
- A
waiting/suspended run status + an await-input step signal that checkpoints and returns cleanly;Resume(ctx, runID, input)feeds it intoState. - Make the agent tool loop emit durable checkpoints per tool call (agent writes step records into the same
Run), so resume re-enters at the last completed tool call. - Idempotency keys per step (exactly-once) and a store CAS/lease on the run record (multi-replica).
Discuss the approach here before implementation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading flow/steps.go, flow.go, and flow/loop.go, especially the cited waiting, Dispatch, callAgent, Loop, and at-least-once sections. Compare the existing flow behavior with Mu's agent/flows.go reference deployment. Done means an agreed design for human pause/resume, per-tool-call checkpoints, idempotency, and run leasing before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- ai, backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100