Skip to content
Latchkey

GitHub Actions "job matrix exceeds 256 entries"

A single job matrix is limited to 256 entries after expansion. The cross-product of several dimensions grows quickly and can blow past the cap. This is a deterministic limit.

What this error means

The workflow fails to start because a matrix expands to more than 256 combinations.

github-actions
Error: Matrix vector 'include' exceeds maximum of 256 jobs.

Common causes

Cross-product too large

Multiple matrix dimensions multiply into more than 256 combinations.

Generated matrix unbounded

A matrix built from fromJSON of generated data produces too many entries.

How to fix it

Shrink the matrix

  1. Reduce dimensions or use exclude to drop unneeded combinations.
  2. Use include to enumerate only the combinations you need.
  3. For generated matrices, cap the number of entries when building the JSON.
.github/workflows/ci.yml
strategy:
  matrix:
    os: [ubuntu-latest, macos-latest]
    node: [18, 20]
    exclude:
      - { os: macos-latest, node: 18 }

How to prevent it

  • Keep matrix expansion under 256 entries.
  • Trim the cross-product with include/exclude.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →