Skip to main content
POST
Add a node to a workflow draft
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/createDraftNode Adds one node to the workflow’s editable draft through the same checks the Forge Console builder runs, and gives it a new logicalNodeId. The builder shows the node at once.

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
produce, router, join, publish, procedure or notify.
string
required
Unique within the draft and not blank.
string
Optional description.
object
required
{ x, y } canvas coordinates.
WorkflowDraftGraphNodeConfig
Machine-writable configuration; see below.

What a machine can change

A node’s config takes only the structure and content fields: prompt, timeout, onTimeout, maxOutputTokens, tier, presentationHint, includeUpstreamOutputs, inputs, outputs, outcomeRouting, routingStrategy, rules, routingPrompt, routeOptions, multiSelect, joinStrategy, joinThreshold, publishMessageFormat, publishPresentation and message. Every field that names an agent, worker, person, role, recipient, channel, address, credential, tool, skill, procedure, model or sandbox stays Console-only: agentDefinitionId, agentVersion, pinnedToolContract, toolOverrides, estimatedCost, autoInjectCases, workerAssignment, syndicationTargets, slackChannel, escalationChannel, assignee, routingModel, routerAgentOverride, destination, apiEndpoint, channelId, emailTo, emailSubject, notifyChannels, notifyRecipients, notifyTitle, validation, sandbox, capabilityHints, pinnedSkillVersions, procedureId, procedureVersion, sourceStepId and credentialBindings. A body that names one answers 400, and a write never sets, clears or reads them. A produce node therefore needs a person to assign its agent or worker in the Console before the workflow can be published.

Responses

201 with:
string
The workflow ID.
string
The draft’s ID.
WorkflowDraftGraphNode
The node as getDraftGraph returns it: nodeId, logicalNodeId, type, name, description, position, config and consoleOnlyConfig.

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
type
enum<string>
required
Available options:
produce,
router,
join,
publish,
procedure,
notify
name
string
required
position
object
required
description
string
config
object

Response

The draft graph write.

data
object
required
meta
object
required