To get the example to work (i.e. to have one workflow wait for another to complete) you need two files. Both files live in the .github/workflows folder of a repository.

The first file would be set up as usual. This file will be triggered by whatever event(s) are set in the on section:

---
name: Preflight

on:
  - pull_request
  - push

jobs:
  preflight-job:
    name: Preflight Step
    runs-on: ubuntu-latest
    steps:
      - run: env

The second file states that it should only trigger on the workflow_run event for any workflows with the name Preflight and must be on your repository's default branch, usually main or master:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - run: env

This more-or-less the same as the example from the GitHub Actions manual.

As you can see on the actions page of my example repo, the Preflight workflow will run first. After it has completed, the Test workflow will be triggered:

When you try this out, you will find that the Test workflow always runs the code and workflow configuration on your default branch, usually main or master.

This is because, (quoting from the manual):

This event will only trigger a workflow run if the workflow file is on the default branch.

This means you'll need to develop workflows triggered by workflow_run on your default branch, which is a little unfortunate.

This also means that if you need the "Test" workflow to run against the code of your branch or pull request, then you'll need to do more work as described below:

Every actions is run with a set of contexts. The github context holds information about the event that triggered the workflow. This includes the branch that the event was originally triggered from/for: github.event.workflow_run.head_branch.

This can be used to check out the origination branch in the action, using the actions/checkout action provided by GitHub.

To do this, the Yaml would be:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: '${{ github.event.workflow_run.head_repository.full_name }}'
          ref: ${{ github.event.workflow_run.head_branch }}
      - run: git branch
      - run: env
Answer from Potherca on Stack Overflow
Top answer
1 of 1
67

To get the example to work (i.e. to have one workflow wait for another to complete) you need two files. Both files live in the .github/workflows folder of a repository.

The first file would be set up as usual. This file will be triggered by whatever event(s) are set in the on section:

---
name: Preflight

on:
  - pull_request
  - push

jobs:
  preflight-job:
    name: Preflight Step
    runs-on: ubuntu-latest
    steps:
      - run: env

The second file states that it should only trigger on the workflow_run event for any workflows with the name Preflight and must be on your repository's default branch, usually main or master:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - run: env

This more-or-less the same as the example from the GitHub Actions manual.

As you can see on the actions page of my example repo, the Preflight workflow will run first. After it has completed, the Test workflow will be triggered:

When you try this out, you will find that the Test workflow always runs the code and workflow configuration on your default branch, usually main or master.

This is because, (quoting from the manual):

This event will only trigger a workflow run if the workflow file is on the default branch.

This means you'll need to develop workflows triggered by workflow_run on your default branch, which is a little unfortunate.

This also means that if you need the "Test" workflow to run against the code of your branch or pull request, then you'll need to do more work as described below:

Every actions is run with a set of contexts. The github context holds information about the event that triggered the workflow. This includes the branch that the event was originally triggered from/for: github.event.workflow_run.head_branch.

This can be used to check out the origination branch in the action, using the actions/checkout action provided by GitHub.

To do this, the Yaml would be:

---
name: Test

on:
  workflow_run:
    workflows:
      - Preflight
    types:
      - completed

jobs:
  test-job:
    name: Test Step
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: '${{ github.event.workflow_run.head_repository.full_name }}'
          ref: ${{ github.event.workflow_run.head_branch }}
      - run: git branch
      - run: env
🌐
Medium
jiminbyun.medium.com › github-actions-workflow-run-vs-workflow-call-3f1a5c6e19d4
GitHub Actions: workflow_run vs. workflow_call | by Jimin | Medium
October 17, 2023 - # .github/workflows/second_workflow.yml name: Second Workflow on: workflow_run: workflows: ["First Workflow"] types: - completed jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy run: echo "Deploying the project..."
Discussions

