{"record":{"id":"7e89f98578ab5858","repo":"flowable/flowable-engine","slug":"the-deployment-contains-process-definitions-with-t","errorCode":null,"errorMessage":"The deployment contains process definitions with the same key '<key>' (process id attribute), this is not allowed","messagePattern":"The deployment contains process definitions with the same key '<key>' \\(process id attribute\\), this is not allowed","errorType":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/deployer/BpmnDeploymentHelper.java","lineNumber":69,"sourceCode":"import org.flowable.variable.service.impl.el.NoExecutionVariableScope;\n\n/**\n * Methods for working with deployments. Much of the actual work of {@link BpmnDeployer} is done by orchestrating the different pieces of work this class does; by having them here, we allow other\n * deployers to make use of them.\n */\npublic class BpmnDeploymentHelper {\n\n    /**\n     * Verifies that no two process definitions share the same key, to prevent database unique index violation.\n     * \n     * @throws FlowableException\n     *             if any two processes have the same key\n     */\n    public void verifyProcessDefinitionsDoNotShareKeys(Collection<ProcessDefinitionEntity> processDefinitions) {\n        Set<String> keySet = new LinkedHashSet<>();\n        for (ProcessDefinitionEntity processDefinition : processDefinitions) {\n            if (keySet.contains(processDefinition.getKey())) {\n                throw new FlowableException(\n                        \"The deployment contains process definitions with the same key '\" + processDefinition.getKey() + \"' (process id attribute), this is not allowed\");\n            }\n            keySet.add(processDefinition.getKey());\n        }\n    }\n\n    /**\n     * Updates all the process definition entities to match the deployment's values for tenant, engine version, and deployment id.\n     */\n    public void copyDeploymentValuesToProcessDefinitions(DeploymentEntity deployment,\n            List<ProcessDefinitionEntity> processDefinitions) {\n        String engineVersion = deployment.getEngineVersion();\n        String tenantId = deployment.getTenantId();\n        String deploymentId = deployment.getId();\n\n        for (ProcessDefinitionEntity processDefinition : processDefinitions) {\n\n            // Backwards compatibility","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/deployer/BpmnDeploymentHelper.java#L51-L87","documentation":"During deployment, BpmnDeploymentHelper.verifyProcessDefinitionsDoNotShareKeys checks that all process definitions in one deployment have unique keys (the process id attribute in BPMN XML). A duplicate key makes auto-generated activity/definition identifiers ambiguous, so Flowable refuses the deployment with this FlowableException.","triggerScenarios":"Deploying a bar/zip (or batch deployment) containing two or more BPMN files whose <process id=\"...\"> attribute has the same value. Hit during RepositoryService.createDeployment().deploy().","commonSituations":"Copying a BPMN file into a deployment archive without renaming the process id; zip deployments bundling multiple copies of the same diagram; build scripts aggregating resources from several modules that share a process id.","solutions":["Give each <process> element in the deployment a unique id attribute","Remove duplicate BPMN files from the deployment archive","If the same process must appear twice, differentiate keys and rely on process versioning for new versions","Search the deployment resources for the offending key before deploying to catch it early"],"exampleFix":"<!-- before: two files both contain -->\n<process id=\"orderProcess\" ...>\n\n<!-- after: rename in one file -->\n<process id=\"refundProcess\" ...>","handlingStrategy":"validation","validationCode":"Set<String> keys = new HashSet<>();\nfor (String res : deploymentResources) {\n    String id = extractProcessId(res); // parse <process id=\"...\">\n    if (!keys.add(id)) {\n        throw new IllegalArgumentException(\"Duplicate process key in deployment: \" + id);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enforce unique <process id> values via CI checks over all BPMN resources","Avoid copying BPMN files into archives without renaming the process id","Review zip/bar contents before RepositoryService.deploy()"],"tags":["deployment","bpmn","duplicate-key","process-definition"],"backgroundTag":"conflicting-config-options","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}