micro / micro/go-micro

flow: durable agentic workflow — HITL pause + per-tool-call checkpointing

Open
#4,816 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-human
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 pauseflow/steps.go:107 has no waiting state; a step needing external input must block the process or fail. No Resume(runID, injectedInput).
  • The agent's dynamic loop is opaque to checkpointingflow/steps.go:269 (Dispatch)/flow.go:306 (callAgent): a whole Agent.Chat turn 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:82 Loop not per-iteration checkpointed; steps.go:457 at-least-once (duplicate side effects on resume) not exactly-once; :158 no 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 into State.
  • 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.