Skip to content

AI Workflow Execution

AI Workflow execution APIs run a published or testable workflow graph with explicit payload and context data, then return the execution state created by the runtime.

TermDefinition
Workflow IDIdentifier of the AI Workflow or workflow version to execute, depending on the integration contract.
Execution IDIdentifier returned by a started execution and used when resuming a paused or waiting flow.
PayloadThe event data that enters the workflow.
ContextRuntime metadata such as channel, user, interaction, tenant, or space values.
Resume eventData supplied when a waiting execution should continue.
ActionEndpoint
Execute a workflowPOST /llm-chain/aiworkflow/:id/execute
Resume an executionPOST /llm-chain/aiworkflow/execution/:executionId/resume
Load the sample graphGET /llm-chain/graph/sample

Use this route from trusted server-side code when an external system needs to start a Octo workflow.

Terminal window
curl -X POST "$OCTO_BASE_URL/llm-chain/aiworkflow/workflow_123/execute" \
-H "Authorization: Bearer $OCTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"payload": { "message": "I need help with my order" },
"context": { "channel": "web", "spaceId": "space_123" }
}'

The request body is organized around payload and context objects. Keep customer-provided content in payload; keep operational metadata in context so the runtime can route logs, interactions, and tool calls consistently.

A workflow can pause at a wait node, human handoff, external callback, or another runtime state that needs a later event. Resume it with the execution ID returned by the original execution.

Terminal window
curl -X POST "$OCTO_BASE_URL/llm-chain/aiworkflow/execution/execution_123/resume" \
-H "Authorization: Bearer $OCTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": { "message": "Here is the confirmation code" }
}'
  1. The controller starts a transaction for execution changes.
  2. The runtime loads the graph, nodes, edges, and workflow configuration.
  3. Nodes execute in graph order until an end node, wait state, transfer, or failure is reached.
  4. Execution state and logs are returned to the caller and surfaced in product debugging views when linked to an interaction.
SituationWhat to check
Workflow not foundConfirm the workflow ID, active space, and access permissions.
No published versionPublish the workflow before routing production entry points or external integrations to it.
Execution waitingResume with the execution ID and the next event payload.
Tool failureTest the tool directly from Developer > Tools or the Tools UI.
Runtime exceptionInspect the interaction execution path and workflow version configuration.

Should I call the workflow or the entry point? Use an entry point for normal channel traffic. Use this API when a trusted integration needs direct execution behavior.

Can I resume any execution? Only resume executions that are in a waiting or resumable state and that belong to the same tenant and space context as your integration.

  • Runtime Guide - graph structure, node execution, wait, and resume behavior
  • Interactions - create and finalize conversation records around executions
  • AI Workflows - build and publish workflow versions