# Run automations

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/air/llms.txt).

Once you [define an automation](https://www.jetbrains.com/help/air/create-automation.html.md), Air Teams runs it whenever one of its [triggers](https://www.jetbrains.com/help/air/automation-triggers.html.md) fires: an event in GitHub, GitLab, or Jira, a schedule, a call to its incoming webhook, or the end of another automation's run. You can also start a run yourself, stop one that's in progress, or pause the automation so that its triggers no longer start runs.

<a id="automation_run_lifecycle"></a>

## What happens in a run

1.

The run starts – Air Teams creates a cloud environment and checks out the branch the trigger names: a fixed branch for a schedule, or the source branch for a pull request event. See [Repositories and environments for automations](https://www.jetbrains.com/help/air/automation-repositories.html.md).

2.

The agent works – it follows the automation's instructions, with the trigger's data as its context: the pull request, the issue, the failed workflow, or the webhook payload. Nobody answers its questions, so it works with what the instructions and the context give it.

3.

The changes are handled – Air Teams commits, pushes, or opens a pull request the way the trigger's [change
handling](https://www.jetbrains.com/help/air/automation-triggers.html.md#automation_trigger_change_handling) says, or leaves the code untouched.

4.

The run reports back – the run appears in the automation's Runs section with its summary. Air Teams sends it to the webhook [notifications](https://www.jetbrains.com/help/air/automation-notifications.html.md) you set up, and emails you if the run failed.

If another automation is [chained](https://www.jetbrains.com/help/air/chained-automations.html.md) to this one and the run finished successfully, the next automation starts within about a minute: Air Teams first waits to learn which branch the run pushed, so it can pass the branch on. This happens independently of the notifications, so don't rely on one arriving before the other.

To read the result and act on it, see [Work with automation run results](https://www.jetbrains.com/help/air/automation-run-results.html.md). If a run didn't start or ended with a problem, see [Troubleshoot automations](https://www.jetbrains.com/help/air/troubleshoot-automations.html.md).

<a id="start_automation_run"></a>

## Start a run yourself

Run an automation manually to test new instructions before you add triggers, to start it without waiting for its trigger, or to run an automation that has no triggers at all. Because no event comes with a manual run, you supply its context yourself – for example, a link to the pull request you want reviewed.

<a id="run_automation_manually_procedure"></a>

Procedure: Run an automation manually

1. Open the Automations page and select the automation.

2. Click Run Now on the automation's details page, or open the automation menu and click Run Now.

![The automation menu open next to the Run Now button, with Edit, Resume, Duplicate, Save as Template, View History, and Delete](images/air-web-automation-menu.png)

3. In the Test Automation Manually dialog, set up the run:

* Select the branch to check out.

* Select what the run does with the changes it produces – see [What to do with the changes](https://www.jetbrains.com/help/air/automation-triggers.html.md#automation_trigger_change_handling). To test an automation that will push or open pull requests, start with No code changes. If the automation works on [several repositories](https://www.jetbrains.com/help/air/automation-repositories.html.md#multi_repo_automation), the dialog has a row for each repository, so you can set both for every repository in this run.

* Optionally, enter Context for the run. The context stands in for the data a trigger would normally provide, such as an issue link, a pull request, or event details. Leave it empty to run the automation with no payload.

For an [automation done by a person](https://www.jetbrains.com/help/air/person-automations.html.md), the dialog asks only for the context.

![The Test Automation Manually dialog with a branch selector, a selector for what to do with the changes, set to Push to new branch, a context field, and the Run button](images/automation-run-manually-dialog.png)

4. Click Run.

To repeat a finished run with the same input, use Rerun on that run instead – see [Repeat a run with the same input](https://www.jetbrains.com/help/air/automation-run-results.html.md#rerun_automation_run).

<a id="stop_automation_runs"></a>

## Stop runs

Stop a single run when you no longer need its result or started it by mistake. Pause the automation when it shouldn't react to its triggers for a while – for example, while you rework its instructions, or when it fires more often than you expected.

<a id="stop_automation_run"></a>

Procedure: Stop a run in progress

1. Open the Automations page and select the automation.

2. In the Runs section, find the run that is still in progress and click the stop icon ![Stop run](images/automation-run-stop-icon.png) next to it.

<a id="pause_resume_automation"></a>

Procedure: Pause and resume an automation

1. Open the Automations page and select the automation.

2. Open the automation menu and click Pause. The automation stays in the list in the Paused state but no longer starts when its triggers fire.

3. To resume, open the automation menu and click Resume. The automation reacts to its triggers again.

<a id="automation_paused_by_air"></a>

## When Air Teams pauses an automation

Air Teams pauses a project automation itself when it can no longer reach the repository. This happens on projects that run their automations on the project's own AI credits, when the GitLab token in project settings is missing, invalid, or has no access to that repository. The automation shows as Paused with a warning icon that says which case it is.

You can't run, pause, or resume an automation paused this way. A project admin fixes the token in project settings – see [Set up GitLab access for project automations](https://www.jetbrains.com/help/air/project-gitlab-access.html.md#project_gitlab_access) – and the automation starts reacting to its triggers again.

