> ## Documentation Index
> Fetch the complete documentation index at: https://tomee-mintlify-5e4b4d00.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a custom automation

> Create a custom Mintlify automation that runs on a schedule, repository push, or integration event, with context repositories and an agent prompt.

## Prerequisites

* A Mintlify project connected to a GitHub or GitLab repository
* For GitHub: the [Mintlify GitHub App](/deploy/github) installed on every repository you plan to use in the automation
* For GitLab: a connected GitLab account (see [GitLab setup](#gitlab-setup) below)

## Create a custom automation

<Note>
  The agent runs in an isolated sandbox with restricted internet access. It cannot install additional packages or tools at runtime. Prompts that reference unavailable tools may produce unexpected results or fail.
</Note>

Inside the sandbox, the agent can:

* Read files in your documentation repository and any connected context repositories.
* Use the shared and personal [integrations](/automations/integrations) you select as tools.
* Edit MDX files and open a pull request against your documentation repository.

The sandbox cannot make arbitrary outbound network requests, install packages, or run shell commands beyond the tools Mintlify provides.

1. Open the [Automations](https://app.mintlify.com/products/automations) page in your dashboard.
2. Click **Create a custom automation**.
3. Configure the automation:

   * **Name**: A short, descriptive label shown in the dashboard and run history.
   * **Trigger**: When the automation runs (content update, code change, custom schedule, or integration event).
   * **Instructions**: The prompt the agent follows on each run.
   * **Context repositories**: Extra repositories the agent can read for additional context.
   * **Integrations**: Shared integrations the agent can call as tools during the run.
   * **Update mode**: How the agent proposes changes—open a pull request, commit directly, or another mode.

   For full details on each field, see [Configurations](/automations/manage#configurations).
4. Click **Create automation**.

## Write effective instructions

Effective automation instructions focus on a single task and define a clear, verifiable outcome. Automations have some variance because agents are nondeterministic, but well-formatted instructions produce more consistent results.

* **Describe the outcome.** Tell the agent what a successful run should look like.
* **Write a procedure.** Give the agent a step-by-step guide to follow.
* **Keep scope narrow.** Split complex tasks across multiple automations rather than combining them into one prompt.

For more examples and patterns, see [Use automations](/guides/use-automations).

<Tip>
  Review the output of your custom automations to confirm they work as expected. Update your instructions to improve the results.
</Tip>

## GitLab setup

To use GitLab repositories in an automation, connect each project through the [GitLab OAuth](https://app.mintlify.com/settings/organization/gitlab-oauth) settings page. Connect every repository the automation touches—your documentation repository and any trigger or context repositories. You must have at least the Maintainer role on each project.

<Note>
  Automations require a paid GitLab tier. The agent uses short-lived project access tokens for repository access, which GitLab's Free plan does not support.
</Note>

## Delete a custom automation

Deleting an automation is permanent and removes its configuration and run history.

1. Open the [Automations](https://app.mintlify.com/products/automations) page in your dashboard.
2. Click the <Icon icon="settings" /> settings button beside an automation.
3. Click **Delete**.
