How to Use Dynamic Config with a Setup Workflow in CircleCI
A setup workflow runs first, computes a config, and hands it to the continuation orb to run the real pipeline.
Turn on dynamic config, mark the top config as setup: true, and use the path-filtering or continuation orb to emit and run a generated config.
Setup workflow with continuation
The setup config decides what to run, then continues into a generated config.
.circleci/config.yml
version: 2.1
setup: true
orbs:
path-filtering: circleci/path-filtering@1.0.0
workflows:
setup:
jobs:
- path-filtering/filter:
mapping: |
api/.* run-api true
web/.* run-web true
base-revision: main
config-path: .circleci/continue.ymlNotes
- Dynamic config must be enabled in Project Settings > Advanced before setup: true works.
- The mapping sets pipeline parameters that the continuation config reads with when: clauses.
- continue.yml is a normal config that runs as the continuation of the setup workflow.
Related guides
How to Split Tests by Timing in CircleCISplit a test suite across parallel CircleCI containers using circleci tests split with timing data, so each s…
How to Schedule a Nightly Pipeline in CircleCIRun a CircleCI pipeline on a nightly cron with a scheduled trigger, passing pipeline parameters so the schedu…