Skip to main content
POST
/
v1
/
workflows
/
{workflow_id}
/
nodes
Add Workflow Node
curl --request POST \
  --url https://api.xpander.ai/v1/workflows/{workflow_id}/nodes \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "connection_id": "<string>",
  "operation_id": "<string>",
  "instructions": "<string>",
  "agent_id": "<string>",
  "advanced": {
    "definition": {
      "code": "<string>"
    },
    "id": "<string>",
    "next_node_ids": [
      "<string>"
    ],
    "name": "<string>",
    "description": "<string>",
    "condition": {
      "term": "<string>",
      "group_id": "<string>",
      "path": "<string>",
      "value": null
    },
    "retry_strategy": {
      "enabled": false,
      "max_retries": 3
    },
    "iterative_strategy": {
      "enabled": false,
      "max_iterations": 3,
      "end_condition": {
        "term": "<string>",
        "group_id": "<string>",
        "path": "<string>",
        "value": null
      }
    },
    "stop_strategy": {
      "enabled": false,
      "stop_on_failure": true,
      "stop_on_condition": {
        "term": "<string>",
        "group_id": "<string>",
        "path": "<string>",
        "value": null
      }
    },
    "input_type": "text",
    "input_schema": {},
    "input_instructions": "<string>",
    "agentic_context_input_instructions": "<string>",
    "agentic_context_output_instructions": "<string>",
    "return_this": false
  },
  "after_node_ids": [],
  "next_node_ids": []
}
'
[
  {
    "id": "<string>",
    "type": "<string>",
    "name": "<string>",
    "next_node_ids": [],
    "asset_id": "<string>",
    "connection_id": "<string>",
    "operation_id": "<string>",
    "target_agent_id": "<string>"
  }
]

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

workflow_id
string
required

Query Parameters

deploy
boolean
default:true

Deploy the workflow after adding so the change takes effect immediately.

Body

application/json

Add a node to a workflow DAG. Use action/agent for the common cases, or advanced for full control.

type
enum<string>
required

Node kind to add.

Available options:
action,
agent,
advanced
name
string | null

Node name.

connection_id
string | null

Connection id. Required for type=action.

operation_id
string | null

Operation catalog id. Required for type=action.

instructions
string | null

Instructions for the action/agent node.

agent_id
string | null

Agent id. Required for type=agent.

advanced
OrchestrationNode · object

A full OrchestrationNode. Required for type=advanced.

after_node_ids
string[] | null

Append the new node id to the next_node_ids of these existing nodes.

next_node_ids
string[] | null

Ids of nodes to run after the new node.

Response

Successful Response

id
string
required

Node id (use to update/remove the node).

type
string
required

Node type (action, agent, classifier, ...).

name
string | null

Node name.

next_node_ids
string[]

Ids of nodes that run after this one.

asset_id
string | null

Referenced asset id for action/agent nodes.

connection_id
string | null

Connection id parsed from an action node's asset_id.

operation_id
string | null

Operation catalog id parsed from an action node's asset_id.

target_agent_id
string | null

Agent id for agent nodes.