Import BPMN File
Endpoint: POST /api/metadata/workflow-importer/import-bpm
Imports a BPMN file to a Conductor workflow.
Query parameters
| Parameter | Description | Type | Required/ Optional |
|---|---|---|---|
| overwrite | Whether to overwrite the existing definition with the same name. Default is true. Set to false to avoid overwriting an existing definition. | boolean | Optional. |
Request body
| Parameter | Description | Type | Required/ Optional |
|---|---|---|---|
| fileContent | Raw XML content of the BPMN file. This should be the complete BPMN 2.0 XML definition as a string. | string | Required. |
| fileName | The BPMN file name, ending in .bpmn. It becomes the workflow name, without the extension. |
string | Required. |
Response
- Returns 200 OK with a list of the workflow definitions created from the BPMN file, one for each process it contains.
- Returns 500 if a definition with the same name exists and overwrite is set to false.
- Returns 400 if the BPMN file has a circular reference, has multiple start events, uses sequential lanes, or is incomplete.
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-SERVER-URL>/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 with the created workflow definitions.
[
{
"createTime": 1792652202755,
"updateTime": 1792652202937,
"name": "test-workflow",
"description": "test-workflow.bpmn",
"version": 1,
"tasks": [
{
"name": "Process Order",
"taskReferenceName": "Task_1_ref",
"inputParameters": {},
"type": "SIMPLE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false,
"metadata": {}
},
{
"name": "End",
"taskReferenceName": "EndEvent_1_ref",
"inputParameters": {
"terminationStatus": "COMPLETED"
},
"type": "TERMINATE",
"decisionCases": {},
"defaultCase": [],
"forkTasks": [],
"startDelay": 0,
"joinOn": [],
"optional": false,
"defaultExclusiveJoinTask": [],
"asyncComplete": false,
"loopOver": [],
"onStateChange": {},
"permissive": false,
"metadata": {}
}
],
"inputParameters": [],
"outputParameters": {},
"failureWorkflow": "",
"schemaVersion": 2,
"restartable": true,
"workflowStatusListenerEnabled": false,
"ownerEmail": "john.doe@acme.com",
"timeoutPolicy": "ALERT_ONLY",
"timeoutSeconds": 0,
"variables": {},
"inputTemplate": {},
"enforceSchema": true,
"metadata": {},
"maskedFields": [],
"overwriteTags": true,
"tags": []
}
]