Up to 59% offLaunch prices on every plan while spots last.See pricing
KANBANMCP
Sign inStart free

How to Build an AI Agent Workflow for Parallel Agents

10 min read

Key takeaways

  • An AI agent workflow is a shared board plus a handoff format that lets multiple agent sessions claim tasks and resume each other's work without re-explaining context.
  • Use scripts for deterministic steps with known inputs, and agents for judgment-heavy work where the next step depends on the diff.
  • Enforce one claimant per card and one git worktree per card so parallel sessions never edit the same checkout or duplicate work.
  • The handoff note, not the chat transcript, is the system of record: what changed, which tests prove it, and what the next agent needs to know.
  • Keep merges, migrations, and anything irreversible human-gated; reversibility and blast radius, not task size, decide what stays gated.

An ai agent workflow is a shared board plus a handoff format that lets three or more agent sessions claim tasks, work in separate worktrees, and leave notes the next agent can pick up without you re-explaining context. This article builds one around a concrete bug-fix lane, with a diagram and decision criteria for what stays human-gated.

What is an ai agent workflow and how does it differ from a traditional automation workflow?

A traditional automation workflow is deterministic: the same input produces the same steps in the same order, every time. An ai agent workflow puts a model in the loop, so the steps themselves are chosen at run time. That single difference changes how you structure everything downstream.

The one difference that changes your design: non-determinism

Because the agent decides what to do next, you cannot rely on fixed sequencing. Instead of "run step 3 after step 2", you hand the agent a task with a clear definition of done and let it find its own path. The Anthropic docs on building agents describe this as delegating to a model that uses tools in a loop rather than following a script. Your workflow becomes a set of boundaries, not a flowchart.

Why state, not logic, is the hard part

The logic is cheap; the state is not. Each session starts with no idea what the last one did, so the real design problem is where work lives between runs: which card is claimed, what the previous agent changed, what the next one needs to know. That is why a shared board with handoff notes, like the setup in KanbanMCP's connect docs, outperforms a pile of chat tabs. You are designing for resumability, not execution.

Ai agent vs workflow: when should you use each?

Use a script when the steps are known

If you can write the steps down as a CI job, write the CI job. Linting, running the test suite, bumping a version, regenerating a migration: none of these need an agent, and paying token costs for them is waste. A script also fails loudly and deterministically, which matters when three sessions share one repo.

Use an agent when the input is unpredictable

An agent earns its cost when the next step depends on judgment: diagnosing a flaky test, refactoring after an unexpected diff, deciding whether a bug report is one bug or three. That is the difference between an ai agent and a workflow: the workflow fixes the path, the agent picks the path.

SignalUse a scriptUse an agent
StepsKnown in advanceChosen per instance
InputStructuredUnpredictable
Failure modeDeterministicNeeds review
CostSecondsTokens

The hybrid most repos actually need

Script the deterministic shell, and let agents claim the judgment-heavy cards in between. On a board like KanbanMCP, CI runs the tests and the agent handles the fix, leaving a handoff note for the next session. The honest gap: even the best board cannot stop an agent from misreading a note, so human review stays on the merge.

What does a real example of ai agent workflow look like step by step?

The setup: one repo, three agent sessions, one board

You have a login-bug card, a flaky-test card and a migration card, all in one lane. Three agent sessions run in parallel: Claude Code in one terminal, Codex in another, Cursor in a third. Each session starts with the same instructions in your CLAUDE.md and the same board. Tools like Vibe Kanban follow this same shape: a board where agents pick up coding tasks and open worktrees per task. The difference between a working setup and a mess is what the cards and handoffs actually say.

Step 1: write the card so any agent can claim it

A card is a prompt for an agent that has never seen your project. It needs the failing test name, the file paths involved, the expected behaviour, and a definition of done ("tests pass, no new lint errors"). If a card needs a conversation to understand, it is not a card yet. Split it.

Step 2: claim, branch, work

The agent claims the card, creates a worktree, and works only inside it. Because each session owns a branch, three agents can run without conflicts, and a git diff in the morning shows exactly what each one did.

Step 3: the handoff note format

The handoff note is the part most setups skip, and it is the part that makes the workflow recoverable. Without it, a project that lives only across agent chats becomes hard to recover a few weeks later, a problem solo developers describe repeatedly when their task state scatters across sessions. A good note is short and structured: what changed, which tests prove it, what the next agent or the human needs to know, and any decisions made that are not obvious from the diff. Write the format once into your CLAUDE.md so every session produces the same shape.

The note, not the chat transcript, is the system of record; chats stay disposable. This is also where a dedicated board earns its keep: on KanbanMCP, agents claim a card, do the work and leave that note for the next one, and you watch and steer from the same board (see how agent memory and handoffs work). File-based alternatives like backlog.md work on the same principle: the repo holds the state, not the chat window.

Step 4: human review gate and merge

The merge is human-gated. You read the diff, check the handoff note matches reality, run the tests, and merge or bounce the card with a comment the claiming agent picks up. Script the branch and claim steps, let the agent run autonomously inside the worktree, and keep the gate at review.

How do you design a multi agent workflow without agents stepping on each other?

Four conventions prevent conflicts: one claimant per card, a worktree per card, lanes that don't share files, and a strict split between shared memory and card-local notes.

One claimant per card, enforced

A card can only be claimed by one session at a time. If your board is a markdown file, two agents can both "claim" the same task because nothing stops them. A board with a claim step makes the race impossible: the second agent sees the card taken and picks the next one. On KanbanMCP, claiming is part of the tool call, so an agent that finishes a card leaves a handoff note and the next session picks up from there.

