Skip to main content
POST
Create Definition
Use this API to register a new workflow definition (the static blueprint of nodes, edges, and optional parallel groups). Definitions are validated at write time — schema errors, compileGraph edge-contract errors, and linter graph-shape errors are rejected with explicit validation keys.

Endpoint

POST https://api.velt.dev/v2/workflow/definitions/create

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

Params

data
object
required

Node object example

Edge object examples

Example Requests

Create a marketing-copy approval workflow

Response

Success Response

The read-only compiled block is added to every DefinitionView (create / get / list). compiled.forwardEdges is the runtime forward-edge list the engine drives execution from; compiled.loops is the derived loop region list. The authored edges still echo sourceEdges byte-for-byte. See Get Definition for the full compiled schema.

Failure Response

Errors: INVALID_ARGUMENT (schema, compileGraph, or linter failure; message includes the validation key) / ALREADY_EXISTS (definitionId already in use).