Skip to main content
POST
Create Workflow V2
Integration Prompt for AI Agents
This endpoint creates a scenario definition for your organization. Provide a name, optional description, optional agent links, and a React Flow–style graph with nodes, edges, and optional viewport.

Headers

X-Organization-Id
string
X-API-Key
string
required

API key required to authenticate requests.

Body

application/json

Create a workflow; definition is a React Flow graph (nodes, edges, optional viewport).

name
string
required

Name of the workflow

Required string length: 1 - 255
definition
Definition · object
required

React Flow graph. Omitted nodes / edges default to []. Each node must have a non-empty string id on the node object (not only inside data). Each edge must have a non-empty string id, unique across all edges. With no single or options nodes, the graph is stored as a draft (only multiple-start is rejected). Once there is content, export rules apply (paths, branch_options, etc.).

agent_ids
integer[] | null

Owning agents (must belong to your organization). Omit or null for org-only workflow.

description
string | null

Human-readable description of the workflow

Response

Successful Response

Single workflows_v2 row.

id
string
required

Workflow ID

name
string
required

Name of the workflow

definition
Definition · object
required

Stored React Flow graph (start / single / options nodes). Nodes and edges use top-level string id fields; edge id values are unique within the graph.

created_at
string<date-time>
required

Creation timestamp

organization_id
string | null

Owning organization ID (set by middleware on create)

agent_ids
integer[]

Linked agent ids when the workflow is agent-scoped

description
string | null

Description

dh_sync_summary
Dh Sync Summary · object | null

Present on PUT responses when the definition was updated. Keys: updated, created, marked_stale, skipped, errors.

warnings
string[]

Non-blocking lint warnings emitted at save time (e.g. node text referencing an unknown {{trait_name}}). Empty when the definition is clean or no agents are linked.