flow

orchestrate many coder tasks from one TypeScript file

Orchestrate many coder tasks with a plain TypeScript file: dispatch, gates, concurrency, journaling, and resume. Flows live in .coder/flows/ (workspace) or ~/.coder/flows/ (global). See coder docs flows.

flow run <flow> [inputs] [--wait] [--args <args>] [--concurrency <concurrency>] [--max-tasks <max-tasks>] [--dry-run] [--json] [--cwd <cwd>]

run a flow in the background (--wait to follow it live)

Run a flow: a TypeScript file that orchestrates many coder tasks with gates, journaling, and resume. Prints the run id and orchestrates in the background; --wait follows the run in the foreground with live progress (Ctrl-C detaches; it keeps running), and coder flow watch shows the same lines any time. Stop a run with coder flow stop.

  • <flow> the flow: a discovered name or a path
  • <inputs> the flow's input as bare key=value pairs
  • --wait follow the run in the foreground (Ctrl-C detaches; it keeps running)
  • --args <args> the flow's input as a JSON value (or pass bare key=value pairs)
  • --concurrency <concurrency> tasks running at once (default: CPU count)
  • --max-tasks <max-tasks> total tasks the run may dispatch (default: CPU count x 10)
  • --dry-run print every resolved prompt and gate command without dispatching
  • --json JSON output
  • --cwd <cwd> workspace directory; default current
coder flow run audit-routes --wait  # run a discovered flow
coder flow run ./scratch/one-off.ts --wait  # run a flow by path
coder flow run verify --args '{"clusters":["a","b"]}' --wait  # pass structured input

flow list [--archived] [--limit <limit>] [--json] [--cwd <cwd>]

recent flow runs (by default running + just stopped)

List recent flow runs, most recent first: running runs plus ones that ended within the last 30 minutes. Older runs auto-archive and move to --archived.

  • --archived show archived runs (auto-archived or via flow archive)
  • --limit <limit> show at most n runs (default all)
  • --json JSON output
  • --cwd <cwd> workspace directory; default current

flow discover [--json] [--cwd <cwd>]

list flows runnable here (workspace + global)

List every flow discoverable from the current directory: workspace flows in .coder/flows/ (walking up to the repo root) and global flows in ~/.coder/flows/.

  • --json JSON output
  • --cwd <cwd> workspace directory; default current

flow result [run-id] [--tail <tail>] [--json] [--cwd <cwd>]

progress and result of a run

Show a flow run's status and result, with its tasks, gates, and token ledger. --tail caps the step rows (0 for the result alone). Defaults to the most recent run. To watch a run live, prefer coder flow watch.

  • <run-id> the run (default: the most recent)
  • --tail <tail> show the last n step rows (default: all; 0 hides them)
  • --json JSON output
  • --cwd <cwd> workspace directory; default current
coder flow result --tail 0  # the most recent run's result, no step rows

flow watch [run-id] [--tail <tail>] [--from <from>] [--json] [--cwd <cwd>]

watch a run live (replay + follow)

Watch a flow run live: replay its progress lines from the start, then keep following while it runs (Ctrl-C detaches; it keeps running). Blocks until it finishes; exits 0 on success, 1 otherwise. Defaults to the most recent run. For the result alone, prefer coder flow result. Alias: stream.

With --from , or as a tool, it returns the events from event n on without following, and next: the command that continues them while the run goes on.

  • <run-id> the run (default: the most recent)
  • --tail <tail> replay only the last n events first (default: all)
  • --from <from> return the events from event n on instead of following them
  • --json JSON output
  • --cwd <cwd> workspace directory; default current
coder flow watch  # follow the most recent run to completion
coder flow watch <run-id> --from 0 --json  # the events so far, and the command that continues them

flow stop [run-id] [--keep-tasks] [--json] [--cwd <cwd>]

stop a run and its still-running tasks

Stop a running flow: signal the orchestrator so it stops dispatching, stamp the run stopped, and stop its still-running tasks. Defaults to the most recent run; the journal stays ready for coder flow resume.

  • <run-id> the run (default: the most recent)
  • --keep-tasks leave the run's still-running tasks running
  • --json JSON output
  • --cwd <cwd> workspace directory; default current

flow resume [run-id] [--wait] [--args <args>] [--concurrency <concurrency>] [--max-tasks <max-tasks>] [--dry-run] [--json] [--cwd <cwd>]

continue a stopped or edited run

Re-run a flow from its journal: finished steps replay instantly, the first changed or new step onward runs live. Defaults to the most recent run. Accepts the same flags as flow run.

  • <run-id> the run (default: the most recent)
  • --wait follow the run in the foreground (Ctrl-C detaches; it keeps running)
  • --args <args> the flow's input as a JSON value (or pass bare key=value pairs)
  • --concurrency <concurrency> tasks running at once (default: CPU count)
  • --max-tasks <max-tasks> total tasks the run may dispatch (default: CPU count x 10)
  • --dry-run print every resolved prompt and gate command without dispatching
  • --json JSON output
  • --cwd <cwd> workspace directory; default current
coder flow resume  # continue the most recent run

flow archive [run-id] [--all-stopped] [--json] [--cwd <cwd>]

hide a run (or all stopped) from the list

Archive a flow run so it drops out of the default list (see it again with coder flow list --archived [--limit N]). Pass --all-stopped to archive every finished run. A running run must be stopped first.

  • <run-id> the run to archive
  • --all-stopped archive every stopped (finished) run
  • --json JSON output
  • --cwd <cwd> workspace directory; default current

flow delete [run-id] [--all-archived] [--json] [--cwd <cwd>]

delete a run's record (or all archived)

Delete a flow run's record from disk (its journal, events, and logs). This is permanent; the run's tasks are ordinary tasks and are not touched. Pass --all-archived to delete every archived run at once. A running run must be stopped first.

  • <run-id> the run to delete
  • --all-archived delete every archived run
  • --json JSON output
  • --cwd <cwd> workspace directory; default current