"Path-filtering": running multiple jobs with a path-filtering/filter for git branch

I have a task to run a process for different branches when files in a folder are changed. In the same branch, I need to run several path-filtering processes at the same time, and each one only after approval.
The following piece of code from config.yml will help to understand the task:

workflows:
  commit:
    jobs:
      - path-filtering/filter:
          name: production cloudwatch-agent reconfigure
          requires:
              - approve-production
          mapping: |
              .circleci/amazon-cloudwatch-agent/.* run-production-reconfigure true
          base-revision: production
          config-path: .circleci/continue_config.yml
      - path-filtering/filter:
          name: production-worker cloudwatch-agent reconfigure
          requires:
              - approve-production-worker
          mapping: |
              .circleci/amazon-cloudwatch-agent/.* run-production-worker-reconfigure true
          base-revision: production
          config-path: .circleci/continue_config.yml

At the moment I get a crash: “message”: “Pipeline is not in setup state” for any of the jobs (the one that ran first, the one without errors)

1 Like

I’m facing this issue as well. Seems you can’t filter multiple at all. What good is that!?

do you have setup: true in your config and dynamic config enabled in project settings under Advanced?

Hi,

When using setup workflows, you will only be able to use the continuation api once per pipeline. It is fine to have multiple path-filtering commands in one workflow, but you would have to ensure that only one fires based on some sort of condition.

This is another example where dynamic continuation will probably help. Basically runs a YAML reduce after deciding what CI configs to run based on file changes in corresponding directories/paths. Gets around the one continuation call per pipeline limitation.