Use the cloudbees-io/workflows-dispatch action to trigger multiple workflows from a single workflow step, either in parallel or sequentially.
This is useful in release orchestration scenarios where a release stage must coordinate multiple independent deployment workflows across components or environments.
| All CloudBees action repositories are listed at CloudBees, Inc. on GitHub. |
| Before using this action, you must generate a personal access token in CloudBees Unify. All workflows to be dispatched must be manually triggered workflows. Refer to Configure workflow credentials for token configuration guidance. |
Configure the dispatch action
Add the cloudbees-io/workflows-dispatch action to a workflow step and point it to a JSON file that lists the workflows to dispatch.
YAML step inputs
The following inputs configure the dispatch action in your workflow YAML:
| Input name | Data type | Required | Description |
|---|---|---|---|
|
String |
Yes |
Path to the JSON file containing workflow dispatch requests. |
|
String |
Yes |
Authorization token to authenticate workflow dispatch requests. CloudBees recommends passing the token as a secret reference. |
|
String |
No |
Whether to dispatch all workflows in parallel or sequentially.
Supported values: |
|
Boolean |
No |
Whether to wait for workflow executions to complete.
Defaults to |
JSON dispatch file inputs
The dispatch file is a JSON array where each entry specifies a workflow to trigger:
| Field | Data type | Required | Description |
|---|---|---|---|
|
String |
Yes |
The name of the workflow file to dispatch. |
|
String |
No |
The branch containing the workflow to dispatch. Defaults to the same branch as the caller workflow. |
|
String |
No |
The ID of the component containing the manually triggered workflow (located in CloudBees Unify URL after |
|
Object |
No |
Input parameters to pass when dispatching the workflow. Represented as key-value pairs where keys and values are both strings. |
|
Boolean |
No |
Whether to ignore workflow trigger or execution failures.
Defaults to |
Understand execution behavior
The combination of execution-mode and wait-for-completion controls how the action handles dispatch and failure:
| When the following inputs are specified: | The following results are observed: | |
|---|---|---|
|
|
|
|
|
The action triggers all workflows in parallel.
Once triggered, the action step passes regardless of any failures.
The |
|
|
The action triggers all workflows in parallel and waits for all triggered runs to complete.
If all runs are successful, the action step passes.
If a dispatched workflow fails and has |
|
|
The action triggers each workflow sequentially: as soon as one run completes, the next is triggered.
If all runs are successful, the action step passes.
If a dispatched workflow fails and has |
[1] The wait-for-completion parameter is always considered true when execution-mode: serial is set.
Usage examples
Dispatch workflows with default settings
The following example uses the default settings (execution-mode: parallel, wait-for-completion: false):
- name: Dispatch workflows uses: cloudbees-io/workflows-dispatch@v1 with: workflows-dispatch-file: dispatch_requests.json token: "${{ secrets.TOKEN }}"
The dispatch_requests.json file for the above:
[ { "workflow_file_name": "workflow-1.yaml" }, { "workflow_file_name": "workflow-2.yaml" } ]
Await completion of all dispatched workflows
The following example executes workflows in parallel and waits for all to complete:
- name: Dispatch workflows and wait for completion uses: cloudbees-io/workflows-dispatch@v1 with: workflows-dispatch-file: dispatch_requests.json token: "${{ secrets.TOKEN }}" execution-mode: "parallel" wait-for-completion: true
The dispatch_requests.json file for the above, including inputs and cross-component dispatch:
[ { "workflow_file_name": "workflow-1.yaml", "inputs": { "testkey1": "value", "testkey2": "50" } }, { "component_id": "abcdef90-1234-5678-9abc-defab1234567", "branch_name": "branch-2", "workflow_file_name": "workflow-2.yaml" } ]
Dispatch workflows sequentially with selective failure handling
The following example executes workflows sequentially and ignores failures for one but not the other:
- name: Dispatch workflows sequentially and ignore failures uses: cloudbees-io/workflows-dispatch@v1 with: workflows-dispatch-file: dispatch_requests.json token: "${{ secrets.TOKEN }}" execution-mode: "serial"
The dispatch_requests.json file for the above:
[ { "component_id": "12345678-9abc-de12-a123-456789abcdef", "branch_name": "branch-1", "workflow_file_name": "workflow-1.yaml", "inputs": { "testkey1": "value", "testkey2": "50" }, "ignore_failures": true }, { "component_id": "abcdef34-1234-5678-9abc-def341234567", "branch_name": "branch-2", "workflow_file_name": "workflow-2.yaml", "ignore_failures": false } ]
In the above example, workflow-2 is executed regardless of whether workflow-1 has failed.
If workflow-2 completes successfully, the action step passes.
If workflow-2 fails, the action step fails.