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>"
}'komrad rpc create-workflow \
--name <string>{
"name": "create_workflow",
"arguments": {
"name": "<name>"
}
}Offered by the komrad MCP server to orchestrator agents.
Request#
CreateWorkflowRequest#
| Field | Type | Description |
|---|---|---|
name | string | What to group its agents under in the panel. required, at most 200 characters |
context | string | Text to append to the system prompt of every agent launched into it. at most 50000 characters |
cwd | string | The directory its agents start in, and the checkout worktrees are cut from. at most 4096 characters |
flags | string | Flags to prefill for each new agent. at most 500 characters |
harness | string | Which CLI its agents run, blank for komrad's default. at most 40 characters, matching ^[a-z0-9-]*$ |
worktree | WorktreeConfig | Whether its agents each get a worktree, and how those are built. |
hooks | list of WorkflowHook | Scripts to hang on moments in its agents' lives. |
Response#
CreateWorkflowResponse#
Types#
WorktreeConfig#
| Field | Type | Description |
|---|---|---|
enabled | bool | Whether komrad cuts a worktree for each agent, or leaves it in the directory it was given. |
baseBranch | string | 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 |
copyPaths | list of string | Files copied into each new worktree, for the untracked ones a build needs. |
symlinkPaths | list of string | Files linked into each new worktree rather than copied, for the large shared ones. |
diffExclude | list of string | Paths or globs the panel leaves out of the diff it draws, such as generated output. |
dir | string | Where new worktrees are made, blank for the parent every workflow shares. at most 4096 characters |
WorkflowHook#
Workflow#
| Field | Type | Description |
|---|---|---|
id | string | The handle every other call names this workflow by. |
name | string | What the panel groups its agents under. |
context | string | Text appended to the system prompt of every agent launched into it, taken as a snapshot at launch rather than read again. |
cwd | string | The directory its agents start in, and the checkout new worktrees are cut from. |
flags | string | Command-line flags prefilled for each new agent. |
harness | string | Which CLI its agents run, blank for komrad's default. |
archivedAt | string | When it was hidden from the panel, unset while it is live. |
worktree | WorktreeConfig | Whether its agents each get a worktree of their own, and how those are built. |
hooks | list of WorkflowHook | Scripts hung on moments in its agents' lives, one per moment. |
contextTruncated | bool | Whether context holds only its opening, which a summary listing returns. |