---
title: "Stop a durable execution from an application"
method: POST
path: "/durable-functions/{functionId}/executions/{executionId}/stop"
tags: ["Durable Functions"]
---

# Stop a durable execution from an application

`POST /durable-functions/{functionId}/executions/{executionId}/stop`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/durable-functions/{functionId}/executions/{executionId}/stop`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Cancels a running execution with the credential that started it. Its
completed steps are not undone.

Access follows the same rules as reading the execution.

The call is accepted rather than awaited: the response reports the
execution as it was read back and may still say `running`. Poll
`GET /durable-functions/{functionId}/executions/{executionId}` to see
it settle into `stopped`.

Stopping an execution that already finished is not an error: the
response carries the state it settled in.

## Path parameters

- `functionId` string, required
- `executionId` string, uuid, required

## Headers

- `X-Volcano-Client-Token` string

## Response `200`

Stop accepted. The body is the execution as it was read back, which
may still report `running`.

- DurableExecution
  - `id` string, uuid, required
  - `function_id` string, uuid, required
  - `name` string, required: Idempotency key for the execution. Supplied by the client through `X-Volcano-Execution-Name`, otherwise generated.
  - `status` 'pending' | 'running' | 'succeeded' | 'failed' | 'timed_out' | 'stopped' | 'unknown', required: Lifecycle state of an execution. `pending` covers the window between the platform reserving the execution name and the function accepting the start, and has no counterpart once the execution is under way. `succeeded`, `failed`, `timed_out`, `stopped` and `unknown` are terminal. `unknown` means the execution's outcome cannot be established, so no result or error can be given for it. Either it was under way and was never seen to finish, or its start failed with a `500` without the platform establishing whether the execution began — which is why a name whose start returned an error can later read as `unknown` rather than not being found. It is terminal because nothing can settle it later, and it is rare — treat it as an outcome to retry rather than a state to wait on. A retry under the same name picks this execution back up instead of starting a second one, and needs a free concurrency slot because an `unknown` execution has given its own up. `completed_at` on an `unknown` execution is when the platform gave up, not when the work ended.
  - `region` string, required: Region the execution runs in. An execution is pinned to one region for its whole life because its checkpoints live there.
  - `result` unknown
  - `result_expired` boolean: `true` when the execution is terminal but its result is no longer retained, which distinguishes a discarded result from an empty one. Shortly after that the execution itself is dropped and reads answer `404`. A result that was checkpointed rather than returned leaves this unset, so it reads like a function that returned nothing.
  - `error` DurableExecutionError: Why a failed or timed-out execution ended.
    - `type` string
    - `message` string
  - `created_at` string, date-time, required
  - `completed_at` string, date-time: Present once the execution has reached a terminal status.
  - `client_token` string: Lets a browser read the execution, stop it, and read and send its messages, and a service key scoped to a list without `*` read and stop it. Returned only by the start whose input the execution runs, never by a repeat under the same name or by a read. Send it as `X-Volcano-Client-Token`.

## Other responses

- `401`: Missing or invalid credential
- `403`: The anon key lacks `functions.invoke`, the service key is scoped without it, or the function is `authenticated` and the request carries an anon key. Also returned when the request's origin is refused by the project's CORS policy.
- `404`: Durable function or execution not found, or the credential cannot reach the execution. A `private` function answers every credential but a service key this way.
- `409`: The execution has not started yet. Only a service key holding `*` can reach an execution in that state.
- `429`: The function's or the project's function rate limit, which stops share with invocations and starts, or the project is over its bandwidth cap.
- `503`: Durable execution is not available in this environment, the plan terms for the request could not be read, or the execution's state could not be read back because reads in its region are throttled. The first is not one to retry in a loop; the others are transient, and a throttled read carries `Retry-After`. A stop answered with a throttle may already have been sent, so read the execution before stopping it again.

## Changes

- **2026-10-30** `84c4488f91e9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/durable-functions/:functionId/executions/:executionId/stop/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
