Search docs

Search docs, endpoints, errors

Workflows, agents & steps

Every Apodex response is built from three nested objects. One API request is one workflow, which runs one or more agents, each of which executes steps.

workflowOne API requestholds input, state and outputstatus: in_progress
agentresearcherowns one responsibility1…n per workflow
steptool_callruns a web searchcompleted
stepmessagestreams tokens via deltain_progress

Nesting is literal: a step never exists outside an agent, and an agent never outside a workflow.

Workflow

the top-level execution container

A Workflow is the highest-level execution unit in the platform. It represents a complete AI task request from the user, containing all input, output, and execution state. Each Workflow corresponds to one API request and manages the entire lifecycle of an AI task.

PropertyDescription
workflow_idUnique identifier for tracking and managing the workflow
statusExecution state — queued, in_progress, completed, failed, cancelled.
inputInput messages provided by the user (array of message objects)
agentsList of Agents executed within this workflow

Agent

autonomous task executor

An Agent is an autonomous AI entity within a Workflow that executes specific tasks. Each Agent has a unique name and role (e.g., 'researcher', 'writer', 'reviewer'). Agents can collaborate and communicate with each other to complete complex multi-step tasks.

PropertyDescription
agent_idUnique identifier for the agent
nameAgent name, e.g. main, researcher, analyzer.
statusExecution state — started, completed, failed.
stepsList of Steps executed by this agent

Step

the smallest unit of execution

A Step is the smallest unit of execution within an Agent. Each Step represents a specific action, such as generating a text message or calling an external tool. Steps are executed sequentially and can be streamed in real-time to provide incremental updates.

PropertyDescription
step_idUnique identifier for the step
typeStep type — message or tool_call.
statusExecution state — created, in_progress, completed, failed.
deltaIncremental updates (e.g., new tokens for message steps)

Step types

TypeDescription
messageGenerates text content with a model, streamed token by token.
tool_callCalls an external tool or API — web search, calculator, database query.

Execution flow

  1. 01A request arrives and becomes one workflow, carrying the user's input.
  2. 02The workflow starts and creates a researcher agent.
  3. 03The agent runs a tool_call step — a web search.
  4. 04The agent runs a message step, streaming the summary token by token.
  5. 05The agent completes and the workflow returns its final output.
Next
Learn how to authenticate with API KeysExplore Chat Completions API endpoints and usageUnderstand real-time streaming events for Steps and Agents
Docs | Apodex API Platform