{"meta":{"title":"Manually running a workflow","intro":"When a workflow is configured to run on the workflow_dispatch event, you can run the workflow using the Actions tab on GitHub, GitHub CLI, or the REST API.","product":"GitHub Actions","breadcrumbs":[{"href":"/en/actions","title":"GitHub Actions"},{"href":"/en/actions/how-tos","title":"How-tos"},{"href":"/en/actions/how-tos/manage-workflow-runs","title":"Manage workflow runs"},{"href":"/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow","title":"Manually run a workflow"}],"documentType":"article"},"body":"# Manually running a workflow\n\nWhen a workflow is configured to run on the workflow_dispatch event, you can run the workflow using the Actions tab on GitHub, GitHub CLI, or the REST API.\n\n## Configuring a workflow to run manually\n\nTo run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event.\n\nTo trigger the `workflow_dispatch` event, your workflow must be in the default branch. For more information about configuring the `workflow_dispatch` event, see [Events that trigger workflows](/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch).\n\nWrite access to the repository is required to perform these steps.\n\n## Running a workflow\n\n<div class=\"ghd-tool webui\">\n\n1. On GitHub, navigate to the main page of the repository.\n\n2. Under your repository name, click **<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-play\" aria-label=\"play\" role=\"img\"><path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Zm4.879-2.773 4.264 2.559a.25.25 0 0 1 0 .428l-4.264 2.559A.25.25 0 0 1 6 10.559V5.442a.25.25 0 0 1 .379-.215Z\"></path></svg> Actions**.\n\n   ![Screenshot of the tabs for the \"github/docs\" repository. The \"Actions\" tab is highlighted with an orange outline.](/assets/images/help/repository/actions-tab-global-nav-update.png)\n\n3. In the left sidebar, click the name of the workflow you want to run.\n\n   ![Screenshot of the \"Actions\" page. In the left sidebar, a workflow name is highlighted with an outline in dark orange.](/assets/images/help/repository/actions-select-workflow-2022.png)\n\n4. Above the list of workflow runs, click the **Run workflow** button.\n\n   > \\[!NOTE]\n   > To see the **Run workflow** button, your workflow file must use the `workflow_dispatch` event trigger. Only workflow files that use the `workflow_dispatch` event trigger will have the option to run the workflow manually using the **Run workflow** button. For more information about configuring the `workflow_dispatch` event, see [Events that trigger workflows](/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch).\n\n   ![Screenshot of a workflow page. Above the list of workflow runs, a button, labeled \"Run workflow\", is outlined in dark orange.](/assets/images/help/actions/actions-workflow-dispatch.png)\n\n5. Select the **Branch** dropdown menu and click a branch to run the workflow on.\n\n6. If the workflow requires input, fill in the fields.\n\n7. Click **Run workflow**.\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\n> \\[!NOTE]\n> To learn more about GitHub CLI, see [About GitHub CLI](/en/github-cli/github-cli/about-github-cli).\n\nTo run a workflow, use the `workflow run` subcommand. Replace the `workflow` parameter with either the name, ID, or file name of the workflow you want to run. For example, `\"Link Checker\"`, `1234567`, or `\"link-check-test.yml\"`. If you don't specify a workflow, GitHub CLI returns an interactive menu for you to choose a workflow.\n\n```shell\ngh workflow run WORKFLOW\n```\n\nIf your workflow accepts inputs, GitHub CLI will prompt you to enter them. Alternatively, you can use `-f` or `-F` to add an input in `key=value` format. Use `-F` to read from a file.\n\n```shell\ngh workflow run greet.yml -f name=mona -f greeting=hello -F data=@myfile.txt\n```\n\nYou can also pass inputs as JSON by using standard input.\n\n```shell\necho '{\"name\":\"mona\", \"greeting\":\"hello\"}' | gh workflow run greet.yml --json\n```\n\nTo run a workflow on a branch other than the repository's default branch, use the `--ref` flag.\n\n```shell\ngh workflow run WORKFLOW --ref BRANCH\n```\n\nTo view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list.\n\n```shell\ngh run watch\n```\n\n</div>\n\n## Running a workflow using the REST API\n\nWhen using the REST API, you configure the `inputs` and `ref` as request body parameters. If the inputs are omitted, the default values defined in the workflow file are used.\n\n> \\[!NOTE]\n> You can define up to 25  `inputs` for a `workflow_dispatch` event.\n\nFor more information about using the REST API, see [REST API endpoints for workflows](/en/rest/actions/workflows#create-a-workflow-dispatch-event)."}