update_workflow

Replace a workflow's name, context, directory, flags, worktree config and hooks.

WorkflowwritesidempotentMCP tool

Every field is written, so read the workflow first and send back the ones you are not changing, the hooks list included. Editing the context reaches only agents spawned afterwards, since existing agents took a snapshot at launch, while worktree.enabled reaches agents already running, since whether komrad removes an agent's directory is read when the agent is deleted. worktree.baseBranch is the branch worktrees are cut from and every agent's work is measured against, and a blank one is refused here, so send back the stored name when it is not what you are changing. 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/UpdateWorkflow \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "<id>",
  "name": "<name>"
}'

Request#

UpdateWorkflowRequest#

FieldTypeDescription
idstring

Which workflow to rewrite.

required

namestring

Every field here is written, so send back the ones you are not changing.

required, at most 200 characters

contextstring

Reaches only agents launched afterwards, since existing ones took a snapshot.

at most 50000 characters

cwdstring

Where agents launched afterwards start.

at most 4096 characters

flagsstring

Flags prefilled for agents launched afterwards.

at most 500 characters

harnessstring

Which CLI agents launched afterwards run.

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

worktreeWorktreeConfig

Turning worktrees off reaches agents already running, since whether komrad removes a directory is read when the agent is deleted.

hookslist of WorkflowHook

The whole hook list, so send back the ones you are keeping.

Response#

Empty#

No fields.

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