Skip to content
Latchkey

GitHub Actions Download an Artifact From a Different Workflow Run

An artifact uploaded by one workflow run is not found by a different run because actions/download-artifact defaults to the current run. To fetch across runs you must pass run-id and a github-token with access.

What this error means

A download-artifact step in a separate run (often a workflow_run-triggered one) fails to find the artifact, because it looked in the current run’s artifacts instead of the producing run’s.

Actions log
- uses: actions/download-artifact@v4
  with:
    name: build-output
# Error: Unable to find any artifacts for the associated workflow run

Diagnose it: was the cache hit, and was it the right one?

Cache bugs split into three shapes and they need different fixes: the cache never saved, it saved but the key never matches on restore, or it restored a stale entry through a restore-keys prefix and is now poisoning the build. The step output tells you which one you have.

.github/workflows/ci.yml
- uses: actions/cache@v4
  id: cache
  with:
    path: ~/.npm
    key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-npm-

- name: What happened
  run: |
    echo "exact hit: ${{ steps.cache.outputs.cache-hit }}"
    echo "key used:  ${{ steps.cache.outputs.cache-matched-key }}"

Common causes

Default scope is the current run

download-artifact looks at the current run’s artifacts unless told otherwise. An artifact from another run is not visible without run-id.

Missing run-id or token

Cross-run download needs the producing run’s id and a github-token with actions:read so the action can fetch it.

How to fix it

Pass run-id and a token

Provide the source run id (e.g. from the workflow_run event) and a token with read access.

.github/workflows/deploy.yml
- uses: actions/download-artifact@v4
  with:
    name: build-output
    run-id: ${{ github.event.workflow_run.id }}
    github-token: ${{ secrets.GITHUB_TOKEN }}
permissions:
  actions: read

Confirm the artifact and access

  1. Check the artifact still exists and has not passed its retention window.
  2. Grant actions: read so the token can list and download cross-run artifacts.
  3. For cross-repo downloads, use a token with access to the source repository.

Cache limits that produce confusing failures

  • Repository cache is capped at 10 GB. Past that, GitHub evicts least-recently-used entries, so a large cache can silently stop persisting.
  • Caches are scoped by branch. A cache written on a feature branch is not visible to another feature branch, only to its base and its own descendants.
  • An entry not read for 7 days is evicted, so a rarely-run workflow effectively never has a warm cache.
  • Restoring a cache built for a different tool version is worse than a cold start, because you get a corrupted tree instead of a clean install. Always include the tool version in the key.

How to prevent it

  • Pass run-id and github-token when downloading across runs.
  • Grant actions: read for cross-run artifact access.
  • Mind artifact retention so the source artifact still exists.

Frequently asked questions

What causes GitHub Actions download an artifact from a different workflow run?
There are 2 common causes: default scope is the current run and missing run-id or token. download-artifact looks at the current run’s artifacts unless told otherwise.
How do I fix GitHub Actions download an artifact from a different workflow run?
There are 2 fixes depending on which cause you have: pass run-id and a token and confirm the artifact and access. Work through them in order, since the first is the most common.
What does GitHub Actions download an artifact from a different workflow run actually mean?
A download-artifact step in a separate run (often a workflow_run-triggered one) fails to find the artifact, because it looked in the current run’s artifacts instead of the producing run’s.
How do I stop GitHub Actions download an artifact from a different workflow run happening again?
Pass run-id and github-token when downloading across runs. The prevention section lists 3 changes that keep it from recurring.

Related guides

References

Not every red build is your code. Latchkey repairs the ones that are not, on the runner. Start free → 30-day trial · No credit card