Skip to main content

Import BPMN to Workflows

Endpoint: POST /api/metadata/workflow-importer/import-bpm

Imports a BPMN file to a Conductor workflow.

Query parameters

ParameterDescriptionTypeRequired/ Optional
overwriteWhether to overwrite the existing definition with the same name. Default is true. Set to false to avoid overwriting an existing definition.booleanOptional.

Request body

ParameterDescriptionTypeRequired/ Optional
fileContentRaw XML content of the BPMN file. This should be the complete BPMN 2.0 XML definition as a string.stringRequired.
fileNameName of the BPMN file being imported. Must end with .bpmn.stringRequired.

Response

  • Returns 200 OK, indicating that the BPMN file has been imported successfully.
  • Returns 500 if a definition with the same name exists and overwrite is set to false.

Example Error Response (500)

When a workflow already exists with a different checksum and overwrite is false:

{
"status": 500,
"message": "Workflow test-workflow version 1 already exists with a different checksum, set overwrite=true to overwrite",
"instance": "orkes-conductor-deployment-b7589d675-g5lvb",
"retryable": true
}

Examples

Import a BPMN to workflow

Request

curl -X 'POST' \
'https://<YOUR-CLUSTER>/api/metadata/workflow-importer/import-bpm?overwrite=true' \
-H 'accept: */*' \
-H 'X-Authorization: <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"fileContent": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bpmn:definitions xmlns:bpmn=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" id=\"Definitions_1\" targetNamespace=\"http://bpmn.io/schema/bpmn\">\n <bpmn:process id=\"Process_1\" isExecutable=\"true\">\n <bpmn:startEvent id=\"StartEvent_1\" name=\"Start\">\n <bpmn:outgoing>Flow_1</bpmn:outgoing>\n </bpmn:startEvent>\n <bpmn:task id=\"Task_1\" name=\"Process Order\">\n <bpmn:incoming>Flow_1</bpmn:incoming>\n <bpmn:outgoing>Flow_2</bpmn:outgoing>\n </bpmn:task>\n <bpmn:endEvent id=\"EndEvent_1\" name=\"End\">\n <bpmn:incoming>Flow_2</bpmn:incoming>\n </bpmn:endEvent>\n <bpmn:sequenceFlow id=\"Flow_1\" sourceRef=\"StartEvent_1\" targetRef=\"Task_1\" />\n <bpmn:sequenceFlow id=\"Flow_2\" sourceRef=\"Task_1\" targetRef=\"EndEvent_1\" />\n </bpmn:process>\n</bpmn:definitions>",
"fileName": "test-workflow.bpmn"
}'

Response

Returns 200 OK, indicating that the BPMN file has been imported successfully.