How to Choose Between workflow_dispatch, repository_dispatch, and Webhooks
workflow_dispatch is for humans, repository_dispatch is for external systems POSTing the API, and native webhook events fire on repo activity.
Pick by who starts the run: a person (workflow_dispatch), an external system via the API (repository_dispatch), or repository activity such as a push or PR (native webhook events).
When to use each
| Trigger | Started by | Typical use |
|---|---|---|
| workflow_dispatch | A person via UI or gh | Manual runs with inputs |
| repository_dispatch | External system via REST POST | Cross-repo or third-party triggers |
| push / pull_request | Repository activity | Normal CI on commits and PRs |
Combine dispatch triggers
.github/workflows/ci.yml
on:
workflow_dispatch:
inputs:
ref: { type: string, default: main }
repository_dispatch:
types: [deploy-request]
jobs:
run:
runs-on: ubuntu-latest
steps:
- run: echo "ref ${{ inputs.ref || github.event.client_payload.ref }}"Gotchas
- Both dispatch triggers run only on the default branch.
- Native events give richer context (
github.event) than a dispatch payload you construct.
Related guides
How to Trigger CI From a Webhook With repository_dispatchTrigger a GitHub Actions workflow from an external system by POSTing a repository_dispatch event to the REST…
How to Filter Webhook Events in a WorkflowFilter webhook events in GitHub Actions with event type lists and an if condition on the action, so a workflo…