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

Frontmatter fields

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.
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.

On push events

Run a workflow when changes push to a specific repository or branch. This includes both pull request merges and direct pushes to the branch.
  • repo: The GitHub repository in owner/repo format.
  • branch (optional): The branch to watch for pushes. If you don’t specify a branch, the workflow triggers on pushes to the repository’s default branch.
A workflow can watch for pushes to multiple repositories or branches.

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.

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.

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 changes are pushed to your product repository to identify documentation updates needed for any new features or APIs introduced.
.mintlify/workflows/draft-feature-docs.md

Style audit

Runs when changes push to your documentation repository 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

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

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

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