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

string
required
Your API key.
string
required

Body

Params

object
required

Node object examples

An agent node must set url or urlPath, or the definition is rejected with APPROVAL_AGENT_NODE_REQUIRES_URL_OR_URLPATH. blocking: true requires a sibling resolutionPolicy to pass schema validation, and the pair is then rejected at run time with agent-blocking-not-supported; place a human node downstream of the agent instead.

Edge object examples

Example Requests

Create a marketing-copy approval workflow

Start runs from a nightly cron schedule

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).