> ## 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

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

## Use case

Create, version, and manage reusable enrichment pipelines programmatically. Use these endpoints to list existing workflows, inspect block definitions, create new pipelines from code, update configurations, or remove workflows you no longer need.

<Card title="API Reference" icon="code" href="/api-reference/workflow/list-workflows">
  See the full request/response schema and parameters in the API Reference.
</Card>

## Pricing

See [Credits & Pricing Guide](/guides/credits-and-pricing) for credit costs.

## Errors

For error responses (400, 403, 404, etc.), see [Handling Errors](/api-reference/errors).

<Note>For a full reference of available block types and their use cases, see [Workflow Blocks](/api-reference/workflows/workflow-blocks).</Note>

## Workflow definition

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

* **`blocks`** — each block has a `sequence_number`, `block_type` (see [Workflow Blocks](/api-reference/workflows/workflow-blocks)), `block_name`, optional `block_id`, and a `specs` object.
* **`edges`** — each edge has a `from_block_id`, a `to_block_id`, and an optional `condition`.

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

***

## List workflows

Retrieve all workflows in your organization.

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

Returns a lightweight list of workflows without block definitions.

<Note>Use `GET /workflows/{workflow_id}` to retrieve a workflow with its full block graph.</Note>

***

## Get workflow

Retrieve a specific workflow including its complete block graph.

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

***

## 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": [
      {
        "sequence_number": 1,
        "block_type": "io",
        "block_name": "webhook",
        "block_id": "input",
        "specs": {
          "dataframe_type": "LEAD",
          "input_schema": { "email": { "type": "string" } }
        }
      },
      {
        "sequence_number": 2,
        "block_type": "enrichment",
        "block_name": "verify_email",
        "block_id": "validate",
        "specs": {
          "email_column": "email"
        }
      }
    ],
    "edges": [
      {
        "from_block_id": "input",
        "to_block_id": "validate"
      }
    ]
  }
}
```

Definitions are validated before saving. For requests authenticated with an API key, an invalid definition is rejected with `400` and nothing is stored. See [Validation errors](#validation-errors) for the response and for the checks that only happen when a run starts.

***

## 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. All body fields (`workflow_name`, `workflow_description`, `workflow_definition`) are optional — only include what you want to change. The `workflow_definition` shape is the same as Create Workflow above.

<Note>Performs upsert: creates the workflow if it doesn't exist. For API-key requests an invalid definition is rejected with `400` and the last valid saved definition is left unchanged — see [Validation errors](#validation-errors).</Note>

***

## Validation errors

`create_workflow` and `update_workflow` run the full workflow validator before saving: schema and edge checks, block type compatibility, required block fields, and every column a block references against the columns its upstream blocks produce. For API-key requests, any failed check returns `400` with one entry per problem:

```json theme={null}
{
  "detail": {
    "message": "Workflow validation failed",
    "validation_errors": [
      {
        "field": "blocks[1].specs.email_column",
        "code": "COLUMN_NOT_FOUND",
        "message": "Email column \"work_email\" not found in upstream data",
        "blocking": true,
        "context": {
          "block_id": "verify",
          "block_name": "verify_email",
          "missing_columns": ["work_email"],
          "available_columns": ["name", "email", "company"],
          "suggestion": "Did you mean \"email\"? Available columns: name, email, company",
          "suggested_replacement": { "email_column": "email" },
          "summary": "Column \"work_email\" not found in the data from the previous block. Did you mean \"email\"?"
        }
      }
    ]
  }
}
```

| Field | Meaning |
| - | - |
| `field` | Path to the offending value in your definition, e.g. `blocks[1].specs.email_column`. Block indexes follow the order of `blocks` in your request. |
| `code` | Stable identifier for the rule, e.g. `COLUMN_NOT_FOUND`, `MISSING_REQUIRED_FIELD`, `INVALID_FIELD_NAME`, `INVALID_SPECS`, `TYPE_INCOMPATIBLE`, `MULTIPLE_SOURCE_BLOCKS`. |
| `message` | Precise description of the problem. |
| `blocking` | Always `true` on a `400`; findings the executor can tolerate at runtime are returned as `warnings` on successful saves instead. |
| `context.block_id` / `context.block_name` | The block the finding belongs to, using the `block_id` you supplied. Absent for graph-level findings such as disconnected blocks. |
| `context.missing_columns` / `context.available_columns` | For column findings: what you referenced and what actually exists at that point in the graph. `available_columns` lists at most 50 names; `available_column_count` carries the total when truncated. |
| `context.suggestion` | Optional human-readable remediation hint, such as the closest matching column and the columns available. Not machine-applicable. |
| `context.suggested_replacement` | Optional. When one available column is a close match, a spec fragment you can merge into that block's `specs` verbatim to fix the finding. |
| `context.summary` | A one-line, plain-language version of the finding. |

Fix the listed fields and resubmit the same request. Invalid field names (declared output fields must be letters, digits and underscores, starting with a letter) and blocks whose specs fail to parse are rejected the same way.

A saved definition has passed these checks, but some conditions can only be judged when a run starts: a source block whose data has not been materialized yet (`MISSING_DATA_SOURCE`) does not block the save, 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.

<Note>Permanently removes the workflow definition. Historical workflow runs are preserved.</Note>


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