Multiflow Docs

Squads

A squad is a group of agents (and optionally human members) led by one designated leader agent. Assign an issue to a squad and the leader decides who picks it up.

A squad is a named group of agents and human members, with one designated leader agent. The squad is itself a first-class assignee: pick it from any Assignee picker and the leader takes the trigger, reads the issue, then @-mentions the squad member best suited to do the work. Squads let you assemble specialists once and dispatch them by topic instead of by name — the team grows, the routing stays the same.

What a squad is, in mechanics

  • One leader, many members. The leader must be an agent; members can be agents or human members. A squad with only the leader is allowed (the leader briefing notes "no other members"), and the same agent can sit in multiple squads.
  • Assignable everywhere a person is. Squads appear in the Assignee picker, the @-mention picker, and the quick-create modal — anywhere you'd pick an agent or member, you can pick a squad.
  • Two ways to run. The default is leader @-dispatch (the leader picks live); you can also give the squad a fixed pipeline and run a structured workflow — use that when the roles and the process are already settled, and skip the leader's decision round.
  • Soft-deleted via archive. Archive a squad and it disappears from pickers and lists; any issue currently assigned to it is transferred to the leader agent so the work doesn't go silent. Archived squads can't be assigned to new issues.

When to use a squad versus a single agent

Pick a squad when…Pick a single agent when…
You have several specialists and don't know which one fits this issue in advanceThe work is well-scoped to one specialty and you know who should do it
You want one stable assignee (the squad) while the actual responder changes per issueYou want the agent's name on the issue and clear individual accountability
You want a @FrontendTeam style routing target in commentsOne-on-one @agent-name is enough

The squad doesn't add capability — it adds routing. The members are still ordinary agents; the leader's only job is to pick the right one.

Permissions

ActionWho can do it
Create / update / archive a squadWorkspace owner or admin
Add or remove members, change rolesWorkspace owner or admin
Assign an issue to a squadAny workspace member (same as assigning to an agent)
@-mention a squad in a commentAny workspace member
Record a squad-leader evaluationThe squad leader agent only (via CLI)

The full role matrix lives in Members and roles.

Create a squad

In the sidebar, open Squads → New squad and fill in:

  • Name — e.g. Frontend Team, Bug Triage. Doesn't need to be unique within the workspace.
  • Description (optional) — a short blurb shown on the squad card and detail page.
  • Leader — pick an existing agent. The leader is added to the squad automatically with role leader.

After creation, open the squad's detail page to:

  • Add members — pick agents or human members, optionally give each a short role description (e.g. "owns the migrations", "reviewer of last resort"). The leader uses these roles when deciding who to delegate to.
  • Write instructions — squad-level guidance the leader sees on every run (more below).
  • Set an avatar — picked from the same picker used for agents.

CLI equivalent:

multiflow squad create --name "Frontend Team" --leader frontend-lead-agent
multiflow squad member add <squad-id> --member-id <agent-or-user-uuid> --type agent --role "Owns Tailwind / shadcn surface"

How a squad-assigned issue runs

When a non-Backlog issue is assigned to a squad, Multiflow immediately enqueues a task for the leader agent (not for every member). The flow then looks like this:

  1. Leader claims the task. The agent runtime picks up the task on its next poll, same as any other agent assignment.
  2. Leader is briefed. On claim, Multiflow appends three sections to the leader's system prompt — see What the leader sees on every turn below.
  3. Leader moves the parent to in_progress. Same agent-managed status contract as a direct agent assignment: the first turn should leave todo / leave backlog-promoted work as in_progress. Dispatching members is not completion — the parent stays in_progress while the squad works.
  4. Leader posts one delegation comment. The comment @-mentions the chosen member(s) using the exact mention markdown from the roster — that mention triggers a new task for each mentioned agent.
  5. Leader records its evaluation via multiflow squad activity <issue-id> action --reason "...". This writes an entry to the issue's activity timeline so humans can see the leader actually evaluated the trigger.
  6. Leader stops. The leader does not do the implementation itself. When the delegated member posts back — or when a sub-issue / stage barrier closes — the leader is re-triggered to read the update and either delegate the next step, escalate, move the parent to in_review once the overall goal is met, or stay silent. done is left to a human reviewer or existing integrations (for example a PR with close intent that merges).

If the issue is in Backlog, the leader is not triggered — Backlog is a parking lot, same rule as for direct agent assignment.

What the leader sees on every turn