Workflow_run completed event triggered by failed workflow
I have a workflow triggered as follows: name: Production deploy on: workflow_run: workflows: ["Stage deploy"] types: - completed I expect that after the stage deploy (which also runs API ... More on github.com
🌐 github.com
14
53
August 18, 2020
How can I pass a variable output from one workflow to another workflow?
To pass the should_build output from your release.yml workflow to your deploy.yml workflow, you can use workflow_run context in the on section of your deploy.yml workflow. Here's how you can do it: name: Deploy on: workflow_run: workflows: ["Release"] types: - completed jobs: deploy: name: deploy if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.outputs.should_build == 'true' runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 # Add your deploy steps here In this deploy.yml workflow, we're using the workflow_run event with the completed type to trigger the workflow whenever the Release workflow completes. We're also checking if the should_build output from the Release workflow is equal to 'true'. If it is, then the deploy job will run. Otherwise, it will be skipped. More on reddit.com
🌐 r/github
6
4
March 15, 2024
🌐
NimblePros
blog.nimblepros.com › blogs › using-workflow-run-in-github-actions
Using `workflow_run` in GitHub Actions | NimblePros Blog
March 1, 2023 - This breaks the build into two workflows: A read-only repo token that runs the build and tests
🌐
GitHub
github.com › orgs › community › discussions › 102876
workflow_run triggered only on success · community · Discussion #102876
Select Topic Area Question Body name: Workflow B on: workflow_dispatch: workflow_run: workflows: ["Workflow A"] types: - completed That triggers "Workflow B" regardless of the result of "Workflow A...
🌐
GitHub
docs.github.com › actions › learn-github-actions › events-that-trigger-workflows
Events that trigger workflows - GitHub Docs
For example, you can run a workflow when a discussion has been created, edited, or answered. on: discussion: types: [created, edited, answered]
🌐
Googlesource
apache.googlesource.com › airflow-get-workflow-origin › + › e3ba776faee1134e17551924b852bfb374e1703d › README.md
Get Workflow Runs action
name: Build on: workflow_run: workflows: ['CI'] types: ['requested'] jobs: get-info: name: "Get information about the source run" runs-on: ubuntu-latest outputs: sourceHeadRepo: ${{ steps.source-run-info.outputs.sourceHeadRepo }} sourceHeadBranch: ${{ steps.source-run-info.outputs.sourceHeadBranch }} sourceHeadSha: ${{ steps.source-run-info.outputs.sourceHeadSha }} mergeCommitSha: ${{ steps.source-run-info.outputs.mergeCommitSha }} targetCommitSha: ${{ steps.source-run-info.outputs.targetCommitSha }} pullRequestNumber: ${{ steps.source-run-info.outputs.pullRequestNumber }} pullRequestLabels: $
🌐
Polpiella
polpiella.dev › github-action-workflows-side-effects
GitHub Actions workflows side effects
April 26, 2023 - Out of the three available types (completed, requested and in_progress), I am only interested in the completed activity type. Specifying the workflow name to trigger on. This is required and in my case, I am only interested in triggering the ...
Find elsewhere
🌐
GitHub
docs.github.com › actions › using-workflows › workflow-syntax-for-github-actions
Workflow syntax for GitHub Actions - GitHub Docs
If you specify multiple activity types, only one of those event activity types needs to occur to trigger your workflow. If multiple triggering event activity types for your workflow occur at the same time, multiple workflow runs will be triggered. For example, the following workflow triggers when an issue is opened or labeled.
🌐
Readthedocs
pygithub.readthedocs.io › en › latest › github_objects › WorkflowRun.html
WorkflowRun — PyGithub 0.1.dev1+g7d1ba281e documentation
:calls “GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs :param _filter: string latest, or all
🌐
Hyperskill
hyperskill.org › learn › step › 31017
Customizing the 'on' Directive: Advanced Event Usage
Hyperskill is an educational platform for learning programming and software development through project-based courses, that helps you secure a job in tech. Master Python, Java, Kotlin, and more with real-world coding challenges.
🌐
Michael Currin
michaelcurrin.github.io › dev-cheatsheets › cheatsheets › ci-cd › github-actions › triggers.html
Triggers | Dev Cheatsheets
name: Manually triggered workflow on: workflow_dispatch: inputs: name: description: 'Person to greet' required: true default: 'Mona the Octocat' home: description: 'location' required: false default: 'The Octoverse' perform_deploy: required: true type: boolean jobs: say-hello: runs-on: ubuntu-latest steps: - name: Greet run: | echo "Hello, ${{ inputs.name }}!" echo "- in ${{ inputs.home }}!" - name: Deploy if: ${{ inputs.perform_deploy }} run: ./build.sh
🌐
GitHub
docs.github.com › en › rest › actions › workflow-runs
REST API endpoints for workflow runs - GitHub Docs
Re-run a job and its dependent jobs in a workflow run. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. This endpoint works with the following fine-grained token types:
🌐
AWS
docs.aws.amazon.com › aws healthomics › user guide › private workflows in healthomics › using healthomics runs › run storage types in healthomics workflows
Run storage types in HealthOmics workflows - AWS HealthOmics
For a given workflow or workflow run, you can choose dynamic or static run storage. By default, HealthOmics provides DYNAMIC run storage. Run storage usage incurs charges to your account. For pricing information about static and dynamic run storage, see HealthOmics pricing ...
🌐
Process Street
process.st › home › articles › workflow runs › running workflows
Running Workflows
July 28, 2025 - Once you’ve selected a workflow, you’ll be prompted to set the workflow run assignee and the due date before you run it. If your workflow has a default run name and due date set, you cannot override it while running the workflow. Without the defaults, you can default it to your workflow name and today’s date.
🌐
Temporal
docs.temporal.io › encyclopedia › workflows
Temporal Workflow | Temporal Platform Documentation
It's an identifier that makes it possible to distinguish one type of Workflow (such as order processing) from another (such as customer onboarding). A Workflow Execution is a running Workflow, which is created by combining a Workflow Definition with a request to execute it.
🌐
Mintlify
mintlify.com › mintlify atlas › mintlify-atlas/docs-atlas-2b16ed10 › getrun
getRun - Workflow DevKit
March 3, 2026 - Type the result: Use getRun<TResult>() for type-safe return values · Handle all error cases: Check for failed, cancelled, and not-found errors · Use streams for real-time updates: Don’t poll status, use streams instead · Store run IDs: Persist run IDs in your database for later retrieval · Check status before actions: Verify workflow ...
🌐
AWS
docs.aws.amazon.com › amazon codecatalyst › user guide › build, test, and deploy with workflows › running a workflow › starting a workflow run automatically using triggers
Starting a workflow run automatically using triggers - Amazon CodeCatalyst
You might want to configure triggers to free your software developers from having to start workflow runs manually through the CodeCatalyst console. You can use three types of trigger: Push – A code push trigger causes a workflow run to start whenever a commit is pushed.