# Pause workflow

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Pauses a workflow and its currently pausable executions.

```text
POST https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/{workflow_id}/pause
```

## Before you call

Use [Get workflow details](get-workflow.md#path-parameters) to confirm the workflow. Prepare a [personal access token](../../../../../guides/genesis/api-keys.md#create-and-manage-personal-access-tokens) with workflow manage permission and the [target workspace ID](../../../../../guides/ai-studio/resource-center/workspace.md#copy-the-workspace-id).

## Path parameters

Replace `$AI_STUDIO_API_KEY`, `$WORKSPACE_ID`, and `$WORKFLOW_ID` with your own values.

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Call example

```bash
curl -X POST "https://moi.matrixorigin.cn/newmoi/workflow/v2/workflow-apps/$WORKFLOW_ID/pause" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"
```

:::::
:::::{tab-item} Parameter reference

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `workflow_id` | string | Yes | Workflow ID to pause. |

:::::
::::::
:::::::

## Successful response

Returns 200 with the paused workflow detail. Other workflow detail fields follow [Get workflow details](get-workflow.md#successful-response).

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{"code": "OK", "msg": "OK", "data": {"workflow": {"id": "wf-001", "name": "daily-import", "status": "paused", "available_actions": ["resume", "update", "delete"], "execution_summary": {"total_executions": 8, "active_executions": 0}}}}
```

:::::
:::::{tab-item} Field reference

The following fields are in `data.workflow`.

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | `OK` on success. |
| `msg` | string | `OK` on success. |
| `data.workflow` | object | Paused workflow detail. |
| `id` | string | Workflow ID. |
| `name` | string | Workflow name. |
| `status` | string | Status after pausing. |
| `available_actions` | string[] | Actions allowed in the current state. |
| `execution_summary` | object | Execution summary. |
| `execution_summary.total_executions` | integer | Total executions. |
| `execution_summary.active_executions` | integer | Active executions. |

:::::
::::::
:::::::

## Error response

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Response example

```json
{"code": "ErrConflict", "msg": "Resource state conflict", "data": null}
```

:::::
:::::{tab-item} Field reference

| Field | Type | Description |
| --- | --- | --- |
| `code` | string | Error code. |
| `msg` | string | Error message. |
| `data` | null | Empty on error. |

:::::
::::::
:::::::

## Next steps

Keep `data.workflow.id`. Use [Resume workflow](resume-workflow.md#path-parameters) to continue it, or [Get workflow details](get-workflow.md#path-parameters) to check its status.
