Files
wehub-resource-sync a9cd7750f4
CI / unit-test (push) Has been cancelled
CI / detect-changes (push) Has been cancelled
CI / build (push) Has been cancelled
Publish docs via GitHub Pages / Deploy docs (push) Has been cancelled
CI / test-harness (push) Has been cancelled
CI / generate-e2e-matrix (push) Has been cancelled
CI / e2e (push) Has been cancelled
CI / build-ui (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
UI v2 Integration CI / E2E (Integration) (push) Has been cancelled
UI v2 CI / Lint, Format & Test (push) Has been cancelled
UI v2 CI / E2E (Mocked) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:37:56 +08:00

185 lines
4.8 KiB
Markdown

---
description: "Conductor Bulk Operations API — pause, resume, restart, retry, terminate, remove, and search workflows in batch."
---
# Bulk Operations API
The Bulk Operations API lets you perform workflow management operations on multiple workflows in a single request. All endpoints use the base path `/api/workflow/bulk`.
Every endpoint accepts a list of workflow IDs in the request body and returns a `BulkResponse`:
```json
{
"bulkSuccessfulResults": ["workflow-id-1", "workflow-id-2"],
"bulkErrorResults": {
"workflow-id-3": "Workflow is not in a running state"
}
}
```
Operations are **best-effort** — each workflow is processed independently. If one fails, the rest still proceed.
## Endpoints
| Endpoint | Method | Description |
|---|---|---|
| `/bulk/pause` | `PUT` | Pause multiple workflows |
| `/bulk/resume` | `PUT` | Resume multiple paused workflows |
| `/bulk/restart` | `POST` | Restart multiple completed workflows |
| `/bulk/retry` | `POST` | Retry the last failed task in multiple workflows |
| `/bulk/terminate` | `POST` | Terminate multiple running workflows |
| `/bulk/remove` | `DELETE` | Remove multiple workflows from the system |
| `/bulk/terminate-remove` | `DELETE` | Terminate and remove multiple workflows |
| `/bulk/search` | `POST` | Search/fetch multiple workflows by ID |
### Bulk Pause
```
PUT /api/workflow/bulk/pause
```
```shell
curl -X PUT 'http://localhost:8080/api/workflow/bulk/pause' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2", "workflow-id-3"]'
```
**Response** `200 OK`
```json
{
"bulkSuccessfulResults": ["workflow-id-1", "workflow-id-2"],
"bulkErrorResults": {
"workflow-id-3": "Workflow is already paused"
}
}
```
### Bulk Resume
```
PUT /api/workflow/bulk/resume
```
```shell
curl -X PUT 'http://localhost:8080/api/workflow/bulk/resume' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2"]'
```
**Response** `200 OK` — returns a `BulkResponse`.
### Bulk Restart
```
POST /api/workflow/bulk/restart?useLatestDefinitions=false
```
| Parameter | Description | Default |
|---|---|---|
| `useLatestDefinitions` | Use latest workflow and task definitions | `false` |
```shell
curl -X POST 'http://localhost:8080/api/workflow/bulk/restart?useLatestDefinitions=true' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2"]'
```
**Response** `200 OK` — returns a `BulkResponse`.
### Bulk Retry
```
POST /api/workflow/bulk/retry
```
Retries the last failed task for each workflow.
```shell
curl -X POST 'http://localhost:8080/api/workflow/bulk/retry' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2"]'
```
**Response** `200 OK` — returns a `BulkResponse`.
### Bulk Terminate
```
POST /api/workflow/bulk/terminate?reason=
```
| Parameter | Description | Required |
|---|---|---|
| `reason` | Reason for termination | No |
```shell
curl -X POST 'http://localhost:8080/api/workflow/bulk/terminate?reason=batch+cleanup' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2", "workflow-id-3"]'
```
**Response** `200 OK` — returns a `BulkResponse`.
### Bulk Remove
```
DELETE /api/workflow/bulk/remove?archiveWorkflow=true
```
| Parameter | Description | Default |
|---|---|---|
| `archiveWorkflow` | Archive before removing | `true` |
```shell
curl -X DELETE 'http://localhost:8080/api/workflow/bulk/remove' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2"]'
```
!!! warning
This permanently removes workflow execution data.
**Response** `200 OK` — returns a `BulkResponse`.
### Bulk Terminate and Remove
```
DELETE /api/workflow/bulk/terminate-remove?reason=&archiveWorkflow=true
```
Terminates running workflows and removes them in one call.
| Parameter | Description | Default |
|---|---|---|
| `reason` | Reason for termination | — |
| `archiveWorkflow` | Archive before removing | `true` |
```shell
curl -X DELETE 'http://localhost:8080/api/workflow/bulk/terminate-remove?reason=decommissioned' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2"]'
```
**Response** `200 OK` — returns a `BulkResponse`.
### Bulk Search
```
POST /api/workflow/bulk/search?includeTasks=true
```
Fetches multiple workflows by their IDs in a single call. Unlike the other bulk endpoints, this returns workflow objects rather than a `BulkResponse`.
| Parameter | Description | Default |
|---|---|---|
| `includeTasks` | Include task details | `true` |
```shell
curl -X POST 'http://localhost:8080/api/workflow/bulk/search?includeTasks=false' \
-H 'Content-Type: application/json' \
-d '["workflow-id-1", "workflow-id-2"]'
```
**Response** `200 OK` — returns a `BulkResponse` where `bulkSuccessfulResults` contains the full workflow objects.