Trigger Specific Workflow with API v2

Hi there,

I’ve read through the API v2 documentation an multiple forum posts but could not find the answer to this. Is it possible to trigger a specific workflow using the API v2?

Let’s say we have the following config.yml file:

version: 2.1
workflows:
  version: 2
  build:
    jobs:
      - job_a
  test:
    jobs:
      - job_b

I’d like to run the test workflow from the API.

Thanks!

this is possible,

Take a look at this repo.

notice how every workflow has a when: param controlled by a pipeline param. You can then use the pipeline param to decide which workflow starts when.

You can use https://beta.swissknife.dev to make testing easier.

2 Likes

Waoh, thanks a lot @roopakv that’s super helpful! :bowing_man:‍♂

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.