Skip to main content
Workflows are in beta. They are currently available on Enterprise plans.Contact us to enable workflows for your organization.
Workflows run the agent automatically on a schedule or on a push to a repository. Each workflow defines a prompt for the agent and a trigger for when to run it. When a workflow runs, the agent clones any specified repositories as context, follows the prompt, and either opens a pull request or pushes changes directly to your deployment branch. You can have up to 10 active workflows. Each workflow can run up to 20 times a day. Runs that fail do not count toward this limit.
Use workflows that run on a schedule to automate recurring tasks like publishing changelogs or checking for grammar and style issues.Use workflows that run on push events to automate reactive maintenance tasks like updating API references or identifying documentation updates needed for new features.

Create a workflow

Create a workflow in the dashboard

On the Workflows page of your dashboard, click the New workflow button.
The new workflow setup page.

Add a workflow file to your repository

Create a .md file for each workflow in a .mintlify/workflows/ directory at the root of your documentation repository. Each file defines one workflow. Workflow files use YAML frontmatter to configure the workflow, followed by a Markdown prompt for the agent.
.mintlify/workflows/update-changelog.md
---
name: Update changelog
on:
  cron: "0 9 * * 1"
context:
  - repo: your-org/your-product
automerge: false
---

Review all changes since the last changelog update. Draft a new changelog post with any new features, bug fixes, or breaking changes.

Include information about what a change is and how it affects users.

Do not include any internal-only information or minor changes like bumping package versions or updating documentation.

Success criteria: Someone who reads the changelog knows the most up to date information about the product including what changed and whether or not it affects them.

Frontmatter fields

FieldRequiredDescription
nameYesDisplay name shown in the dashboard.
onYesTrigger configuration.
contextNoRepositories cloned as reference when the workflow runs.
automergeNoDefaults to false, which opens a pull request. If true, pushes changes directly to your deployment branch.
You must have the Mintlify GitHub App installed on every repository listed in the context or on.push.repo fields. Add new repositories on the GitHub app page of your Mintlify dashboard.
The GitHub app page showing connected repositories for two organizations.

Triggers

Each workflow must define exactly one trigger using the on field.

On schedule (cron)

Run a workflow on a recurring schedule using a cron expression. All schedules run in UTC. Workflows queue within 10 minutes of the scheduled time and may take up to 10 minutes to run.
on:
  cron: "0 9 * * 1"
The value is a standard 5-field cron expression in minute hour day-of-month month day-of-week format. Use a tool like crontab.guru to build and validate schedules.
ExpressionSchedule
"0 9 * * 1"Every Monday at 9:00 AM UTC
"0 0 1 * *"First day of each month at midnight UTC
"0 8 * * 1-5"Weekdays at 8:00 AM UTC

On push events

Run a workflow when a pull request merges to a specific repository and branch.
on:
  push:
    - repo: your-org/your-product
      branch: main
  • repo: The GitHub repository in owner/repo format.
  • branch (optional): The branch to watch for merges. If you don’t specify a branch, the workflow triggers on merges to the repository’s default branch.
A workflow can watch for merges in multiple repositories or branches.
on:
  push:
    - repo: your-org/your-product
    - repo: your-org/another-repo
      branch: release

Context repositories

Use context to give the agent read access to additional repositories when the workflow runs. This is useful when your prompt requires reviewing code or content outside your documentation repository.
context:
  - repo: your-org/your-product
  - repo: your-org/design-system

Auto-merge changes

By default, the agent opens a pull request for each workflow run so you can review changes before they go live. Set automerge: true to push changes directly to your deployment branch without a pull request.
automerge: true

Prompts

Effective prompts focus on one task and have a specific outcome in mind. Workflows always have some variance because of the nondeterministic nature of agents, but you can improve the consistency of workflow outputs by following these best practices.
  • Describe the outcome you want the agent to achieve.
  • Include success criteria.
  • Specify the context you want the agent to use.
  • Split complex tasks into steps or multiple workflows.

Example workflows

Draft documentation for new features

