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

# Workflows API

> Manage workflows and run executions over HTTP.

Workflow endpoints live under the `/workflow` prefix. Use them to manage workflow definitions, run executions synchronously or asynchronously, and receive trigger callbacks. Pass your credential in the `Authorization` header; user PATs (`pat_`) also need `X-Anyreach-Org`. See [Authentication](/api-reference/authentication).

<Note>
  Every path is prefixed with `/workflow`. The product pages on [executions](/workflows/execution/sync-vs-async) and [public execution](/workflows/execution/public-execution) reference these same endpoints.
</Note>

## Workflows

| Method   | Path                       | Description       |
| -------- | -------------------------- | ----------------- |
| `GET`    | `/workflow/workflows`      | List workflows    |
| `POST`   | `/workflow/workflows`      | Create a workflow |
| `GET`    | `/workflow/workflows/{id}` | Get one workflow  |
| `PUT`    | `/workflow/workflows/{id}` | Update a workflow |
| `DELETE` | `/workflow/workflows/{id}` | Delete a workflow |

## Executions

| Method | Path                                  | Description                                               |
| ------ | ------------------------------------- | --------------------------------------------------------- |
| `GET`  | `/workflow/workflow-executions`       | List executions (filter by `workflow_id`)                 |
| `GET`  | `/workflow/workflow-executions/{id}`  | Get one execution, including each step's input and output |
| `POST` | `/workflow/workflow-executions`       | Run a workflow synchronously and return the result        |
| `POST` | `/workflow/workflow-executions/async` | Start an execution and return immediately                 |

## Authoring helpers

| Method | Path                           | Description                                        |
| ------ | ------------------------------ | -------------------------------------------------- |
| `POST` | `/workflow/code-steps/preview` | Run a Code step in a sandbox to preview its output |

## Public execution

A workflow marked **public** can be invoked without authentication — for browser embeds and external webhooks.

| Method | Path                                                         | Description                                                      |
| ------ | ------------------------------------------------------------ | ---------------------------------------------------------------- |
| `POST` | `/workflow/public/workflows/{workflow_id}/{version}/execute` | Execute a published, public workflow. No `Authorization` header. |

See [Public execution](/workflows/execution/public-execution) for the security implications.

## Trigger webhooks

External systems start workflows through trigger webhooks. You configure these from the builder rather than calling them directly.

| Method | Path                                                 | Description                     |
| ------ | ---------------------------------------------------- | ------------------------------- |
| `POST` | `/workflow/webhooks/anyreach/triggers/{trigger_id}`  | Fire an Anyreach-native trigger |
| `POST` | `/workflow/webhooks/pipedream/triggers/{trigger_id}` | Fire a Pipedream-backed trigger |

## Action and trigger registry

The Anyreach registry powers the **Action** step's app catalog and trigger configuration.

| Method | Path                                        | Description                                         |
| ------ | ------------------------------------------- | --------------------------------------------------- |
| `GET`  | `/workflow/anyreach/actions/entities`       | List available action entities                      |
| `GET`  | `/workflow/anyreach/actions/{action_key}`   | Get one action's definition                         |
| `POST` | `/workflow/anyreach/actions/remote-options` | Resolve dynamic option lists for an action's fields |
| `POST` | `/workflow/anyreach/actions/test`           | Test-run an action with sample input                |

## Example: run a workflow synchronously

```bash theme={null}
curl -X POST https://api.anyreach.ai/workflow/workflow-executions \
  -H "Authorization: Bearer $ANYREACH_TOKEN" \
  -H "X-Anyreach-Org: $ANYREACH_ORG_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "workflow_id": "wf_...",
    "input_data": { "name": "Alice", "email": "alice@example.com" }
  }'
```

## Related

<CardGroup cols={2}>
  <Card title="Workflows" icon="diagram-project" href="/workflows/overview">
    Build workflows in the visual editor.
  </Card>

  <Card title="Sync vs async execution" icon="bolt" href="/workflows/execution/sync-vs-async">
    When to run synchronously or in the background.
  </Card>
</CardGroup>