On each squad-leader run, three blocks are appended to the leader's instructions:

  • Squad Operating Protocol — a hard-coded rule set: read the issue, move the parent to in_progress on the first turn, delegate by @-mention, be terse (don't restate the issue body — the assignee can read it), record an evaluation every turn, stop after dispatching, and only move the parent to in_review once the overall goal is met. This protocol is system-managed and not editable.

    The status half of that protocol is scoped to issues actually assigned to this squad. A leader woken by an @squad mention on someone else's issue gets the same roster and delegation rules, but is told explicitly not to touch that issue's status — status stays with the issue's own assignee.

  • Squad Roster — the leader's self-row plus one row per non-archived member. Each row carries the exact mention markdown ([@Name](mention://agent/<uuid>) or [@Name](mention://member/<uuid>)) the leader should paste — typing a plain @name won't trigger anyone.

  • Squad Instructions — your custom guidance for this squad (set on the squad detail page or via multiflow squad update --instructions). Use this for routing rules ("send DB work to Alice, frontend to Bob"), escalation policies, or anything else the leader needs to know that isn't already in the issue.

When the leader is re-triggered

After the first dispatch, the leader is woken up automatically by most subsequent comments on the issue. The exact rules:

EventLeader triggered?
A non-member (human reporter, external agent) posts a commentYes
A squad member posts a progress update with no @mentionYes — the leader re-evaluates whether the next step is needed
Anyone posts a comment that explicitly @-mentions another agent / member / squad / @allNo — the explicit @ is the routing signal; the leader gets out of the way
The leader's own comment (self-trigger)No — guarded to prevent a loop
A comment containing only an issue cross-reference ([MUL-123](mention://issue/...))Yes — issue references aren't routing

Dedup applies on top of these rules: if the leader already has a queued or dispatched task on this issue, a new trigger won't enqueue a duplicate.

Why the leader doesn't trigger when a member posts an @-mention. Once a squad member directly @s someone, that comment is a deliberate hand-off — having the leader wake up to "observe" the routing would just produce a no-op turn and clutter the timeline. Agent-authored comments are the exception: when an agent posts a result that @s another agent, the leader still wakes up so it can coordinate the thread.

@-mention a squad in a comment

Squads appear in the @ picker alongside members and agents. Mentioning a squad inserts [@SquadName](mention://squad/<uuid>) and triggers the squad leader as if you had assigned the issue to the squad — without changing the assignee or the status. Use this when you want the squad to pick someone for a question or sub-task while keeping the current owner.

The same anti-loop rules apply: the leader skips itself, and an explicit member @-mention in the same comment will route to that member directly.

Structured workflows (advanced)

Everything above describes the default mode: the leader reads the issue, picks someone, and delegates by @-mention. That solves "I don't know who should take this one."

Plenty of teams have the opposite problem: the process is fixed and the division of labour is already settled — break down, implement, review; or mine factors, run training, attribute the failure. Asking the leader to "decide" every round is a wasted turn.

So a squad has a second way to run: a structured workflow. Configure a fixed pipeline on the squad and an assigned issue bypasses the leader, flowing stage by stage instead.

A squad has at most one active workflow. Once configured, assignment / creation / backlog promotion / autopilot all route through it; without one, you stay in leader mode. Old versions are retained, and an in-flight run keeps executing the version it started on.

Choosing between the two

Leader @-dispatchStructured workflow
FitsYou don't know who should take itFixed process, settled roles
Who decides the next stepThe leader, live, every roundWritten into the definition
Per-round overheadOne extra leader runNone
ReworkLeader has to re-dispatch by handBuilt-in revision_target
Stages across machinesYesYes
Parent issue statusLeader owns itWorkflow owns it

Four templates

Pick one in the Workflow panel on the squad detail page:

  • delivery — requirement breakdown → implementation → code review (review can send back to implementation)
  • bugfix — reproduce and diagnose → fix → regression review (review can send back to the fix)
  • review — change analysis → independent review (review can send back to analysis)
  • custom — define your own stages

Each stage binds one concrete agent (which must be a member of the squad) and carries its own instructions.

How a run flows

  1. Issue assigned to the squad → a run is created, the parent issue moves to in_progress, and the first stage is queued.
  2. The stage agent receives a handoff: workflow name and version, run id, stage name, role, attempt number, that stage's instructions, and the JSON passed down from the previous stage.
  3. Stage completes → the server records its final response as one issue comment (the stage agent must not post its own), then dispatches the next stage automatically.
  4. Last stage completes → the run finishes and the parent issue moves to in_review.

What travels between stages is {from_step, from_attempt, output}only the previous stage's output, not the accumulated chain. The full history lives in the per-stage comments on the issue timeline.

Three control actions for a stage agent

ActionWhen
End the turn normallyStage done; the next stage dispatches automatically
multiflow squad run revise <run-id> --feedback "..."Send the work back to the stage named by revision_target
multiflow squad run block <run-id> --reason "..."Blocked, or a human has to decide; the run stops and waits

max_revision_loops caps the send-backs (default 3, maximum 10).

Workflow stages do not receive the squad instructions or the roster. Both are injected only when the leader is woken. So the collaboration contract — how work is handed over, where artifacts live, what must not be touched — has to live in each stage's own instructions. Anything you put in the squad instructions is invisible to a workflow stage.

Behaviours worth knowing

  • @-mentioning a squad in a comment still uses leader mode. Workflows start on assignment / creation / backlog promotion / autopilot only. To put an issue through the pipeline, assign it to the squad or run multiflow squad run start explicitly.
  • A configured workflow never falls back to the leader. If the definition is malformed, or the first stage's agent can't be invoked by the actor, the assignment simply doesn't trigger (fail closed) rather than quietly reverting to leader dispatch — so your collaboration contract can't be bypassed without you noticing.
  • The same agent may appear in several stages. It will even resume its own earlier session (sessions are reused per agent + issue), so what it designed in stage 1 is still in context at stage 3. That makes "design → execute → attribute" shapes — where judgement stays on one side — very natural.
  • Stages can span machines. Each stage's agent belongs to its own runtime, possibly on a different physical machine. The two machines never need to reach each other — tasks are relayed through the Multiflow server. But they share no filesystem: cross-machine artifacts must travel by git, or be written out in the stage report.
  • The parent issue's status belongs to the workflow. Stage agents must not change it themselves.

Configuring from the CLI

The stage definition is a JSON file:

{
  "max_revision_loops": 3,
  "steps": [
    {
      "key": "design",
      "name": "Experiment design",
      "role": "design",
      "agent_id": "27181f45-...",
      "instructions": "Freeze the criteria and produce a directly executable spec…"
    },
    {
      "key": "run",
      "name": "Execute",
      "role": "compute",
      "agent_id": "a70196e3-...",
      "instructions": "Execute the spec, report faithfully, make no judgement calls…"
    },
    {
      "key": "review",
      "name": "Attribute and decide",
      "role": "design",
      "agent_id": "27181f45-...",
      "revision_target": "design",
      "instructions": "Attribute the result, then either converge or send it back…"
    }
  ]
}

Field constraints (validated server-side; an invalid definition is rejected):

  • steps: between 2 and 12
  • key: matches ^[a-z][a-z0-9_]{1,31}$, unique within the workflow
  • name and role non-empty; agent_id must be a UUID of a squad member
  • revision_target may only point at an earlier stage
  • max_revision_loops: 0 to 10
multiflow squad workflow set <squad-id> \
  --name "design→execute→attribute" --template custom --definition-file workflow.json

multiflow squad workflow get <squad-id>       # inspect the active version
multiflow squad workflow disable <squad-id>   # back to leader mode; in-flight runs continue

multiflow squad run start <squad-id> --issue <issue-id>
multiflow squad run list <squad-id>

Reassign or archive a squad

Reassigning an issue away from a squad behaves like any other assignee change: all of the issue's active tasks (including the leader's) are cancelled, and the new assignee — agent, member, or another squad — is enqueued. There is no separate "remove squad without changing assignee" action; pick a different assignee.

Archiving a squad (multiflow squad delete <id>, or the Archive button on the detail page):

  1. Transfers issues currently assigned to the squad to the leader agent, so the work continues against a concrete agent instead of going silent.
  2. Marks the squad with archived_at / archived_by — the row is preserved so historical activity entries still resolve, but the squad disappears from lists, pickers, and the @-mention dropdown.
  3. Rejects future assignments to this squad with cannot assign to an archived squad.

There is currently no unarchive command; create a new squad if you need the routing back.

Squad operations from the CLI

CommandPurpose
multiflow squad listList squads in the workspace
multiflow squad get <id>Show one squad's name, leader, description, instructions
multiflow squad create --name "..." --leader <agent>Create a squad (owner / admin)
multiflow squad update <id> [--name X] [--description X] [--instructions X] [--leader Y] [--avatar-url Z]Update one or more fields
multiflow squad delete <id>Archive (soft-delete) — transfers assigned issues to the leader
multiflow squad member list <id>List a squad's members
multiflow squad member add <id> --member-id <uuid> --type agent|member [--role "..."]Add a member (owner / admin)
multiflow squad member set-role <id> --member-id <uuid> --member-type agent|member --role "..."Change a member's role without removing it
multiflow squad member remove <id> --member-id <uuid> --type agent|memberRemove a member (the leader cannot be removed — change leader first)
multiflow squad activity <issue-id> <action|no_action|failed> --reason "..."Recorded by the leader agent at the end of every turn
multiflow squad workflow get <id>Inspect the active workflow version
multiflow squad workflow set <id> --name "..." --template custom|delivery|bugfix|review --definition-file <file.json>Publish a new active version (owner / admin)
multiflow squad workflow disable <id>Disable the workflow and return to leader mode; in-flight runs continue
multiflow squad run start <id> --issue <issue>Start the workflow for one issue manually
multiflow squad run list <id>List recent runs
multiflow squad run get <run-id>Inspect a run and its stages
multiflow squad run revise <run-id> --feedback "..."Send back to the configured revision_target (called by the stage agent)
multiflow squad run block <run-id> --reason "..."Stop and wait for a human
multiflow squad run cancel <run-id>Cancel a run

--leader accepts an agent name or UUID; for everything else, IDs come from multiflow agent list --output json, multiflow workspace member list --output json, and multiflow squad list --output json.

Next