Skip to content
Latchkey

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.yml

Notes

  • 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

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