Trigger automation
Trigger a scheduled automation to run immediately, instead of waiting for its next scheduled time. Useful for running automations from CI/CD pipelines, like a GitHub Action that runs on every merge to your default branch. Only scheduled (custom schedule) automations can be triggered. The run picks up changes since the last completed run, identical to a regular scheduled run.
Authenticate with an admin API key.
Use this endpoint to trigger a scheduled automation on demand, instead of waiting for its next scheduled run. The automation behaves identically to a regular scheduled run: it picks up everything that has changed since the last completed run.
This endpoint only supports automations configured with a Custom schedule trigger. Requests for automations with other triggers, like Code change or Content update, return a 400 error.
Use cases
Section titled “Use cases”- CI/CD pipelines: Run the Update from code changes automation on every merge to
main, so docs update at your release cadence rather than on a fixed schedule. - Release events: Run the Draft changelog automation when you cut a release tag, so the changelog drafts at the same time the release ships.
- Custom tooling: Trigger automations from internal tools, Slack commands, or scheduled jobs you already run.
Example
Section titled “Example”Trigger an automation from a GitHub Action whenever code merges to main:
on:
push:
branches: [main]
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- run: |
curl -fsS -X POST \
"https://api.mintlify.com/v1/workflow/$PROJECT_ID/$WORKFLOW_ID/trigger" \
-H "Authorization: Bearer ${{ secrets.MINTLIFY_API_KEY }}"
env:
PROJECT_ID: ${{ vars.MINTLIFY_PROJECT_ID }}
WORKFLOW_ID: ${{ vars.MINTLIFY_WORKFLOW_ID }}Rate limits
Section titled “Rate limits”This endpoint shares a rate limit with Trigger update: up to 10 requests per 10 seconds per organization. Triggered runs consume credits at the same rate as scheduled runs.
OpenAPI
Related topics
POST /workflow/{projectId}/{workflowSchemaId}/trigger
curl --request POST \
--url https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: "POST", headers: {"Authorization": "Bearer <token>"}};
fetch("https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger", options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mintlify.com/v1/workflow/{projectId}/{workflowSchemaId}/trigger")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"schemaId": "<string>",
"instanceId": "<string>",
"jobId": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Section titled “Authorizations”AuthorizationstringrequiredThe Authorization header expects a Bearer token. Use an admin API key. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
Section titled “Path Parameters”projectIdstringrequiredYour project ID. Can be copied from the API keys page in your dashboard.
workflowSchemaIdstringrequiredThe ID of the automation to trigger. Can be copied from the automation's settings panel on the Automations page in your dashboard.
Response
Section titled “Response”202 — Automation run queued successfully.
schemaId?stringThe ID of the triggered automation.
instanceId?stringThe ID of the queued automation run. Appears in the run history on the Automation Runs page.
jobId?stringThe ID of the background job processing the run.