{"record":{"id":"590eb48431dde12c","repo":"flowable/flowable-engine","slug":"http-code","errorCode":null,"errorMessage":"HTTP${code}","messagePattern":"HTTP\\$\\{code\\}","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java","lineNumber":204,"sourceCode":"                if (handleCodes != null && !handleCodes.isEmpty()) {\n                    if (handleCodes.contains(code)\n                            || (code.startsWith(\"5\") && handleCodes.contains(\"5XX\"))\n                            || (code.startsWith(\"4\") && handleCodes.contains(\"4XX\"))\n                            || (code.startsWith(\"3\") && handleCodes.contains(\"3XX\"))) {\n\n                        propagateError(variableContainer, code);\n                        return;\n                    }\n                }\n\n                Set<String> failCodes = request.getFailCodes();\n                if (failCodes != null && !failCodes.isEmpty()) {\n                    if (failCodes.contains(code)\n                            || (code.startsWith(\"5\") && failCodes.contains(\"5XX\"))\n                            || (code.startsWith(\"4\") && failCodes.contains(\"4XX\"))\n                            || (code.startsWith(\"3\") && failCodes.contains(\"3XX\"))) {\n\n                        throw new FlowableException(\"HTTP\" + code);\n                    }\n                }\n            }\n        }\n    }\n\n    protected CompletableFuture<ExecutionData> prepareAndExecuteRequest(RequestData request, boolean parallelInSameTransaction, AsyncTaskInvoker taskInvoker) {\n        ExecutableHttpRequest httpRequest = httpClient.prepareRequest(request.getHttpRequest());\n\n        if (!parallelInSameTransaction) {\n            CompletableFuture<ExecutionData> future = new CompletableFuture<>();\n\n            try {\n                HttpResponse response = httpRequest.call();\n                future.complete(new ExecutionData(request, response));\n            } catch (Exception ex) {\n                future.complete(new ExecutionData(request, null, ex));\n            }","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java#L186-L222","documentation":"BaseHttpActivityDelegate.saveResponseFields throws FlowableException(\"HTTP\" + code, e.g. \"HTTP500\" or \"HTTP404\") when the response status code matches the configured failCodes list (including wildcard 3XX/4XX/5XX entries). It converts configured HTTP failure status codes into a failed Flowable activity so the process can take its error path.","triggerScenarios":"An HTTP activity returns a status code that is listed in failCodes, or whose first digit matches a configured wildcard (\"3XX\", \"4XX\", \"5XX\"), during saveResponseFields handling.","commonSituations":"Remote REST endpoint returns 500 after a deployment; 404 due to a wrong URL/path in the HTTP task config; 401/403 from expired credentials; misconfigured failCodes (e.g. \"5XX\") classifying otherwise acceptable responses as failures.","solutions":["Check the code in the message (e.g. HTTP500) and inspect the remote service logs to fix the server-side problem.","Fix the HTTP task's request (URL, method, authentication) if the code is 4xx caused by a bad request.","Adjust the failCodes/`failStatusCodes` configuration on the HTTP activity if the failing code should not be treated as a failure.","Add a boundary error event on the HTTP service task to handle the failure within the process instead of failing the execution."],"exampleFix":"// before: failCodes = [\"5XX\"] and any 500 aborts the task\n// after: only fail on specific codes\nfailCodes = [\"503\"]; // tolerate 500s, fail only on 503","handlingStrategy":"try-catch","validationCode":"// before executing, check code against configured failCodes\nboolean willFail(String code, Set<String> failCodes) {\n    return failCodes.contains(code)\n        || (code.startsWith(\"5\") && failCodes.contains(\"5XX\"))\n        || (code.startsWith(\"4\") && failCodes.contains(\"4XX\"))\n        || (code.startsWith(\"3\") && failCodes.contains(\"3XX\"));\n}","typeGuard":null,"tryCatchPattern":"try {\n    delegate.execute(execution);\n} catch (FlowableException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"HTTP\")) {\n        String code = e.getMessage().substring(4);\n        // handle 4xx/5xx: retry, alert, or route to error boundary path\n    }\n}","preventionTips":["Add a boundary error event on HTTP service tasks to handle failure status codes in-process","Validate endpoint URLs, auth and payloads to avoid avoidable 4xx responses","Configure failCodes/failTimeout deliberately — avoid broad \"5XX\" unless intended","Monitor the remote service health before dependent process steps run"],"tags":["http","status-code","workflow","http-task"],"backgroundTag":"http-error-response","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"}