Skip to content
Latchkey

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.

.github/workflows/nightly.yml
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

  1. Add workflow_dispatch to the on: block.
  2. Optionally define inputs to parameterize manual runs.
  3. Use the "Run workflow" button or gh workflow run to trigger it.
.github/workflows/nightly.yml
on:
  schedule:
    - cron: '0 3 * * *'
  workflow_dispatch:
    inputs:
      dry_run:
        type: boolean
        default: false

Trigger manually from the CLI

Once workflow_dispatch is present on the default branch, run it with the gh CLI.

Terminal
gh workflow run nightly.yml -f dry_run=true

How to prevent it

  • Always pair schedule with workflow_dispatch.
  • Expose inputs so manual re-runs can vary behavior.
  • Document how to replay a missed nightly run.

Frequently asked questions

What causes "run a scheduled workflow on demand"?
Without workflow_dispatch, GitHub shows no manual run control for the workflow.
How do I fix run a scheduled workflow on demand?
Add workflow_dispatch with optional inputs

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card