{"record":{"id":"d2b18674166ba12e","repo":"flowable/flowable-engine","slug":"identityservice-is-missing-and-must-be-provided-to","errorCode":null,"errorMessage":"IdentityService is missing and must be provided to set process initiator.","messagePattern":"IdentityService is missing and must be provided to set process initiator\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-camel/src/main/java/org/flowable/camel/FlowableProducer.java","lineNumber":192,"sourceCode":"                setProcessInitiator(ExchangeUtils.prepareInitiator(exchange, endpoint));\n            }\n\n            if (key == null) {\n                return runtimeService.startProcessInstanceByKey(processKey, ExchangeUtils.prepareVariables(exchange, endpoint));\n            } else {\n                return runtimeService.startProcessInstanceByKey(processKey, key, ExchangeUtils.prepareVariables(exchange, endpoint));\n            }\n\n        } finally {\n            if (endpoint.isSetProcessInitiator()) {\n                setProcessInitiator(null);\n            }\n        }\n    }\n\n    protected void setProcessInitiator(String processInitiator) {\n        if (identityService == null) {\n            throw new FlowableException(\"IdentityService is missing and must be provided to set process initiator.\");\n        }\n        identityService.setAuthenticatedUserId(processInitiator);\n    }\n\n    protected FlowableEndpoint getFlowableEndpoint() {\n        return (FlowableEndpoint) getEndpoint();\n    }\n\n    public void setIdentityService(IdentityService identityService) {\n        this.identityService = identityService;\n    }\n\n    public void setRuntimeService(RuntimeService runtimeService) {\n        this.runtimeService = runtimeService;\n    }\n\n    public void setRepositoryService(RepositoryService repositoryService) {\n        this.repositoryService = repositoryService;","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-camel/src/main/java/org/flowable/camel/FlowableProducer.java#L174-L210","documentation":"FlowableProducer.setProcessInitiator calls identityService.setAuthenticatedUserId(...) to record who started the process. Flowable throws this FlowableException when an initiator is requested but the producer's IdentityService was never injected, because the Camel module only wires it up when explicitly configured.","triggerScenarios":"Sending an exchange that includes the process initiator header/property (so startProcess calls setProcessInitiator) while the FlowableProducer/CamelEndpoint was created without an IdentityService (processEngineConfiguration identityService not provided to the camel component).","commonSituations":"Camel component built manually without setIdentityService(); using a minimal ProcessEngineConfiguration where identity service is not registered; wiring the camel component in tests with a stub engine lacking the identity service.","solutions":["Provide the engine's IdentityService to the Camel component: flowableComponent.setIdentityService(processEngine.getIdentityService()).","Ensure the underlying process engine configuration exposes an identityService (default Flowable configurations do).","If initiator tracking is unnecessary, remove the initiator header/property from the exchange instead of leaving it empty.","In Spring, use the flowable:camel component bean that receives identityService via configuration so it is auto-wired."],"exampleFix":"// before\nFlowableComponent component = new FlowableComponent(); // identityService missing\n// after\nFlowableComponent component = new FlowableComponent();\ncomponent.setIdentityService(processEngine.getIdentityService());","handlingStrategy":"validation","validationCode":"if (flowableComponent.getIdentityService() == null) {\n    flowableComponent.setIdentityService(processEngine.getIdentityService());\n}","typeGuard":null,"tryCatchPattern":"try {\n    producer.process(exchange);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"IdentityService is missing\")) {\n        // wire IdentityService into the component and retry\n    }\n    throw e;\n}","preventionTips":["Always set IdentityService on the flowable camel component during wiring.","Remove initiator headers when initiator tracking is not required.","Cover component setup in integration tests with initiator set."],"tags":["camel","flowable","identity-service","initiator"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}