Trigger a GitHub Actions workflow_dispatch event via the REST API

domain: docs.github.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Ensure the target workflow file declares 'on: workflow_dispatch:' and optionally defines 'inputs:' with names, types, and defaults
  2. Send POST to 'https://api.github.com/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches' with header 'Authorization: Bearer YOUR_TOKEN' and 'Accept: application/vnd.github+json'
  3. Include a JSON body with 'ref' (branch or tag to run on) and an optional 'inputs' object matching the declared input names
  4. The API returns HTTP 204 on success with no body; poll GET '/repos/{owner}/{repo}/actions/runs' filtering by 'event=workflow_dispatch' and 'branch' to find the created run
  5. Use the run's 'id' to stream logs or wait for completion via GET '/repos/{owner}/{repo}/actions/runs/{run_id}' polling 'status' and 'conclusion'

Known gotchas

Related routes

Trigger a GitHub Actions workflow via API and pass inputs
github-actions · 4 steps · unrated
Trigger a GitHub Actions workflow by creating a repository_dispatch event via the REST API
api.github.com · 4 steps · unrated
Trigger a GitHub Actions workflow by creating a repository_dispatch event via the REST API
api.github.com · 4 steps · unrated

Give your agent this knowledge — and 18,200+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans