> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bigdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflows API

> Build reproducible, templated research workflows for automated analysis

The **Workflows API** enables templated, reproducible research designed for automation. Unlike the conversational Research Agent, Workflows uses parameterized templates that produce consistent outputs across executions.

## Workflows vs Research Agent

| Feature               | Research Agent                  | Workflows API                     |
| --------------------- | ------------------------------- | --------------------------------- |
| **Interaction style** | Ad-hoc natural language queries | Templated, reproducible research  |
| **Execution**         | Single execution                | Reusable templates                |
| **State management**  | Conversational (chatId)         | Parameterized (template + inputs) |
| **Best for**          | Exploration and discovery       | Automation and production         |
| **Research plan**     | Dynamic, agent-determined       | Optional predefined steps         |

## Core Concepts

### Templates

Templates are reusable research specifications that define:

* **Prompt**: The research question with Jinja2 placeholders (e.g., `{{ company_id }}`)
* **Expected inputs**: Typed parameters the template requires
* **Content filters**: Optional restrictions on which sources to search
* **Research plan**: Optional predefined steps for structured execution

### Research Plan Behavior

The Workflows API behavior is controlled by the presence of a `research_plan`:

* **Without a plan**: The agent dynamically determines research steps based on your prompt.
* **With a plan**: The agent follows your predefined steps for structured, predictable output.

### Input Types

Templates support two input types:

* `rp_entity_id`: A Bigdata entity ID (e.g., company identifier like `D8442A`)
* `string`: Free-form text input

## Quick Links

<CardGroup cols={2}>
  <Card title="Quickstart Guide" icon="rocket" href="/getting-started/quickstart_guide_workflows">
    Get started with your first workflow execution
  </Card>

  <Card title="Creating Templates" icon="file-code" href="/how-to-guides/workflows/creating_templates">
    Learn how to build effective templates
  </Card>

  <Card title="Research Plans" icon="play" href="/how-to-guides/workflows/execution_modes">
    Learn how research plans affect execution
  </Card>

  <Card title="Community Templates" icon="users" href="/how-to-guides/workflows/community_templates">
    Discover and clone shared templates
  </Card>
</CardGroup>

## API Endpoints

The Workflows API provides the following endpoints:

| Endpoint                            | Method | Description                                       |
| ----------------------------------- | ------ | ------------------------------------------------- |
| `/v1/workflow/execute`              | POST   | Execute a workflow with inline or stored template |
| `/v1/workflow/templates`            | GET    | List your templates                               |
| `/v1/workflow/templates`            | POST   | Create a new template                             |
| `/v1/workflow/templates/{id}`       | GET    | Get a specific template                           |
| `/v1/workflow/templates/{id}`       | PUT    | Update a template                                 |
| `/v1/workflow/templates/{id}`       | DELETE | Delete a template                                 |
| `/v1/workflow/templates/community`  | GET    | Browse community templates                        |
| `/v1/workflow/templates/{id}/clone` | POST   | Clone a template to your account                  |

## Available Models

Select the model that best fits your use case:

| Model  | Description                         |
| ------ | ----------------------------------- |
| `base` | Default model, balanced performance |
| `pro`  | Enhanced reasoning capabilities     |

## Time Range Options

Control the time range of research data:

**Rolling time ranges:**

* `last_24_hours`
* `last_7_days`
* `last_30_days`
* `last_60_days`
* `last_90_days`
* `last_180_days`
* `last_365_days`

**Custom date range:**

```json theme={null}
{
  "start": "2024-01-01T00:00:00Z",
  "end": "2024-12-31T23:59:59Z"
}
```

## Streaming Response

The Workflows API returns responses via Server-Sent Events (SSE). Each event contains a `delta` with one of these message types:

| Type        | Description                                  |
| ----------- | -------------------------------------------- |
| `THINKING`  | Agent's reasoning process                    |
| `PLANNING`  | Research plan with steps                     |
| `ACTION`    | Tool being called                            |
| `ANSWER`    | Final response content                       |
| `GROUNDING` | Source references                            |
| `AUDIT`     | Search results and traces                    |
| `COMPLETE`  | Execution finished with resource consumption |
| `ERROR`     | Error occurred                               |
