> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel an activity

> See how to cancel running or pending activities in an environment.

If you have a stuck activity or you pushed a change you know doesn't work,
you can cancel a running or pending activity on an environment.
This works for activities such as builds, cron jobs, and source operations.

You can cancel activities using the [CLI](https://developer.upsun.com/cli.md)
or in the [Console](https://developer.upsun.com/docs/administration/web).

> [tab] Using the CLI
>
> Run the following command:
>
> ```bash theme={null}
> upsun activity:cancel
> ```
>
> If you have more than one running or pending activity, choose which activity to cancel.
>
> You can also cancel a specific activity by specifying its ID:
>
> ```bash theme={null}
> upsun activity:cancel <ACTIVITY_ID>
> ```
>
> Get the ID from the [activity log](https://developer.upsun.com/docs/observability/logs/access-logs.md#activity-logs).

> [tab] In the Console
>
> 1. Open the environment where you want to cancel an activity.
> 2. In the [activity log](https://developer.upsun.com/docs/observability/logs/access-logs.md#activity-logs),
>    click  **More** next to the activity you want to cancel.
> 3. Click **Cancel**.

## Non-cancellable activities

An activity can finish in between when you load the Console and when you click **Cancel**.
For example, when the activity is a [source operation](https://developer.upsun.com/docs/configure-apps/source-operations.md)
and the related build hook has already completed.
In such cases, you get a message that the activity can't be cancelled.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.