Fix workflow_dispatch Inputs Not Showing in the Actions UI
Workflow_dispatch inputs missing in GitHub Actions? Check the default branch, YAML syntax, input types and the 25-input limit, then verify the run.
At a glance
- Last reviewed
- Reading time
- 3 min read
Code samples are not run in a live repository. See our editorial standards.
On this page
The most common reason workflow_dispatch inputs don’t show is that the workflow file isn’t on the repository’s default branch. GitHub only delivers this trigger, and only shows the Run workflow button, when the file exists on the default branch. The next most common causes are invalid YAML, an unsupported input type, and too many inputs.
Put the workflow file on the default branch
Merge the file into the default branch under .github/workflows/. If it exists only on a feature branch, the Run workflow button doesn’t appear in the Actions tab.
Check that the file is committed on the default branch:
git fetch origin
git ls-tree -r --name-only origin/main .github/workflows
Replace main with your default branch name. Your workflow file should appear in the output.
Once a workflow has run at least once, you can dispatch it against other branches or tags through the API or CLI. The button in the UI still depends on the default branch.
Confirm the trigger defines inputs
A bare on: workflow_dispatch adds the button but no input fields. Inputs appear only when you declare them under on.workflow_dispatch.inputs.
name: Manual workflow
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
type: string
enable_feature:
description: 'Enable new feature'
required: false
type: boolean
default: false
priority:
description: 'Job priority'
required: true
type: number
default: 5
environment:
description: 'Deployment target'
required: true
type: choice
options:
- dev
- staging
- prod
jobs:
show-inputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Version: ${{ inputs.version }}"
echo "Feature enabled: ${{ inputs.enable_feature }}"
echo "Priority: ${{ inputs.priority }}"
echo "Environment: ${{ inputs.environment }}"
Each input is a key under inputs:, indented one level deeper than inputs:. The key is the input name. description, required, default and type are the fields used here.
Use a supported type: string, boolean, number, choice or environment. A choice input also needs an options list. A typo in the type or a missing options list makes the workflow file invalid.
Fix YAML errors
If the file has a syntax error, GitHub can’t parse the trigger and the workflow shows an error in the Actions tab instead of a working Run workflow form. Indentation mistakes under on: and inputs: are the usual culprit.
Open the workflow in the Actions tab or the file view on GitHub and read the error it reports. Fix it, commit to the default branch, and reload the page. For a related walkthrough, see GitHub Actions Scheduled Workflow Not Triggering: Causes and Fixes.
Stay within the input limits
inputs allows at most 25 top-level properties, and the total input payload can’t exceed 65,535 characters. Count the keys directly under inputs:. If you’re over 25, merge related inputs, for example by passing one JSON string and parsing it in a step.
Handle boolean and choice inputs
The inputs context preserves booleans as booleans. The github.event.inputs context converts them to strings. A choice input resolves to a single string.
on:
workflow_dispatch:
inputs:
deploy:
description: 'Deploy to production'
required: true
type: boolean
version:
description: 'Application version'
required: true
type: choice
options:
- '1.0'
- '1.1'
- '2.0'
jobs:
build:
runs-on: ubuntu-latest
if: ${{ inputs.deploy }}
steps:
- name: Echo version
run: echo "Building version ${{ inputs.version }}"
With github.event.inputs, compare against a string instead: ${{ github.event.inputs.deploy == 'true' }}.
Trigger the workflow with inputs
With the GitHub CLI, pass each input with -f key=value:
gh workflow run deploy.yml --ref main -f environment=production -f logLevel=debug
With the REST API, send the inputs in the inputs object:
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/$OWNER/$REPO/actions/workflows/deploy.yml/dispatches" \
-d '{"ref":"main","inputs":{"environment":"production","logLevel":"debug"}}'
ref is the branch or tag to run against. The workflow identifier can be the file name or the numeric workflow ID. Input names in the request must match names defined in the workflow file.
Verify the fix
- Open the Actions tab, select the workflow in the left sidebar, and click Run workflow. A form with one field per input should appear, with your
choiceoptions in a dropdown and booleans as checkboxes. - Start a run and open a step that echoes
${{ inputs.environment }}or similar. The logged values should match what you entered. - If the button is still missing, run the
git ls-treecheck above and confirm the file is on the default branch.
Spotted an error? Report it on our Contact page and see our editorial standards for how we correct articles.