Worktrees and branch-per-card

Each claimed card gets its own git worktree and branch, so parallel sessions never edit the same checkout. Three agents fixing three bugs means three worktrees, three branches, zero merge conflicts until you merge. The human review step is a git diff in the morning, not archaeology across mixed commits.

What goes in shared memory vs what stays in the card

Shared memory holds what every session needs: conventions from your CLAUDE.md, done definitions, lane rules. Card notes hold what only the next claimant needs: what you tried, what failed, what's left. Chat sessions stay disposable; if context only exists in a chat, the project is unrecoverable a week later.

How do you draw an ai agent workflow diagram that engineers can actually implement?

Skip swimlane shapes and actor icons. A diagram you can implement is just states, transitions, and gates, drawn in something like Mermaid, which renders in GitHub and most Markdown viewers.

The diagram for the bug-fix lane

The bug-fix lane from the worked example has five states: backlog → claimed → in_progress → review → done, plus one terminal blocked state reachable from any active state. Three parallel sessions each claim a card, work in their own worktree, and move the card to review with a handoff note. The human gate sits between review and done: nothing merges on your main branch without a human reading the git diff and approving. Draw the gate as a diamond labelled "human", not as another box, so it cannot be silently automated later.

If you run agents beyond Claude Code, KanbanMCP documents per-agent setup on its agents page, so the same board serves sessions from different tools.

Notation: states, gates, and who acts

Keep three conventions. First, every box is a card state, never a person. Second, arrows carry the action that triggers the transition ("agent claims", "human approves"). Third, mark who acts on each arrow: agent or human. If an arrow has no actor, the workflow is underspecified and an agent will guess.

How do you decide which steps in an autonomous ai agent workflow should stay human-gated?

Three questions before you remove a gate

Ask three questions about any step. What is the blast radius if the agent is wrong: one commit or production? How reversible is it: can a git revert undo it, or is it a pushed branch, a migration, a message sent? What does a wrong answer cost: seconds of your morning review or a day of debugging three sessions that built on a bad assumption?

If the blast radius is small, the step is reversible, and a wrong answer costs little, script it or let the agent run it. Anything else stays gated. This matches the NIST guidance on human oversight for AI systems: keep a human in the loop where failures compound (NIST AI Risk Management Framework).

What stayed gated in our example and why

In the bug-fix lane, agents claimed cards, wrote the fix, and ran tests autonomously. Merging stayed human-gated. A wrong fix is cheap to spot in a git diff but expensive if the next session builds on it, and only you know whether the fix matches the intent behind the bug report.

The same logic gates anything irreversible: pushing branches, running migrations, posting comments. Everything else, including handoff notes between sessions, runs without you.

What should you look for in an ai agent workflow platform (or a free ai agent workflow builder)?

Five criteria that matter for coding agents

First, claim enforcement: two agents grabbing the same card is the failure mode that costs you a git diff in the morning. Second, handoff notes that live on the card, not in a chat session you will never reopen. Third, tool-agnostic access, so Claude Code, Cursor and Codex all read and write the same board. Fourth, human visibility: you should see status without opening a terminal. Fifth, low ceremony, because anything past a spec plus a board becomes documentation nobody revisits.

How the common options stack up, honestly

Status quo setups (CLAUDE.md, backlog.md, handover prompts) win on simplicity but have no claim enforcement; you rely on agent discipline. Vibe Kanban and Agent Kanban are direct competitors with boards built for agents; evaluate each against the five criteria rather than feature lists. Taskmaster is adjacent: strong task decomposition, weaker as a shared board across parallel sessions. Flow (FlowCollab) is another direct option worth running through the same checklist.

Where KanbanMCP falls short

KanbanMCP does claim enforcement, handoff notes and a board you can watch, and any MCP client can use it. It falls short on the fifth criterion: it is another hosted dependency rather than a file in your repo, so it adds a moving part that backlog.md does not. If your setup is two sessions on one project, that cost outweighs the benefit.

FAQ

Can I build a free AI agent workflow with backlog.md or Task Warrior instead of a hosted board?

Yes, with a caveat. backlog.md keeps state in files in your repo, which works well for two sessions on one project. The tradeoff is claim enforcement: nothing physically stops two agents from grabbing the same task, so you rely on conventions in your CLAUDE.md. With three or more parallel sessions, that race condition becomes your most common failure.

How many agent sessions can one person realistically steer at once?

Three is the practical ceiling for a solo developer doing real review work. Each session produces a diff you must read and a handoff note you must verify, so your review time, not the agents' capacity, is the bottleneck. Two sessions is comfortable; beyond three, unreviewed agent work compounds.

Do I need a separate AI agent workflow platform if I already have a CLAUDE.md and git worktrees?

Not always. CLAUDE.md plus worktrees plus a markdown task file covers the basics for one or two sessions. A dedicated board adds claim enforcement, handoff notes attached to cards, and visibility without opening a terminal. If two agents have ever silently duplicated the same task, that missing claim step is the reason to consider one.

What goes in a handoff note between agents?

Four things, kept short and structured: what changed, which tests prove it, what the next agent or the human needs to know, and any decisions not obvious from the diff. Skip reasoning and chat history; the diff carries that. Write the format once into your CLAUDE.md so every session produces the same shape.

Is an autonomous AI agent workflow safe for refactors, or only for small fixes?

Refactors are fine if the blast radius stays small and everything is reversible. A refactor confined to one worktree and one branch is exactly as safe as a bug fix: you read the diff and bounce it if it is wrong. Never run autonomously anything irreversible, like migrations or pushed branches. Reversibility, not task size, is the deciding criterion.