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

# Workflow Management (Legacy)

> List, create, update, and delete workflows via the Workflows API.

> [!NOTE]
>
> This page documents the original routes, which keep working. For new integrations, use the `/v1` routes in [Workflows Management](https://docs.sixtyfour.ai/api-reference/workflows/workflows-management.md). [Legacy](https://docs.sixtyfour.ai/api-reference/legacy.md) maps each original route to its `/v1` replacement.

> [card] [API Reference](https://docs.sixtyfour.ai/api-reference/workflow/list-workflows.md)
>
> See the full request/response schema and parameters in the API Reference.

## Workflow definition

A workflow definition is a directed graph of `blocks` connected by `edges`:

* `blocks`: each block has a `block_name` (see [Workflow Blocks](https://docs.sixtyfour.ai/api-reference/workflows/workflow-blocks.md)), an optional `block_id`, and a `specs` object.
* `edges`: each edge has a `from_block_id` and a `to_block_id`.

This shape is used in both Create Workflow and Update Workflow requests.

A `block_id` that is missing or is not a UUID is replaced with a new UUID on every save, and the edges are rewritten to match.

### Limits

| Value | Limit |
| - | - |
| `workflow_name` | 200 characters |
| `workflow_description` | 2,000 characters |
| Blocks | 100 per workflow |
| Whole definition | 1 MiB of compact JSON, not counting a `search` block's `exclude_public_ids` |
| `block_id`, `from_block_id`, `to_block_id` | 200 characters |
| `exclude_public_ids` in a `search` block | 50,000 IDs, each up to 200 characters. Deprecated. |
| Any other string or map key in the definition | 100,000 characters |
| Nesting depth | 64 levels |

A save over a limit stores nothing. For the error responses, see [Handling Errors](https://docs.sixtyfour.ai/api-reference/legacy/errors.md).

***

## List workflows

Retrieve the workflows in your organization.

```http theme={null}
GET https://api.sixtyfour.ai/workflows
```

Returns the workflows without their block definitions.

***

## Get workflow

Retrieve a specific workflow including its complete block graph.

```http theme={null}
GET https://api.sixtyfour.ai/workflows/{workflow_id}
```

| Name | Required | Description |
| - | - | - |
| prefer\_draft | No | Default `true`: returns the saved draft, including edits that failed validation, when one exists. `false` returns the definition runs use. |

Runs use the last valid saved definition; a draft that failed validation never runs. Any valid update takes effect from the next run. The workflow's `status` and `updated_at` change as runs progress, so track each run with its [live status](https://docs.sixtyfour.ai/api-reference/legacy/workflows-execution.md#get-live-status). `edit_revision` changes only when the name, description, or graph changes, including edits made in the web app.

***

## Create workflow

Create a new workflow with a block graph definition.

```http theme={null}
POST https://api.sixtyfour.ai/workflows/create_workflow
```

Required body fields: `workflow_name`, `workflow_description`, and `workflow_definition`. Pass an optional `id` containing a valid UUID to use a custom workflow ID; otherwise one is auto-generated.

### Example request

```json theme={null}
{
  "workflow_name": "Contact Validation",
  "workflow_description": "Verifies contact email addresses",
  "workflow_definition": {
    "blocks": [
      {
        "block_name": "webhook",
        "block_id": "6f1c2a4e-1b7d-4c55-9a43-0d1e5f6a7b01",
        "specs": {
          "dataframe_type": "LEAD",
          "input_schema": { "email": { "type": "string" } }
        }
      },
      {
        "block_name": "verify_email",
        "block_id": "6f1c2a4e-1b7d-4c55-9a43-0d1e5f6a7b02",
        "specs": {
          "email_column": "email"
        }
      }
    ],
    "edges": [
      {
        "from_block_id": "6f1c2a4e-1b7d-4c55-9a43-0d1e5f6a7b01",
        "to_block_id": "6f1c2a4e-1b7d-4c55-9a43-0d1e5f6a7b02"
      }
    ]
  }
}
```

Definitions are validated before saving. With an API key, an invalid definition is rejected and nothing is stored; see [Validation errors](#validation-errors). With an OAuth access token, it is saved as a draft, which never runs.

The response is the saved workflow. Its `status` is `created`, or `draft` when an OAuth request saved a draft.

***

## Update workflow

Update an existing workflow's name, description, or block definition.

```http theme={null}
POST https://api.sixtyfour.ai/workflows/update_workflow
```

Pass `workflow_id` as a query parameter. Include only the fields to change. Content updates to an existing workflow require `expected_revision`, copied from the latest `GET /workflows/{workflow_id}` response. Lock updates do not require it.

| Field | Description |
| - | - |
| `expected_revision` | `edit_revision` from the latest workflow read. Required when changing name, description, or graph. |
| `workflow_name` | New name. |
| `workflow_description` | New description. |
| `workflow_definition` | New block graph, in the same shape as Create Workflow. |
| `locked` | `true` locks the graph: a request that changes `workflow_definition` is refused until it is unlocked. Name and description can still change. |

> [!NOTE]
>
> If the workflow does not exist and no `expected_revision` is sent, the request creates it, and `workflow_definition` is required. An invalid definition is handled as in [Create workflow](#create-workflow), and the last valid saved definition is kept.

***

## Validation errors

Definitions are validated before saving. For the checks and the `validation_errors` response, see [Handling Errors](https://docs.sixtyfour.ai/api-reference/legacy/errors.md#400-bad-request).

One check runs only when a run starts: a source block with no data yet, such as a search that has not run or a file that was never uploaded (`MISSING_DATA_SOURCE`), saves but rejects the run with the same `validation_errors` shape.

***

## Delete workflow

Permanently delete a workflow.

```http theme={null}
POST https://api.sixtyfour.ai/workflows/delete_workflow
```

Pass `workflow_id` as a query parameter. The response is the deleted workflow. Locked workflows are deleted too.

> [!WARNING]
>
> Deleting a workflow also deletes its [schedules](https://docs.sixtyfour.ai/api-reference/legacy/workflow-schedules.md) and its run history. Its runs, their live status, and their results can no longer be read. [Download the results](https://docs.sixtyfour.ai/api-reference/legacy/workflows-execution.md#download-results) you need before deleting.

Use a new ID for a new workflow.

***

## Templates

Templates are ready-made workflow definitions from the Sixtyfour catalog. Each template carries its full `blocks` and `edges`, so you can pass them to Create Workflow as your `workflow_definition`.

| Endpoint | Auth | Returns |
| - | - | - |
| `GET /templates` | None | The catalog, newest first |
| `GET /templates/available` | API key | The catalog plus your organization's own templates |
| `GET /templates/{template_key}` | None | One catalog template, by `slug` or `id` |

Template endpoints are rate limited; see [Rate limits](https://docs.sixtyfour.ai/api-reference/rate-limits.md#workflows). Both list endpoints accept these optional query parameters:

| Query parameter | Description |
| - | - |
| `category` | Exact category match, such as `Intelligence`. |
| `featured` | `true` to return only featured templates. |
| `tags` | Repeatable. Returns templates with any of these tags. |
| `q` | Free-text search. |

Each template includes `key`, `scope` (`global` for the catalog, `org` for your organization's templates), `id`, `slug`, `name`, `description`, `category`, `tags`, `featured`, `difficulty`, `estimated_time`, `use_case`, `preview_blocks`, `blocks`, `edges`, `author_name`, `created_at`, and `updated_at`.

```bash theme={null}
curl "https://api.sixtyfour.ai/templates?featured=true"
```

## Pricing

See [Credit Costs](https://docs.sixtyfour.ai/guides/credits-and-pricing.md) for more information.

## Related

* [Batch Processing](https://docs.sixtyfour.ai/guides/batch-processing.md)
* [Async Jobs](https://docs.sixtyfour.ai/api-reference/async-jobs.md)
* [Handling Errors](https://docs.sixtyfour.ai/api-reference/legacy/errors.md)
* [Credit Costs](https://docs.sixtyfour.ai/guides/credits-and-pricing.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.