{"record":{"id":"91b1f916927ad34a","repo":"flowable/flowable-engine","slug":"initiator-header-processinitiatorheadername-91b1f9","errorCode":null,"errorMessage":"Initiator header '${processInitiatorHeaderName}': Value must be provided","messagePattern":"Initiator header '(.+?)': Value must be provided","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-camel/src/main/java/org/flowable/camel/ExchangeUtils.java","lineNumber":155,"sourceCode":"     * Gets the value of the Camel header that contains the userId to be set as the process initiator. Returns null if no header name was specified on the Camel route.\n     *\n     * @param exchange The Camel Exchange object\n     * @param endpoint The endPoint implementation\n     * @return The userId of the user to be set as the process initiator\n     */\n    public static String prepareInitiator(Exchange exchange, FlowableEndpoint endpoint) {\n\n        String initiator = null;\n        if (endpoint.isSetProcessInitiator()) {\n            try {\n                initiator = exchange.getIn().getHeader(endpoint.getProcessInitiatorHeaderName(), String.class);\n            } catch (TypeConversionException e) {\n                throw new FlowableException(\"Initiator header '\" +\n                        endpoint.getProcessInitiatorHeaderName() + \"': Value must be of type String.\", e);\n            }\n\n            if (StringUtils.isEmpty(initiator)) {\n                throw new FlowableException(\"Initiator header '\" +\n                        endpoint.getProcessInitiatorHeaderName() + \"': Value must be provided\");\n            }\n        }\n        return initiator;\n    }\n}\n","sourceCodeStart":137,"sourceCodeEnd":162,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-camel/src/main/java/org/flowable/camel/ExchangeUtils.java#L137-L162","documentation":"ExchangeUtils.prepareInitiator reads the process initiator header from a Camel exchange when handing the exchange to a Flowable process. Flowable throws this FlowableException when the configured initiator header name is present but its value is empty/null (StringUtils.isEmpty). It guarantees the process variable 'initiator' is a non-empty string.","triggerScenarios":"Calling a Flowable camel endpoint with the initiator header set (e.g. ExchangeUtils.prepareInitiator invoked from FlowableConsumer/process) but the header value is null, an empty string, or whitespace. Distinct from the type-conversion error: here the value was either not convertible or simply absent after the header name resolved.","commonSituations":"Setting the header from a dynamic expression that evaluates to null; copying headers from an incoming HTTP request where the user-identity header was omitted; typos causing a different header to be read than the one populated; passing an empty String literal.","solutions":["Populate the initiator header with a non-empty String on the exchange before invoking the Flowable endpoint: exchange.getIn().setHeader(endpoint.getProcessInitiatorHeaderName(), \"kermit\").","Verify the configured processInitiatorHeaderName on the FlowableEndpoint matches the header actually set.","Validate the value upstream (e.g. reject requests without an authenticated user) before routing to the Flowable endpoint.","If no initiator is intended, remove the header entirely so the initiator block is skipped rather than passing an empty value."],"exampleFix":"// before\nexchange.getIn().setHeader(\"ProcessInitiator\", someNullableUserId);\n// after\nif (userId != null && !userId.trim().isEmpty()) {\n    exchange.getIn().setHeader(\"ProcessInitiator\", userId);\n}","handlingStrategy":"validation","validationCode":"String initiator = exchange.getIn().getHeader(endpoint.getProcessInitiatorHeaderName(), String.class);\nif (initiator == null || initiator.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"Initiator header '\" + endpoint.getProcessInitiatorHeaderName() + \"' must be a non-empty String\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set the initiator header explicitly with a validated non-empty String before routing to the flowable endpoint.","Keep the header name in one constant shared by producer and endpoint configuration.","Reject upstream requests lacking a user identity instead of propagating empty headers."],"tags":["camel","flowable","empty-header-value","process-initiator"],"backgroundTag":"empty-required-field","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"}