Create Template
Create a reusable workflow template in the current workspace.
Templates are workspace-private on creation (is_public=false, is_starter=false).
The full WorkflowDefinition (graph + execution config) is validated at write
time — structural errors (duplicate node/edge IDs, port mismatches, etc.) surface
here rather than when a caller later clones the template into a workflow.
Use this to capture a workflow configuration you intend to reuse or share. To
make a template available in the public gallery, an admin must mark it public
via the admin API. To create a runnable workflow from an existing template,
use POST /templates/{id}/clone instead.
Requires workspace editor role or higher.
Authentication
Headers
Request
Display name for the template (1–200 characters, not blank).
Optional human-readable description shown in the gallery (max 2,000 characters).
Full workflow definition (graph + execution config). Validated at write time — structural errors are rejected with 422.
Response
Response shape. workspace_id is intentionally omitted so the gallery
endpoint (which returns rows from any workspace) does not leak tenant
ownership IDs across tenants. created_by is retained as author
provenance for public/starter rows.
definition is the serialized WorkflowDefinition JSONB (same shape as
Workflow.definition) — a template is a reusable workflow snapshot.

