Skip to content
Latchkey

Schedule plus concurrency cancelling scheduled runs in CI

A concurrency group with cancel-in-progress: true cancels older runs in the same group. If your scheduled workflow shares a group key with push runs, a push can cancel the nightly job (or the schedule can cancel a deploy).

What this error means

Scheduled runs show as "Canceled" shortly after starting, and the cancellation coincides with a push or another run that shares the same concurrency group.

.github/workflows/nightly.yml
concurrency:
  group: deploy   # shared by push AND schedule
  cancel-in-progress: true
# A push to main cancels the in-progress nightly run in group "deploy".

Common causes

A shared concurrency group across triggers

When push and schedule use the same static group key, cancel-in-progress lets one cancel the other.

cancel-in-progress on a job that should complete

A nightly job that must finish should not be cancellable by newer runs in the same group.

How to fix it

Scope the concurrency group per event

  1. Include the event name or run id in the group key.
  2. Disable cancel-in-progress for jobs that must complete.
  3. Verify pushes no longer cancel scheduled runs.
.github/workflows/nightly.yml
concurrency:
  group: ${{ github.workflow }}-${{ github.event_name }}
  cancel-in-progress: false

Separate schedule and push groups

Give scheduled runs their own group so push activity cannot cancel them.

.github/workflows/nightly.yml
concurrency:
  group: nightly-only
  cancel-in-progress: false

How to prevent it

  • Include the trigger in the concurrency group key.
  • Only use cancel-in-progress where cancellation is safe.
  • Keep scheduled deploy jobs in a dedicated group.

Related guides

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