Skip to content
Latchkey

How to Download an Artifact From a Different Workflow Run in GitHub Actions

actions/download-artifact only sees the current run by default, so pulling output from a separate workflow needs the run id and a token.

Point download-artifact at the source run with run-id and github-token, after locating the run id via the API or a triggering event.

Steps

  • Identify the source workflow run id, often from the triggering event payload.
  • Call actions/download-artifact with run-id and github-token set.
  • Grant the job actions: read permission so it can list artifacts on another run.
  • Use the artifact name to fetch only the file set you need.

Workflow

.github/workflows/consume-artifact.yml
name: Consume Artifact
on:
  workflow_run:
    workflows: ['Build']
    types: [completed]
permissions:
  actions: read
  contents: read
jobs:
  use:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v4
        with:
          name: dist
          run-id: ${{ github.event.workflow_run.id }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - run: ls -la

Notes

  • Without actions: read permission the cross-run download returns 403.
  • Latchkey managed runners chain these dependent workflows cheaper and self-heal between stages.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →