{"record":{"id":"71ce0074857c6922","repo":"flowable/flowable-engine","slug":"cannot-query-external-jobs-there-is-no-bpmn-or-cm","errorCode":null,"errorMessage":"Cannot query external jobs. There is no BPMN or CMMN engine available","messagePattern":"Cannot query external jobs\\. There is no BPMN or CMMN engine available","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/ExternalWorkerJobBaseResource.java","lineNumber":38,"sourceCode":"import org.flowable.job.api.ExternalWorkerJobQuery;\nimport org.springframework.beans.factory.annotation.Autowired;\n\n/**\n * @author Filip Hrisafov\n */\npublic class ExternalWorkerJobBaseResource {\n\n    protected ManagementService managementService;\n    protected CmmnManagementService cmmnManagementService;\n    protected ExternalWorkerJobRestApiInterceptor restApiInterceptor;\n\n    protected ExternalWorkerJobQuery createExternalWorkerJobQuery() {\n        if (managementService != null) {\n            return managementService.createExternalWorkerJobQuery();\n        } else if (cmmnManagementService != null) {\n            return cmmnManagementService.createExternalWorkerJobQuery();\n        } else {\n            throw new FlowableException(\"Cannot query external jobs. There is no BPMN or CMMN engine available\");\n        }\n    }\n\n    protected ExternalWorkerJob getExternalWorkerJobById(String jobId) {\n        ExternalWorkerJob job = createExternalWorkerJobQuery().jobId(jobId).singleResult();\n        if (job == null) {\n            throw new FlowableObjectNotFoundException(\"Could not find external worker job with id '\" + jobId + \"'.\", ExternalWorkerJob.class);\n        }\n\n        if (restApiInterceptor != null) {\n            restApiInterceptor.accessExternalWorkerJobById(job);\n        }\n\n        return job;\n    }\n\n    @Autowired(required = false)\n    public void setManagementService(ManagementService managementService) {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-external-job-rest/src/main/java/org/flowable/external/job/rest/service/api/ExternalWorkerJobBaseResource.java#L20-L56","documentation":"Thrown by ExternalWorkerJobBaseResource.createExternalWorkerJobQuery when neither the BPMN ManagementService nor the CMMN ManagementService is injected into the REST module. External worker jobs live in one of the two engines, so without any engine bean there is no way to build an ExternalWorkerJobQuery. This is a server-side configuration problem, not a client mistake.","triggerScenarios":"Calling any external worker job REST query endpoint (e.g. GET /external-worker/jobs or GET /external-worker/jobs/{jobId}) when the flowable-external-job-rest module is deployed with both managementService and cmmnManagementService left null (no BPMN engine and no CMMN engine configured).","commonSituations":"Standalone deployment of the external-job REST app without wiring engine beans; Spring configuration that excludes both ProcessEngine and CmmnEngine auto-configuration; copying only the REST module into a custom service without providing engine dependencies; intentional engine-less usage of the REST endpoints.","solutions":["Configure and inject a BPMN engine (ProcessEngine / Spring ProcessEngineAutoConfiguration) so managementService is non-null.","Alternatively configure a CMMN engine so cmmnManagementService is non-null.","Verify the external-job REST app is deployed alongside an engine, not as a bare standalone WAR/jar.","Check Spring bean configuration/profiles that may be excluding the engine auto-configurations."],"exampleFix":"// before: external-job REST app with no engine beans -> both services null\n// after (Spring Boot)\n@SpringBootApplication\npublic class ExternalJobApp {}\n// pulls in ProcessEngineAutoConfiguration, injecting managementService\n// or explicitly:\n@Bean\npublic ManagementService managementService(ProcessEngine processEngine) {\n    return processEngine.getManagementService();\n}","handlingStrategy":"validation","validationCode":"// deployment-time check: at least one engine is wired\nassert managementService != null || cmmnManagementService != null\n    : \"external-job REST module requires a BPMN or CMMN engine\";","typeGuard":null,"tryCatchPattern":"try {\n    restTemplate.getForEntity(\"/external-worker/jobs\", ...);\n} catch (HttpServerErrorException e) {\n    log.error(\"External job REST app has no engine configured\", e);\n}","preventionTips":["Deploy the external-job REST module only together with at least one engine.","Add a startup health check that queries one job endpoint and fails fast.","Verify Spring auto-configuration for the engine is not excluded."],"tags":["rest","bpmn","cmmn","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"}