mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
58b245e59f
* docs: fix quality gaps in CLI, automations, editor, and Index pages * docs: mirror quality fixes into es, fr, zh translations * Apply suggestion from @ethanpalm --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
67 lines
3.9 KiB
Plaintext
67 lines
3.9 KiB
Plaintext
---
|
|
title: "Create a custom automation"
|
|
description: "Create a Mintlify automation that runs on a schedule, repository push, or integration event. Add context repositories and a custom agent prompt."
|
|
keywords: ["automation", "automate", "cron", "agent", "custom automation"]
|
|
---
|
|
|
|
import GitlabAutomationSetup from '/snippets/gitlab-automation-setup.mdx';
|
|
|
|
A custom automation runs the agent on a schedule, on repository pushes, or on connected integration events using instructions that you write. Use a custom automation when you need to automate a task that isn't covered by a [predefined automation](/automations/reference).
|
|
|
|
For an overview of triggers, update modes, and configuration options shared across all automations, see [Automations](/automations).
|
|
|
|
## Prerequisites
|
|
|
|
- A [Pro or Enterprise plan](https://mintlify.com/pricing?ref=automations). The Integration trigger requires an Enterprise plan.
|
|
- 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>
|
|
|
|
1. Open the [Automations](https://app.mintlify.com/products/automations) page in your dashboard.
|
|
2. Click **New automation**.
|
|
3. On the configure page, set the automation name, trigger, prompt, context repositories, integrations, and update mode. For details on each field, see [Configurations](/automations/manage#configurations).
|
|
4. Click **Save**.
|
|
|
|
<Tip>
|
|
You can also ask the [agent in Slack](/agent/slack#manage-automations) to create an automation for you by describing what you want the automation to do.
|
|
</Tip>
|
|
|
|
## Write effective instructions
|
|
|
|
Effective automation instructions focus on a single task and define a clear, verifiable outcome. Automations can vary because agents may produce different results for the same instructions, 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).
|
|
|
|
## Test your automation
|
|
|
|
Test a new automation with a manual run so you don't have to wait for its trigger to occur. Manual runs use the automation's current configuration and appear in the run history alongside automated runs. You cannot manually run automations that trigger on integration events. See [Run an automation manually](/automations/manage#run-an-automation-manually) to choose the scope for a test run.
|
|
|
|
Review the run in the [run history](/automations/manage#view-run-history) to see the prompt, the files the agent changed, and any pull request it opened. If the result isn't what you expected, update your instructions and run it again.
|
|
|
|
<GitlabAutomationSetup />
|
|
|
|
## Edit a custom automation
|
|
|
|
1. Open the [Automations](https://app.mintlify.com/products/automations) page in your dashboard.
|
|
2. Click the <Icon icon="settings-2" /> settings button on the automation's card to open its configure page.
|
|
3. Update any of the fields described in [Configurations](/automations/manage#configurations).
|
|
4. Click **Save**.
|
|
|
|
## 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-2" /> settings button on the automation's card to open its configure page.
|
|
3. Click **Delete automation** at the bottom of the page and confirm.
|