Skip to main content
POST
/
v1
/
workflows
/
{workflow_id}
/
invoke
curl --request POST \
  --url https://api.xpander.ai/v1/workflows/{workflow_id}/invoke \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "input": {
    "text": "What is xpander.ai?",
    "user": {
      "id": "user-uuid",
      "email": "user@example.com"
    }
  }
}
'
{
  "id": "02843b37-4d77-48a0-8da7-2c76afe54401",
  "agent_id": "47c3b020-9a6b-4699-8d94-d92d71929b53",
  "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
  "status": "completed",
  "result": "Hello! 👋",
  "created_at": "2026-04-10T19:01:22.898813Z",
  "finished_at": "2026-04-10T19:01:33.120590Z",
  "source": "api"
}

Documentation Index

Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt

Use this file to discover all available pages before exploring further.

Invoke a workflow synchronously. The request blocks until the entire pipeline completes — data flows through each node on the canvas from START to END, and the final result is returned. For longer-running workflows, use Invoke Workflow (Async) or Invoke Workflow (Stream) to track progress in real time.

Path Parameters

workflow_id
string
required
Workflow ID (UUID)

Query Parameters

version
string
The workflow version to invoke. Defaults to the latest deployed version.

Request Body

input
object
required
id
string
Thread ID for multi-turn conversations. Pass the id from a previous task’s response to continue the same conversation.
think_mode
string
default:"default"
Controls reasoning depth: default or harder
instructions_override
string
Additional instructions for this invocation only
expected_output
string
Natural-language description of the desired output

Response

id
string
Task/thread ID — pass this back to continue the conversation
status
string
completed, failed, error, or stopped
result
string
The workflow’s final response

Example Request

curl -X POST "https://api.xpander.ai/v1/workflows/<workflow-id>/invoke" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"input": {"text": "Process this customer onboarding request"}}'

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

workflow_id
string
required

Query Parameters

version
string | null

The workflow version to invoke. default = latest

Body

application/json
input
AgentExecutionInput · object
required
id
string

Pass the id from a previous response to continue a multi-turn conversation with the same agent. Omit for a new conversation.

Example:

"02843b37-4d77-48a0-8da7-2c76afe54401"

llm_model_provider
string | null

Per-execution override of the agent's LLM provider (e.g. openai, anthropic). Must match one of GET /llm_providers. Omit to use the agent's configured provider.

llm_model_name
string | null

Per-execution override of the model name within the chosen provider. Must match a model from GET /llm_providers/{provider}/models. Examples: claude-sonnet-4-6, gpt-5, gemini-2.0-flash. Omit to use the agent's configured model.

llm_reasoning_effort
enum<string> | null

Per-execution override of reasoning effort for reasoning-capable models (e.g. GPT-5). low for simple tasks, medium for balanced performance, high for complex reasoning, xhigh for maximum reasoning depth (slower, more expensive). Omit to use the agent's configured reasoning effort.

Available options:
low,
medium,
high,
xhigh

Response

Successful Response

id
string

Unique task identifier. Use this to poll for results when invoking async.

Example:

"02843b37-4d77-48a0-8da7-2c76afe54401"

agent_id
string
Example:

"47c3b020-9a6b-4699-8d94-d92d71929b53"

organization_id
string
Example:

"91fbe9bc-35b3-41e8-b59d-922fb5a0f031"

status
enum<string>

pending | executing | completed | error

Available options:
pending,
executing,
completed,
error,
failed,
stopped
Example:

"completed"

result
string | null

The agent's response. Populated when status is 'completed'. Null for async until polling shows completed.

Example:

"Hello! 👋"

created_at
string<date-time>
Example:

"2026-04-10T19:01:22.898813Z"

finished_at
string<date-time> | null

Null until the task completes.

Example:

"2026-04-10T19:01:33.120590Z"

source
string
Example:

"api"