Skip to main content
Workflow templates are reusable ordered task chains. A template defines steps and their blocking dependencies. Instantiating a template expands it into real tasks (in the issues table) with task_dependencies wired between them. UI status: The API is fully implemented. The list + step-builder UI is deferred to 1.1 (see docs/roadmap.md). Use the API directly in the meantime.

List Templates

Returns all templates for the company.

Get Template

Returns a single template with its steps and dependencies.

Create Template

Requires founder or team_lead role.
Step fields: Dependency fields: fromStep and toStep must be different. Circular dependencies are not validated server-side — design your DAG carefully. Returns 201 with the created template. agentCompletionPolicyOverride is optional and accepts review_required, agent_can_complete, or null. Only a human operator with task-assignment authority may set or change it. It overrides company and project/department defaults for tasks instantiated from the template, unless a task-level override is supplied or the company review guardrail forces review. Each generated task stores the resolved policy and provenance snapshot.

Update Template

Requires founder or team_lead role. All fields optional. Replaces steps and dependencies if provided (not merged).

Instantiate Template

Requires founder or team_lead role.
Both fields are required. Creates one task per step in the template, all linked to the given goal and project. Creates task_dependencies rows for each dependency pair. Increments instantiationCount on the template. Returns 201:
The returned task IDs correspond to steps in order order. After instantiation, task assignees can be set via PATCH /api/issues/{taskId}.

Delete Template

Requires founder or team_lead role. Deletes the template record. Does not affect tasks already created by previous instantiations. Returns the deleted template.

Notes

  • Templates live in the workflow_templates table. Schema: name, description, steps (JSONB ordered array), dependencies (JSONB fromStep/toStep pairs), instantiationCount, workspaceMode, agentCompletionPolicyOverride.
  • Tasks created by instantiation are ordinary tasks — they can be edited, reassigned, and managed via the standard task API.
  • The workspaceMode field sets the execution workspace mode for all instantiated tasks: department_default | shared | isolated.