GitHub Actions: "Workflow does not have 'workflow_dispatch' trigger"
You started a workflow by hand, with the REST API, gh workflow run or a tool built on them, and GitHub answered HTTP 422 with this message. GitHub reads the workflow file as it is on the branch or tag you start it on (the ref), and in that copy the on: section has no workflow_dispatch. The copy you are looking at, often the one on the default branch, may well have it.
Where the message comes from
- REST API:
POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatcheswithref, which is required ("The git reference for the workflow. The reference can be a branch or tag name."), andinputs. GitHub's documentation: "You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs." (Create a workflow dispatch event) - GitHub CLI:
gh workflow run release.ymlsends that request for the default branch, or for the branch or tag given with--ref, and passes GitHub's answer on:could not create workflow dispatch event: HTTP 422: Workflow does not have 'workflow_dispatch' trigger, followed by the request's address. Run without a workflow name, in a terminal, gh first reads the file at that ref and stops in its own words:unable to manually run a workflow without a workflow_dispatch event. Both are in gh's source (pkg/cmd/workflow/run/run.go).
Why the file has no trigger, and the fix
- The trigger is on another branch. gh without
--refstarts the workflow on the repository's default branch, so a trigger added on a feature branch and not merged yet is not there. Start it where the trigger is (gh workflow run release.yml --ref my-branch, or"ref": "my-branch"in the request), or merge the trigger. It also happens the other way round: the default branch has the trigger, and the older branch or tag you start it on does not. - The default branch does not have it yet. GitHub's documentation: "This event will only trigger a workflow run if the workflow file exists on the default branch." The Run workflow button on github.com shows only when the file on the default branch has the trigger, and "Once a workflow has run at least once, you can dispatch it against any branch or tag via the GitHub API or GitHub CLI." (Events that trigger workflows)
- The trigger is not where GitHub looks for it. It has to be one of the events under
on:at the top of the file:on: workflow_dispatch,on: [push, workflow_dispatch], orworkflow_dispatch:indented one level underon:. Indented underpush:, or written at the top level besideon:, it is not a trigger. - GitHub has not read the file again. In one report (May 25, 2026, a repository whose fork had been made anew) GitHub gave this answer with the trigger in place, and its list of workflows showed the file's path (
.github/workflows/release.yml) instead of the workflow'sname:. Disabling and enabling the workflow did not help; a commit that changed one comment in the file did (the pull request). This is one report, not documented behavior.
Checking the copy GitHub reads
# the workflow file as it is on the branch or tag you start it on gh api 'repos/<owner>/<repo>/contents/.github/workflows/release.yml?ref=my-branch' \ -H 'Accept: application/vnd.github.raw+json' # the workflows GitHub knows: id, name, path and state gh api repos/<owner>/<repo>/actions/workflows \ --jq '.workflows[] | [.id, .name, .path, .state] | @tsv'
If the first command shows no workflow_dispatch under on:, the fix is in one of the first three items above. If it does, and the second command lists the workflow under its path instead of its name, it is the fourth.
Starting workflows from IntelliJ IDEA and other JetBrains IDEs
Pipeline Inbox for GitHub Actions Workflows, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the runs of all your repositories in an IDE tool window, with their jobs, steps and logs. Its Run Workflow reads each workflow file on the branch you have checked out (or the default branch) and offers only the ones with a workflow_dispatch trigger there, with a field for each of their inputs. Choose another branch or tag and it reads the file there again; if the trigger is missing, it says "On my-branch, this workflow has no workflow_dispatch trigger." before anything is started. Reading runs and logs is free; re-running, cancelling, running workflows and reviewing deployments are Pro (US$1.50 a month, with a 30-day trial).
GitHub and GitHub Actions are trademarks of GitHub, Inc.; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with, sponsored or endorsed by GitHub, Inc. or JetBrains.
More: "created over a month ago": running a workflow again · GitHub Actions plugins for IntelliJ IDEA compared · 日本語