Defining agents
Agents are workflow AgentDefinition objects. Workflow steps reference them by UUID via agent_id. Each agent carries instructions, optional tools, memory, context policy, tool execution settings, and provider configuration. Surfaces (Python, TypeScript, server) serialize the same JSON shape to arcflow-core.
Start with First workflow in five minutes for a minimal two-agent linear run. Type definitions: Workflow specification.
AgentDefinition fields
| Field | Purpose |
|---|---|
id | UUID; must match step agent_id |
name, role | Trace labels and prompt framing |
instructions | System or task prompt |
tools | Optional ToolDefinition[] with JSON Schema inputs |
memory_config | Session, shared, persistent, or vector backend |
context | ContextPolicy for prior steps and run input |
tool_execution | llm_select (default) or legacy_eager; max iterations |
provider | ProviderConfig: provider_id, model, api_key_env |
Full example with tool and vector memory
Memory details: Memory types. Context: Context policies. Tools: Tool execution loop.
ToolDefinition
Runtime validates tool call arguments against input_schema. Violations emit ToolInputValidationFailed and map to ToolExecutionFailed on terminal failure.
ProviderConfig
Never embed API keys in agent JSON. Use api_key_env to name an environment variable:
Supported providers: Provider configuration.
Python SDK
See Python quickstart for provider wiring with real keys.
TypeScript SDK
Server run envelope
Agents travel in the agents array on POST /v1/runs:
Registry publish may bundle agents with the workflow definition; see Workflow registry.
Error codes relevant to agents
| ErrorCode | Typical cause |
|---|---|
ProviderError | LLM API failure |
ToolExecutionFailed | Tool handler error |
ToolInputValidationFailed | Schema violation (trace event) |
EmbeddingError | Vector embed failure |
RerankError | Rerank provider failure |
MemoryError | Backend unavailable |
Full list: Error codes.