> Source: https://wexa.ai/docs/automation/rollback-flow-version

# rollback-flow-version

[Can be held for approval](/docs/sdks-and-apis/how-every-tool-call-works#lifecycle-and-governance)

Mark an earlier version of a process flow as the live one. Needs the `fabric:orchestrate.write` grant and an admin role.

**Roll back a process flow**

**Wexa MCP server**

```bash
curl -sS -X POST https://fabric.wexa.ai/mcp/$FABRIC_PROJECT_ID \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "Mcp-Session-Id: $MCP_SESSION_ID" \
  -H "content-type: application/json" -H "accept: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"rollback-flow-version","arguments":{"process_flow_id":"6ab1945e7566f41b5c28e308","version":1}}}'
```

```json
{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000182\",\"result\":{\"id\":\"fver_c9593de3-f85c-48bb-bf39-32c923cf467e\",\"agentflowId\":\"6ab1945e7566f41b5c28e308\",\"version\":1,\"status\":\"promoted\",\"agentCount\":0}}"
    }
  ],
  "isError": false
}
```

**REST API**

```bash
curl -sS https://fabric.wexa.ai/v1/rollback-flow-version \
  -H "authorization: Bearer $FABRIC_API_KEY" \
  -H "content-type: application/json" \
  -d '{"process_flow_id":"6ab1945e7566f41b5c28e308","version":1}'
```

```json
{
  "lifecycle_id": "qlc_000182",
  "result": {
    "id": "fver_c9593de3-f85c-48bb-bf39-32c923cf467e",
    "agentflowId": "6ab1945e7566f41b5c28e308",
    "version": 1,
    "status": "promoted",
    "agentCount": 0
  }
}
```

**TypeScript SDK**

```ts
import { Fabric } from '@wexa-fabric/sdk'

const fabric = new Fabric()
const result = await fabric.rollbackFlowVersion({
  process_flow_id: '6ab1945e7566f41b5c28e308',
  version: 1
})
```

```ts
// result is the payload itself, with no `.result` to read
{
  id: 'fver_c9593de3-f85c-48bb-bf39-32c923cf467e',
  agentflowId: '6ab1945e7566f41b5c28e308',
  version: 1,
  status: 'promoted',
  agentCount: 0
}
```

**Python SDK**

```python
from wexa import Fabric

fabric = Fabric()
out = fabric.rollback_flow_version(
    process_flow_id="6ab1945e7566f41b5c28e308",
    version=1,
)
```

```python
# out is the result, already unwrapped
{
    "id": "fver_c9593de3-f85c-48bb-bf39-32c923cf467e",
    "agentflowId": "6ab1945e7566f41b5c28e308",
    "version": 1,
    "status": "promoted",
    "agentCount": 0
}
```

## Parameters

| Parameter | Type | Required | Notes |
| --- | --- | --- | --- |
| `process_flow_id` | string | Required | Process flow id. A process flow in this project. |
| `version` | integer | Required | The version number to make live. Must be 1 or more. A version the flow has a snapshot of; one with no snapshot is not found (404). |

**Errors**

- `ValidationError`: the credential's role is not owner, organization admin or project admin; rolling back needs an admin role.

**Show full response**

A real response, captured from a live call to `rollback-flow-version`:

`snapshot` came back populated and is shown as `…` here, because the real value runs to
thousands of characters. Read it from your own call rather than from this page.

**Result of rollback-flow-version**

**REST API**

```json
{
  "lifecycle_id": "qlc_000182",
  "result": {
    "id": "fver_c9593de3-f85c-48bb-bf39-32c923cf467e",
    "agentflowId": "6ab1945e7566f41b5c28e308",
    "version": 1,
    "status": "promoted",
    "snapshot": "\u2026",
    "agentCount": 0,
    "promotedBy": "6a79a770b6c128ccc24bfca7",
    "promotedAt": "2026-09-21T20:32:39.381Z"
  }
}
```

**TypeScript SDK**

```ts
// the object you get back IS the result — there is no `.result` to read
{
  id: 'fver_c9593de3-f85c-48bb-bf39-32c923cf467e',
  agentflowId: '6ab1945e7566f41b5c28e308',
  version: 1,
  status: 'promoted',
  snapshot: '…',
  agentCount: 0,
  promotedBy: '6a79a770b6c128ccc24bfca7',
  promotedAt: '2026-09-21T20:32:39.381Z'
}

// The TS SDK names these camelCase — lifecycleId, traceId — where Python uses
// lifecycle_id and trace_id. Both are non-enumerable: readable, but omitted by
// Object.keys() and JSON.stringify(). `result.lifecycleId` here is undefined.
result.lifecycleId // 'qlc_000182'
```

**Python SDK**

```python
# a dict subclass; `result` is already unwrapped
{
 "id": "fver_c9593de3-f85c-48bb-bf39-32c923cf467e",
 "agentflowId": "6ab1945e7566f41b5c28e308",
 "version": 1,
 "status": "promoted",
 "snapshot": "\u2026",
 "agentCount": 0,
 "promotedBy": "6a79a770b6c128ccc24bfca7",
 "promotedAt": "2026-09-21T20:32:39.381Z"
}

out.lifecycle_id  # 'qlc_000182' — an attribute, not a key
```

**More details**

The displaced version becomes `rolled_back` and numbering is left alone, so rolling back to v1 while v2 was live leaves v2 in the history and the next promote is v3.

This records which snapshot is live. It does not rewrite the process flow's agents: read the snapshot from `flow-versions` (with `include_snapshot: true`) and apply it yourself if you want the structure restored.

Marked consequential: it is audited in full, and a policy rule may hold it for a person to approve. See [Policy and approvals](/docs/governance/policy-and-approvals).

Every tool call works the same way: [How every tool call works](/docs/sdks-and-apis/how-every-tool-call-works).