If you use agent suggestions in your dashboard, this workflow replicates that behavior.Add this workflow with any modifications for your project to automatically draft documentation as you add new features to your product.
Runs when pull requests merge to your product repository to identify documentation updates needed for any new features or APIs introduced.
.mintlify/workflows/draft-feature-docs.md
---
name: Draft docs for new features
on:
  push:
    - repo: your-org/your-product
      branch: main
context:
  - repo: your-org/your-docs
automerge: false
---

Review the diff from the last merged PR in `your-org/your-product`. Identify any new features, APIs, or other changes that require documentation.

For each new addition, draft documentation updates that explain what it does, when to use it, and how to configure it. Include a code example where relevant.

Success criteria: After reading any new or updated documentation, users understand what the feature is, if it applies to tasks they do, and how to use it.

## Important

- Only document changes that affect end users. Skip internal refactors or dependency updates.
- Match the style and structure of existing docs pages.

Style audit

Runs when a documentation pull request merges to catch style guide violations before they accumulate. This example workflow automatically fixes style guide violations and lists any violations that require human judgment in the PR body.
.mintlify/workflows/style-audit.md
---
name: Style audit
on:
  push:
    - repo: your-org/your-docs
      branch: main
automerge: false
---

Review all MDX files changed in the last merged PR against the style guide at `path/to/style-guide`.

Open a pull request to resolve any style violations that can be fixed automatically. For any edits that require judgment or nuance, note them in the PR body with the specific lines, rule violations, and suggested fixes.

Success criteria:
- All style violations have a proposed resolution.
- No new style violations are introduced.

## Important

- Do not change content meaning. Only correct style violations.
- Skip any files in language subdirectories (`es/`, `fr/`, `zh/`).

Update API reference

Runs when pull requests merge to your product repository to keep API reference pages in sync with your product code. When endpoints or parameters change, this workflow updates the corresponding content in your documentation.
.mintlify/workflows/update-api-reference.md
---
name: Update API reference
on:
  push:
    - repo: your-org/your-product
      branch: main
context:
  - repo: your-org/your-docs
automerge: false
---

Review the diff from the last merged PR in `your-org/your-product` for changes to API endpoints, parameters, response shapes, or error codes.

Update the corresponding API specifications or pages in the docs to reflect the changes. Include updated parameter descriptions, type information, and examples where affected.

Success criteria: All API specifications and pages are up to date with the changes in the product repository.

## Important

- If a parameter or endpoint was removed, mark it as deprecated rather than deleting it unless the code explicitly removes it with no deprecation period.
- If no API changes were introduced, do nothing.

Track translation lag

Run weekly to compare English source files against their translations and identify pages that have fallen behind. To use this workflow, update the example language subdirectories (es/, fr/, zh/) to your actual language subdirectories.
.mintlify/workflows/translation-lag.md
---
name: Track translation lag
on:
  cron: "0 9 * * 3"
---

Compare the English MDX files in the repo against their counterparts in the `es/`, `fr/`, and `zh/` subdirectories. Use git history to identify English files updated more recently than their translations.

Open a pull request that lists pages that are out of sync, organized by language. For each page, include the date of the last English update and a brief summary of what changed so translators have context on what to update.

Success criteria: Any discrepancies between the English and translated files are identified and listed in the pull request.

## Important

- If a translated file does not exist, flag it as missing rather than out of sync.
- Group findings by language, then by how far out of date they are (most stale first).

SEO and metadata audit

Runs weekly to check for pages with missing or weak metadata and open a pull request with improvements. This example workflow checks for missing description frontmatter. Edit the workflow to check for other metadata or content issues that you prioritize for your documentation.
.mintlify/workflows/seo-audit.md
---
name: SEO and metadata audit
on:
  cron: "0 9 * * 1"
automerge: false
---

Audit all MDX files in the docs for SEO and metadata quality. Check for:

- Missing or empty `description` frontmatter
- Descriptions that are too short (under 50 characters) or too long (over 160 characters)

Open a pull request with improvements for any issues found. Write descriptions that accurately summarize the page content in plain language.

Success criteria: All pages have up to date descriptions that accurately summarize the page content in plain language.

## Important

- Only update frontmatter. Do not change page content.
- If all pages have complete and reasonable metadata, do nothing.