Skip to main content
POST
Connect two workflow draft nodes
The reference panel describes the current v3 operation. The notes below describe its v2 compatibility API. Follow the v3 request schema for current calls: v3 can move identifiers from the body or query into the URL. Keep the v2 method, path, and payload together when using the compatibility API.

v2 compatibility notes

POST /api/v2/workflows/createDraftEdge Adds one edge between two nodes of the workflow’s editable draft after the Console builder’s connection checks: no self-loop, at most one edge per ordered node pair, a known router handle, matching output and input types, and a valid outcome error edge. A cycle is not refused here, just as in the builder; draft validation reports it before publish.

Authentication

External App credential or platform API key. Requires permission workflows:write, and the caller must hold both workflows:read and workflows:write at the workflow’s home org unit. Any External App or platform API key with those grants may edit; who created the workflow lends no authority. The org unit a request acts from is not the workflow’s home.

Body

string
required
The workflow ID.
string
required
The source node’s nodeId.
string
required
The target node’s nodeId.
string
The source handle, for example a router route option id.
string
The target handle.
string
Edge condition.
string
Edge label.
boolean
Whether the edge carries the source node’s failure.
string
Edge description.
string
Gather-group label; "" means none.
Handles are set only here. To re-point an edge, delete it and create a new one.

Responses

201 with:
string
The workflow ID.
string
The draft’s ID.
WorkflowDraftGraphEdge
The edge as getDraftGraph returns it.

Errors

Retries

Send an Idempotency-Key header to retry safely. Within 24 hours, the same key and body return the recorded status and body, with Idempotency-Replayed: true, while the caller still holds workflows:write and can read the workflow. Otherwise the repeat answers 409 idempotency_result_unavailable and does not write again. A new key is a new write. Without a key, a retried create meets the node-name rule (409) or the one-edge-per-pair rule (422), and a retried delete answers 404. If an outcome is unknown, read getDraftGraph before acting again.

Authorizations

Authorization
string
header
required

An External App: the JWT it obtains from POST /oauth/token with OAuth2 client_credentials. Pass as Authorization: Bearer <jwt>. An app's static companion key also authenticates as the app, but is deprecated and is not protected by Idempotency-Key.

Headers

Idempotency-Key
string

Path Parameters

workflowId
string
required
Minimum string length: 1

Body

application/json
fromNodeId
string
required
Minimum string length: 1
toNodeId
string
required
Minimum string length: 1
sourceHandle
string
targetHandle
string
condition
string
label
string
onError
boolean
description
string
collectGroup
string

Response

The draft graph write.

data
object
required
meta
object
required