workflow_dispatch fallback to run a scheduled workflow manually in CI
A schedule-only workflow has no "Run workflow" button, so you cannot test it or re-run a missed slot on demand. Add workflow_dispatch alongside schedule to get a manual trigger.
What this error means
You want to test a nightly workflow or re-run a missed run, but there is no manual run option because the workflow only has an on: schedule trigger.
on:
schedule:
- cron: '0 3 * * *'
# No "Run workflow" button appears in the Actions tab.Common causes
Only schedule is configured
Without workflow_dispatch, GitHub shows no manual run control for the workflow.
You need to re-run a missed slot
A skipped or delayed cron slot cannot be replayed unless a manual trigger exists.
How to fix it
Add workflow_dispatch with optional inputs
- Add
workflow_dispatchto theon:block. - Optionally define inputs to parameterize manual runs.
- Use the "Run workflow" button or
gh workflow runto trigger it.
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
dry_run:
type: boolean
default: falseTrigger manually from the CLI
Once workflow_dispatch is present on the default branch, run it with the gh CLI.
gh workflow run nightly.yml -f dry_run=trueHow to prevent it
- Always pair
schedulewithworkflow_dispatch. - Expose inputs so manual re-runs can vary behavior.
- Document how to replay a missed nightly run.