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

# Workflow API

> AI automation workflow endpoints

# Workflow API

## Overview

The workflow API manages AI-powered automation across verticals.

### GET /api/workflows

List available workflows for the current center.

**Response:**

```json theme={null}
{
  "success": true,
  "data": [
    {
      "id": "wf_001",
      "name": "Weekly Progress Report",
      "type": "SCHEDULED",
      "status": "ACTIVE",
      "vertical": "rehabilitation",
      "lastRun": "2026-03-07T09:00:00Z"
    }
  ]
}
```

***

### POST /api/workflows/:workflowId/execute

Manually trigger a workflow execution.

**Request:**

```json theme={null}
{
  "parameters": {
    "dateRange": "2026-03-01/2026-03-07",
    "includeInactive": false
  }
}
```

**Response:**

```json theme={null}
{
  "success": true,
  "data": {
    "executionId": "exec_123",
    "status": "RUNNING",
    "startedAt": "2026-03-08T09:30:00Z"
  }
}
```

<Info>
  All workflow executions are recorded in the DPU audit trail. AI-generated outputs are marked as `DRAFT` evidence level until human review.
</Info>

***

### GET /api/workflows/:workflowId/executions

List past executions of a specific workflow.

**Response:**

```json theme={null}
{
  "success": true,
  "data": [
    {
      "executionId": "exec_123",
      "status": "COMPLETED",
      "startedAt": "2026-03-08T09:30:00Z",
      "completedAt": "2026-03-08T09:31:15Z",
      "dpuId": "dpu_789",
      "evidenceLevel": "DRAFT"
    }
  ]
}
```

<Warning>
  The following Workflow API endpoints are planned but not yet available:

  * `POST /api/workflows` — Create custom workflow
  * `PATCH /api/workflows/:workflowId` — Update workflow configuration
  * `DELETE /api/workflows/:workflowId` — Deactivate workflow
</Warning>
