Why Use the Workflows API?
The Workflows API enables templated, reproducible research designed for automation and production use cases. Unlike the conversational Research Agent, Workflows uses parameterized templates that produce consistent outputs.- Templated Research: Define prompts with Jinja2 placeholders for consistent execution
- Reproducible Results: Same template + inputs = consistent outputs
- Production Ready: Designed for batch processing and scheduled reports
- Template Management: Create, store, clone, and share research templates
- Create your API Key
- Execute a workflow with an inline template
- Execute a workflow with a stored template ID
- Process streaming responses
- Manage templates (create, list, clone)
Create your API Key
Please click here to create your API Key: Developer Platform > API KeysExecute with Inline Template
The simplest way to execute a workflow is with an inline template definition:Execute with Template ID
For production use, store templates and reference them by ID:Understanding the Streaming Response
The Workflows API streams responses using Server-Sent Events. Key message types:| Type | Description |
|---|---|
THINKING | Agent’s internal reasoning |
PLANNING | Research plan with steps and status |
ACTION | Tool calls (search queries, etc.) |
ANSWER | The actual research output |
GROUNDING | Source references with character offsets |
AUDIT | Detailed search results |
COMPLETE | Final message with resource consumption |
Processing Planning Messages
Template Management
List Your Templates
Clone a Community Template
Next Steps
The example above only handlesANSWER and COMPLETE events. The Concepts
guides explain every message type the stream can emit, how to render citations
from GROUNDING references, how to handle errors robustly, and how to continue
a workflow execution across multiple turns.
Streaming responses
Reference for every message type, including the difference between the Workflows
delta envelope and the Research Agent message envelope.Grounding and citations
Turn
GROUNDING references into inline Markdown citations.Error handling
HTTP-level errors and in-stream
ERROR / TOOL_ERROR / LLM_RETRY events.Conversation continuity
Resume a workflow execution by passing
execution_id on the next request.Creating Templates
Template anatomy, input placeholders, content filters, and research plans.
Research Plans
How
research_plan controls dynamic vs. structured execution.Community Templates
Discover and customize shared templates.
Example Templates
Ready-to-use financial analysis templates.