create_workflow

Create a workflow to group agents under.

Workflowwritesnot idempotentMCP tool

Nothing runs as a result; this is organisation. The cwd and flags become the defaults prefilled when an agent is created inside it, and the context is appended to those agents' system prompts. worktree.enabled gives every agent a git worktree of its own, cut from cwd, which komrad makes before the agent starts and removes when it is deleted; left off, agents run in the directory they are given and komrad provisions nothing. hooks hang your own scripts on a moment in those agents' lives, one per moment, each naming a hook from list_hooks and one of pre-launch, post-launch, post-resume, post-restore or pre-teardown; komrad waits for pre-launch and pre-teardown and not the others, so a pre-launch that fails abandons the create and a pre-teardown that fails stops the delete and leaves the directory alone. worktree.baseBranch is the branch worktrees are cut from and every agent's work is measured against, filled in from the clone when left blank, which is what origin/HEAD names there, else the branch cwd is on, else main; the response carries the name stored. worktree.dir names the parent new worktrees are made in, blank meaning the one every workflow shares. worktree.diffExclude drops paths from the diff the panel draws, as paths or globs relative to the checkout such as proto/gen or *.pb.go. docs/src/content/guides/workflows.md says why each is there.

Calling it#

curl -X POST http://127.0.0.1:8787/workflow.v1.WorkflowService/CreateWorkflow \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "<name>"
}'

Request#

CreateWorkflowRequest#

FieldTypeDescription
namestring

What to group its agents under in the panel.

required, at most 200 characters

contextstring

Text to append to the system prompt of every agent launched into it.

at most 50000 characters

cwdstring

The directory its agents start in, and the checkout worktrees are cut from.

at most 4096 characters

flagsstring

Flags to prefill for each new agent.

at most 500 characters

harnessstring

Which CLI its agents run, blank for komrad's default.

at most 40 characters, matching ^[a-z0-9-]*$

worktreeWorktreeConfig

Whether its agents each get a worktree, and how those are built.

hookslist of WorkflowHook

Scripts to hang on moments in its agents' lives.

Response#

CreateWorkflowResponse#

FieldTypeDescription
workflowWorkflow

The workflow as recorded, holding no agents yet.

Types#

WorktreeConfig#

FieldTypeDescription
enabledbool

Whether komrad cuts a worktree for each agent, or leaves it in the directory it was given.

baseBranchstring

The branch worktrees are cut from and every agent's work is measured against, filled in from the clone when left blank on create and never blank once stored.

at most 255 characters

copyPathslist of string

Files copied into each new worktree, for the untracked ones a build needs.

symlinkPathslist of string

Files linked into each new worktree rather than copied, for the large shared ones.

diffExcludelist of string

Paths or globs the panel leaves out of the diff it draws, such as generated output.

dirstring

Where new worktrees are made, blank for the parent every workflow shares.

at most 4096 characters

WorkflowHook#

FieldTypeDescription
eventstring

Which moment fires it, such as pre-launch or post-resume.

required, at most 40 characters

scriptstring

The file in the hooks directory to run, blank to fire nothing at that moment.

required, at most 255 characters

Workflow#

FieldTypeDescription
idstring

The handle every other call names this workflow by.

namestring

What the panel groups its agents under.

contextstring

Text appended to the system prompt of every agent launched into it, taken as a snapshot at launch rather than read again.

cwdstring

The directory its agents start in, and the checkout new worktrees are cut from.

flagsstring

Command-line flags prefilled for each new agent.

harnessstring

Which CLI its agents run, blank for komrad's default.

archivedAtstring

When it was hidden from the panel, unset while it is live.

worktreeWorktreeConfig

Whether its agents each get a worktree of their own, and how those are built.

hookslist of WorkflowHook

Scripts hung on moments in its agents' lives, one per moment.

contextTruncatedbool

Whether context holds only its opening, which a summary listing returns.