Create Workflow
Create a new workflow in the current workspace.
Validates the workflow `definition` (graph structure, node types, edge
connectivity) before persisting. Returns 422 with structured details if
the definition fails validation. Requires at least `editor` role in the
workspace; viewers cannot create workflows.
The `definition` contains a `graph` (nodes and edges) and an `execution`
block (ordered step list and execution params). Omitting `definition`
creates a workflow with an empty graph that can be edited later.
Authentication
AuthorizationBearer
Clerk JWT token
OR
AuthorizationBearer
Onepin live API key (op_live_...). Test and public keys are reserved in Phase 1.
Headers
X-Workspace-Id
Request
This endpoint expects an object.
name
Human-readable workflow name (1–200 characters, non-blank).
description
Optional description shown in the workflow list (max 5000 characters).
definition
Graph and execution config. Omit to create an empty workflow.
Response
Successful Response
data
meta
Errors
422
Unprocessable Entity Error

