Skip to content
Latchkey

How to Schedule a Nightly Pipeline in CircleCI

Scheduled pipelines fire on a cron and can set pipeline parameters to branch the config.

Define a scheduled trigger that sets a parameter like run_nightly, then guard heavy jobs with a when: clause that reads it.

Parameter-driven nightly run

A pipeline parameter set by the schedule selects the nightly workflow.

.circleci/config.yml
version: 2.1
parameters:
  run_nightly:
    type: boolean
    default: false
workflows:
  nightly:
    when: << pipeline.parameters.run_nightly >>
    jobs:
      - full-regression

Notes

  • Create the schedule in Project Settings > Triggers and have it set run_nightly: true.
  • Scheduled pipelines replaced the deprecated cron under the legacy triggers key.
  • Keep the default false so normal pushes skip the nightly-only workflow.

Related guides

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