# Workflow

URL: https://docs.hanzo.ai/docs/openapi/workflow

> Hanzo Workflow: durable workflows that survive a crash, with every run visible and replayable.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/workflow) · [SDKs](https://docs.hanzo.ai/docs/sdks)

Hanzo Workflow: durable workflows that survive a crash, with every run visible and replayable.

> [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 5                                      |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/hanzoai/hips) declares `capability: workflow` yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.

## Four surfaces

| Surface  | Reaches this capability as              | Coverage                                  |
| -------- | --------------------------------------- | ----------------------------------------- |
| **REST** | `workflow` at its own prefix            | 5 operations                              |
| **CLI**  | `hanzo workflow …`                      | 5 of 5                                    |
| **SDK**  | `WorkflowApi` in every published client | 5 methods                                 |
| **MCP**  | —                                       | no tool names it yet — use HTTP or an SDK |

## Quickstart

```bash
export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys
```

Then the first call — a read that needs nothing but the key. `GET /v1/workflow`, operation `get_workflow`:

**CLI**

```bash
hanzo workflow get
```

**SDK**

**.ts**

```ts
import { Configuration, WorkflowApi } from 'hanzoai';

const api = new WorkflowApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getWorkflow();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WorkflowApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WorkflowApi(client).get_workflow()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WorkflowAPI.GetWorkflow(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, workflow_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = workflow_api::get_workflow(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WorkflowApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WorkflowApi(client).getWorkflow();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/workflow \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP declares no tool for **workflow** — `tools/list` on `https://api.hanzo.ai/v1/mcp` names the products it does reach. Use HTTP or an SDK.

## Endpoints

| Endpoint                                                                             | What it does                      |
| ------------------------------------------------------------------------------------ | --------------------------------- |
| [`GET /v1/workflow`](https://docs.hanzo.ai/docs/openapi/workflow/get-workflow)       | Redirect to the workflow API root |
| [`POST /v1/workflow`](https://docs.hanzo.ai/docs/openapi/workflow/post-workflow)     | Redirect to the workflow API root |
| [`PUT /v1/workflow`](https://docs.hanzo.ai/docs/openapi/workflow/put-workflow)       | Redirect to the workflow API root |
| [`PATCH /v1/workflow`](https://docs.hanzo.ai/docs/openapi/workflow/patch-workflow)   | Redirect to the workflow API root |
| [`DELETE /v1/workflow`](https://docs.hanzo.ai/docs/openapi/workflow/delete-workflow) | Redirect to the workflow API root |

---

[All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
