{"record":{"id":"4680095cf27b90d3","repo":"flowable/flowable-engine","slug":"cannot-complete-bpmn-job-there-is-no-bpmn-engine","errorCode":null,"errorMessage":"Cannot complete BPMN job. There is no BPMN engine available","messagePattern":"Cannot complete BPMN job\\. There is no BPMN engine available","errorType":"exception","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/acquire/ExternalWorkerAcquireJobResource.java","lineNumber":123,"sourceCode":"        }\n\n        ExternalWorkerJob job = getExternalWorkerJobById(jobId);\n\n        if (!workerId.equals(job.getLockOwner())) {\n            throw new FlowableForbiddenException(workerId + \" does not hold a lock on the requested job\");\n        }\n\n        if (job.getProcessInstanceId() != null) {\n            if (managementService != null) {\n                if (restApiInterceptor != null) {\n                    restApiInterceptor.completeExternalWorkerJob(job, request);\n                }\n\n                managementService.createExternalWorkerCompletionBuilder(job.getId(), workerId)\n                        .variables(extractVariables(request.getVariables()))\n                        .complete();\n            } else {\n                throw new FlowableException(\"Cannot complete BPMN job. There is no BPMN engine available\");\n            }\n        } else if (ScopeTypes.CMMN.equals(job.getScopeType())) {\n            if (cmmnManagementService != null) {\n                if (restApiInterceptor != null) {\n                    restApiInterceptor.completeExternalWorkerJob(job, request);\n                }\n\n                cmmnManagementService.createCmmnExternalWorkerTransitionBuilder(job.getId(), workerId)\n                        .variables(extractVariables(request.getVariables()))\n                        .complete();\n            } else {\n                throw new FlowableException(\"Cannot complete CMMN job. There is no CMMN engine available\");\n            }\n        } else {\n            throw new FlowableIllegalArgumentException(\n                    \"Can only complete BPMN or CMMN external job. Job with id '\" + jobId + \"' is from scope '\" + job.getScopeType() + \"'\");\n        }\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/acquire/ExternalWorkerAcquireJobResource.java#L105-L141","documentation":"FlowableException thrown in completeJob when the job belongs to a BPMN process instance but the BPMN managementService is null, so createExternalWorkerCompletionBuilder cannot be invoked. The REST module needs the BPMN engine wired to complete BPMN-scoped external jobs. Results in HTTP 500.","triggerScenarios":"Completing an external worker job whose scopeType is BPMN while only the CMMN engine (or no engine) is injected into the external-job REST module.","commonSituations":"Deployment that only wires CmmnEngineConfiguration into the REST app yet also serves BPMN-created external jobs; engine beans conditionally disabled by profile; standalone external-job REST app missing process engine dependency.","solutions":["Wire the BPMN engine so managementService is injected into ExternalWorkerAcquireJobResource.","Enable the ProcessEngine auto-configuration in the REST app's Spring context.","Add the flowable-engine dependency if it was excluded.","Route BPMN job completion to a REST instance that has the BPMN engine configured."],"exampleFix":"// before: only CMMN engine configured -> managementService null\n@Bean\npublic CmmnEngine cmmnEngine() { ... }\n// after\n@Bean\npublic ProcessEngine processEngine(ProcessEngineConfiguration cfg) { return cfg.buildProcessEngine(); }\n// managementService now available for BPMN job completion","handlingStrategy":"validation","validationCode":"// deployment-time assertion\nassert managementService != null : \"BPMN managementService required to complete BPMN external jobs\";","typeGuard":null,"tryCatchPattern":"try {\n    restClient.complete(jobId, request);\n} catch (HttpServerErrorException.InternalServerError e) {\n    log.error(\"REST app lacks BPMN engine for this job\", e);\n}","preventionTips":["Enable ProcessEngine auto-configuration in the external-job REST app.","Include flowable-engine dependency wherever external job completion is served.","Health-check a BPMN job completion path at deploy time."],"tags":["rest","bpmn","configuration","external-worker"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}