GitHub Actions Workflow Runs
When a build goes red, find the failing GitHub Actions run, open its jobs and read the job log to see which step broke, then re-run only the failed jobs, cancel a stuck run, or start a workflow_dispatch workflow on another branch. Artifacts from each run are listed too.
Connect this API to an AI agent Browse all specs
What you can do with GitHub Actions Workflow Runs via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /repos/{owner}/{repo}/actions/workflows |
listWorkflows | List the workflows defined in a repository |
| GET | /repos/{owner}/{repo}/actions/workflows/{workflow_id} |
getWorkflow | Get a workflow by id or file name |
| GET | /repos/{owner}/{repo}/actions/runs |
listWorkflowRuns | List recent runs filtered by branch, status, event or commit |
| GET | /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs |
listRunsForWorkflow | List runs of one workflow |
| GET | /repos/{owner}/{repo}/actions/runs/{run_id} |
getWorkflowRun | Get a run's status, conclusion, branch and commit |
| GET | /repos/{owner}/{repo}/actions/runs/{run_id}/jobs |
listJobsForRun | List a run's jobs and their steps |
| GET | /repos/{owner}/{repo}/actions/jobs/{job_id} |
getJob | Get one job with step results and runner |
| GET | /repos/{owner}/{repo}/actions/jobs/{job_id}/logs |
downloadJobLogs | Get a download link for a job's plain-text log |
| GET | /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts |
listRunArtifacts | List the artifacts a run uploaded |
| POST | /repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs |
rerunFailedJobs | Re-run only the failed jobs of a run |
| POST | /repos/{owner}/{repo}/actions/runs/{run_id}/rerun |
rerunWorkflow | Re-run every job of a run |
| POST | /repos/{owner}/{repo}/actions/runs/{run_id}/cancel |
cancelWorkflowRun | Cancel a queued or running run |
| POST | /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches |
dispatchWorkflow | Start a workflow_dispatch workflow on a branch or tag |
Authentication
github_token
Bearer token — sent as Authorization: Bearer <token>
GitHub fine-grained personal access token (or a GitHub App installation token), sent as Authorization: Bearer <token>.
How to get a credential
- On GitHub, open Settings > Developer settings > Personal access tokens > Fine-grained tokens and click Generate new token.
- Pick the resource owner (you or the organization) and the repositories the agent may touch.
- Under Repository permissions, set Actions to Read and write (Read-only is enough if you will not re-run, cancel or dispatch). Metadata read is added automatically.
- Generate the token and copy it (
github_pat_...). Organizations may need to approve it.
Permissions used
| Permission | Operations |
|---|---|
| Actions: read | listWorkflows, getWorkflow, listWorkflowRuns, listRunsForWorkflow, getWorkflowRun, listJobsForRun, getJob, downloadJobLogs, listRunArtifacts |
| Actions: write | rerunWorkflow, rerunFailedJobs, cancelWorkflowRun, dispatchWorkflow |
Common errors
| Status | Meaning | Fix |
|---|---|---|
| 401 | Token missing, expired or revoked | Generate a new token and update the credential. |
| 403 | Permission missing, token not approved by the org, or rate limit | Give the token Actions access to this repository; wait if x-ratelimit-remaining is 0. |
| 404 | Repository or run not visible to the token | Check owner/repo and that the token covers the repository. |
| 422 | Bad dispatch input or workflow lacks workflow_dispatch |
Send a valid ref and only the inputs the workflow defines. |
| 429 | Secondary rate limit | Slow down and retry after the retry-after header. |
Store the token as a VX Agents credential (Bearer token).
Usage guide
Setup
- Add a GitHub fine-grained token as a VX Agents Bearer credential, with repository permission Actions (read and write) on the repositories you want covered.
- Every call pins
X-GitHub-Api-Version: 2022-11-28. - Worth pinning:
ownerandrepowhen the agent works on one repository.
Triage a failing build
listWorkflowRunswithstatus=failure(orbranch,event,head_sha,created=>=2026-10-01) to find the run;listRunsForWorkflownarrows to one workflow (id or file name such asci.yml, fromlistWorkflows).getWorkflowRunforstatus,conclusion,head_branch,head_shaandrun_attempt.listJobsForRun(filter=latest) shows each job and its steps withconclusion; pick the failed job.getJobgives one job in detail.downloadJobLogsreturns a short-lived link (HTTP 302Location) to the plain-text log; read the lines around the failed step.listRunArtifactslists test reports or builds the run uploaded (archive_download_url).- To retry, tell the user what will run and confirm, then
rerunFailedJobs(only failed jobs and their dependents) orrerunWorkflow(all jobs). Add{"enable_debug_logging": true}for more detail. - To stop a stuck run, confirm, then
cancelWorkflowRun.
Start a workflow by hand
getWorkflowto check it exists and isactive; the workflow file must have aworkflow_dispatchtrigger.- Confirm branch and inputs with the user, then
dispatchWorkflowwith{"ref": "main", "inputs": {"environment": "staging"}}. Only send inputs the workflow defines (at most 25). listRunsForWorkflowwithevent=workflow_dispatchto follow the new run.
Good to know
- Run status values:
queued,in_progress,completed; when completed,conclusionissuccess,failure,cancelled,skippedortimed_out. - Lists page with
per_page(max 100) andpage; run lists return at most 1,000 results per query, so filter bycreated. - Log links expire after about a minute; fetch them right away.
- Re-runs, cancels and dispatches use CI minutes and can deploy code: always confirm first. Disabling workflows and deleting runs or logs are not part of this spec.
Source: GitHub REST API reference for Actions workflows, workflow runs, jobs and artifacts (https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28), checked 2026-10-20.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “GitHub Actions Workflow Runs” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.