---
title: "Stop a workflow"
method: POST
path: "/workflow/runs/{workflow-id}/stop"
tags: ["Workflow"]
---

# Stop a workflow

`POST /workflow/runs/{workflow-id}/stop`

## Request

- Base URL: `https://app.amperity.com/api`
- URL: `https://app.amperity.com/api/workflow/runs/{workflow-id}/stop`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/amperity/apis/amperity-api/docs/workflow/runs/:workflow-id/stop/post.ts> (a function with typed inputs; its response is checked against the schema)

Stop a running workflow.

## Path parameters

- `workflow-id` string, required

## Query parameters

- `api_version` string

## Headers

- `Amperity-Tenant` string, required
- `Api-Version` string, required

## Response `200`

Workflow stopped

- Workflow: Representation of a workflow
  - `created_at` string, date-time, required: Time the workflow was created
  - `current_version` string: The current ent version associated with the workflow
  - `ended_at` string, date-time: Time the workflow reached a terminal state
  - `error` WorkflowError: An error on the workflow. Populated only for error states.
    - `attribution` string: The underlying cause of the error, either customer or platform.
    - `data` WorkflowErrorData: Any additional data associated with this error.
    - `message` string, required: The error message.
    - `type` string, required: The type of workflow error.
  - `id` string, required: Unique identifier for the workflow
  - `launched_version` string: The ent version that was launched with the workflow
  - `name` string: Human-readable identifier for the workflow
  - `principal_email` string: Email address for who or what created the workflow
  - `principal_id` string: Principal id for who or what created the workflow
  - `principal_name` string: Human-readable name for who or what created the workflow
  - `state` string, required: Current workflow state.
  - `task_instances` Task[]: The list of tasks on the workflow.
    - `created_at` string, date-time, required: Time the task instance was created
    - `ended_at` string, date-time: Time the task reached a terminal state
    - `error` WorkflowError: An error on the workflow. Populated only for error states.
      - `attribution` string: The underlying cause of the error, either customer or platform.
      - `data` WorkflowErrorData: Any additional data associated with this error.
      - `message` string, required: The error message.
      - `type` string, required: The type of workflow error.
    - `execution_type` string: The execution type for the workflow
    - `id` string, required: Unique identifier for the task instance
    - `label` string, required: Human-readable label for a task-instance
    - `run_id` string: Unique identifier for the task instance to support execution engines that can't provide an external run id
    - `state` string, required: Current task instance state.
    - `state_changed_at` string, date-time: Time the task instance most recently changed state
    - `task_definition_id` string, required: Identifier for a task definition
    - `task_definition_type` string, required: A keyword for identify different task types
    - `tenant` string, required: The unique identifier for the tenant.
    - `timeout_ms` number, double: The length of time in milliseconds after which to forcibly kill a running task instance
    - `workflow_id` string, required: Unique identifier for the workflow
  - `tenant` string, required: The unique identifier for the tenant.
  - `type` string, required: Keyword identifying the type of workflow
  - `warn_after_ms` number, double: The time in milliseconds we should send a running long duration warning

## Other responses

- `400`: Bad Request
- `401`: Authentication Required
- `403`: Not Authorized
- `404`: Not Found
- `405`: Method Not Allowed
- `500`: Internal Error
- `503`: Service Unavailable

---

[API](https://skmtc.dev/amperity/apis/amperity-api.md) - [All operations](https://skmtc.dev/amperity/apis/amperity-api/llms.txt) - [OpenAPI document](https://skmtc.dev/amperity/apis/amperity-api/revisions/97ccd051d9dc?raw)
