{"record":{"id":"e21f95afec04fda6","repo":"flowable/flowable-engine","slug":"http-task-request-field-invalid-in-execution-e","errorCode":null,"errorMessage":"HTTP_TASK_REQUEST_FIELD_INVALID in execution \" + execution","messagePattern":"HTTP_TASK_REQUEST_FIELD_INVALID in execution \" \\+ execution","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/DefaultBpmnHttpActivityDelegate.java","lineNumber":89,"sourceCode":"    @Override\n    protected FlowableHttpClient createHttpClient() {\n        HttpClientConfig config = CommandContextUtil.getProcessEngineConfiguration().getHttpClientConfig();\n        return config.determineHttpClient();\n    }\n\n    @Override\n    public CompletableFuture<ExecutionData> execute(DelegateExecution execution, AsyncTaskInvoker taskInvoker) {\n        RequestData request;\n\n        HttpServiceTask httpServiceTask = (HttpServiceTask) execution.getCurrentFlowElement();\n        try {\n            request = createRequest(execution, httpServiceTask.getId());\n\n        } catch (Exception e) {\n            if (e instanceof FlowableException) {\n                throw (FlowableException) e;\n            } else {\n                throw new FlowableException(HTTP_TASK_REQUEST_FIELD_INVALID + \" in execution \" + execution, e);\n            }\n        }\n\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();\n        HttpRequestHandler httpRequestHandler = createHttpRequestHandler(httpServiceTask.getHttpRequestHandler(), processEngineConfiguration);\n\n        if (httpRequestHandler != null) {\n            httpRequestHandler.handleHttpRequest(execution, request.getHttpRequest(), null);\n        }\n\n        // Validate request\n        validateRequest(request.getHttpRequest());\n\n        boolean parallelInSameTransaction;\n        if (httpServiceTask.getParallelInSameTransaction() != null) {\n            parallelInSameTransaction = httpServiceTask.getParallelInSameTransaction();\n        } else {\n            parallelInSameTransaction = processEngineConfiguration.getHttpClientConfig().isDefaultParallelInSameTransaction();","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/http/DefaultBpmnHttpActivityDelegate.java#L71-L107","documentation":"DefaultBpmnHttpActivityDelegate.execute wraps any non-FlowableException raised while building the HTTP request (createRequest) into this FlowableException with code HTTP_TASK_REQUEST_FIELD_INVALID. It signals that a field of the HTTP task's request (URL, method, headers, body expression) could not be resolved or was invalid for the given execution.","triggerScenarios":"A service task of type 'http' has request field expressions (httpTask URL, headers, body) that throw when evaluated against the execution — missing variables, bad expression syntax, unresolvable Spring beans, null URL — and the underlying exception is not already a FlowableException.","commonSituations":"URL expression referencing a variable not present in the execution; typo in variable name; expression returning null for the URL; invalid header expressions; missing Spring bean referenced in an expression; wrong field type in the task's <extensionElements>.","solutions":["Inspect the wrapped cause (getCause()) to see the original expression-evaluation failure.","Validate all request fields in the BPMN XML: URL, method, headers, body — ensure referenced variables exist (default them: ${var:defaultValue}).","Test expressions in isolation (e.g. via a small unit test with an ExpressionManager) before deploying the process.","Guard expressions with null-safe checks: ${var != null ? var : ''} or provide defaults via execution listeners.","If your own delegate/field throws, throw FlowableException directly so it isn't double-wrapped."],"exampleFix":"// before\n<flowable:field name=\"requestUrl\" expression=\"${externalUrl}\"/> <!-- externalUrl may be null -->\n\n// after\n<flowable:field name=\"requestUrl\" expression=\"${externalUrl != null ? externalUrl : 'https://default.example.com'}\"/>","handlingStrategy":"validation","validationCode":"// before the http service task runs\nMap<String, Object> vars = runtimeService.getVariables(executionId);\nif (vars.get(\"externalUrl\") == null || String.valueOf(vars.get(\"externalUrl\")).isBlank()) {\n    throw new IllegalArgumentException(\"externalUrl must be set before HTTP task\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    httpActivityDelegate.execute(delegateExecution);\n} catch (FlowableException e) {\n    if (e.getMessage().startsWith(\"HTTP_TASK_REQUEST_FIELD_INVALID\")) {\n        logger.error(\"invalid http request fields: {}\", e.getCause(), e);\n    }\n}","preventionTips":["Null-guard/default all variables referenced in HTTP task request expressions.","Dry-run request field expressions in a test harness before deployment.","Validate BPMN http task fields (URL, headers, body) with a model validator."],"tags":["flowable","http-task","expression","request-build","service-task"],"backgroundTag":"http-request-failed","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"}