Files
mintlify__docs/zh/automations/create.mdx
mintlify[bot] eacb75d584 Documentation quality check: fill reader-question gaps (#6834)
* docs: address gaps in create automation, preview, and Slack pages

* docs: mirror gap-fix edits into es/fr/zh translations

* Apply suggestions from code review

Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>

---------

Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
2026-07-31 09:05:36 -07:00

63 lines
3.0 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "创建自定义自动化"
description: "创建 Mintlify 自动化,按计划、仓库推送或集成事件运行。添加上下文仓库和自定义 agent 提示词。"
keywords: ["automation", "automate", "cron", "agent", "custom automation"]
---
import GitlabAutomationSetup from '/snippets/zh/gitlab-automation-setup.mdx';
自定义自动化使用你编写的指令,按计划、在仓库推送时或在已连接的集成事件发生时运行 agent。当[预定义自动化](/zh/automations/reference)无法覆盖你需要的行为,或者你希望将自己的提示词与特定的上下文仓库和集成组合在一起时,使用自定义自动化。有关所有自动化共享的触发器、更新模式和配置选项的概述,请参见[自动化](/zh/automations)。
<div id="prerequisites">
## 前置条件
</div>
- 一个已连接到 GitHub 或 GitLab 仓库的 Mintlify 项目
- 对于 GitHub:在你计划用于自动化的每个仓库上都安装 [Mintlify GitHub 应用](/zh/deploy/github)
- 对于 GitLab:已连接的 GitLab 账户(请参见下方[GitLab 设置](#gitlab-setup))
<div id="create-a-custom-automation">
## 创建自定义自动化
</div>
<Note>
agent 运行在受限互联网访问的隔离沙箱中。它无法在运行时安装额外的包或工具。引用不可用工具的提示词可能产生意外结果或失败。
</Note>
1. 在控制台中打开 [Automations](https://app.mintlify.com/products/automations) 页面。
2. 点击 **Create a custom automation**。
3. 配置自动化名称、触发器、指令、上下文仓库、集成和更新模式。有关各字段的详细说明,请参见[配置](/zh/automations/manage#configurations)。
4. 点击 **Create automation**。
<Tip>
你也可以让 [Slack 中的 agent](/zh/agent/slack#manage-automations) 为你创建自动化,只需描述你希望该自动化执行的操作。
</Tip>
<div id="write-effective-instructions">
## 撰写有效的指令
</div>
有效的自动化指令聚焦于单一任务,并定义清晰、可验证的结果。由于 agent 是非确定性的,自动化结果会有所差异,但格式良好的指令能产生更一致的结果。
- **描述结果。** 告诉 agent 一次成功的运行应该是什么样的。
- **撰写流程。** 给 agent 一份按步骤执行的指南。
- **保持范围窄。** 将复杂任务拆分到多个自动化中,而不是合并到一个提示词里。
更多示例和模式请参见[使用自动化](/zh/guides/use-automations)。
<Tip>
审查你自定义自动化的输出,以确认它们按预期运行。更新你的指令以改进结果。
</Tip>
<GitlabAutomationSetup />
<div id="delete-a-custom-automation">
## 删除自定义自动化
</div>
删除自动化是永久性的,会移除其配置和运行历史。
1. 在控制台中打开 [Automations](https://app.mintlify.com/products/automations) 页面。
2. 点击自动化旁边的 <Icon icon="settings" /> 设置按钮。
3. 点击 **Delete**。