Back to Conductor

Bulk Operations API

docs/documentation/api/bulk.md

2019-04-12-13004.6 KB
Original Source

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

EndpointMethodDescription
/bulk/pausePUTPause multiple workflows
/bulk/resumePUTResume multiple paused workflows
/bulk/restartPOSTRestart multiple completed workflows
/bulk/retryPOSTRetry the last failed task in multiple workflows
/bulk/terminatePOSTTerminate multiple running workflows
/bulk/removeDELETERemove multiple workflows from the system
/bulk/terminate-removeDELETETerminate and remove multiple workflows
/bulk/searchPOSTSearch/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
ParameterDescriptionDefault
useLatestDefinitionsUse latest workflow and task definitionsfalse
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=
ParameterDescriptionRequired
reasonReason for terminationNo
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
ParameterDescriptionDefault
archiveWorkflowArchive before removingtrue
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.

ParameterDescriptionDefault
reasonReason for termination
archiveWorkflowArchive before removingtrue
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.

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.

ParameterDescriptionDefault
includeTasksInclude task detailstrue
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.