flowable/flowable-engine · error · FlowableException

HTTP_TASK_REQUEST_METHOD_INVALID

Error message

HTTP_TASK_REQUEST_METHOD_INVALID

What it means

validateRequest only accepts the methods GET, POST, PUT, PATCH and DELETE; any other method string throws FlowableException(HTTP_TASK_REQUEST_METHOD_INVALID). The delegate deliberately restricts the HTTP verb set supported by Flowable HTTP tasks.

Solutions

  1. Change the request method to one of GET, POST, PUT, PATCH or DELETE (exact uppercase spelling).
  2. If you need HEAD/OPTIONS, implement a custom delegate or use a different client, since these verbs are not supported by the built-in HTTP task.
  3. Normalize/uppercase any variable-driven method value before it reaches the request.

Example fix

// before
request.setMethod("get"); // invalid

// after
request.setMethod("GET");
Defensive patterns

Strategy: validation

Validate before calling

Set<String> ALLOWED = Set.of("GET", "POST", "PUT", "PATCH", "DELETE");
if (request.getMethod() != null && !ALLOWED.contains(request.getMethod())) {
    throw new IllegalArgumentException("Unsupported method: " + request.getMethod());
}

Type guard

boolean isSupportedHttpMethod(String m) {
    return "GET".equals(m) || "POST".equals(m) || "PUT".equals(m)
        || "PATCH".equals(m) || "DELETE".equals(m);
}

Try / catch

try {
    delegate.execute(execution);
} catch (FlowableException e) {
    if ("HTTP_TASK_REQUEST_METHOD_INVALID".equals(e.getMessage())) {
        // correct the method value in the task configuration
    }
}

Prevention

When it happens

Trigger: An HTTP task or programmatically built HttpRequest has a method set to a value outside {GET, POST, PUT, PATCH, DELETE} — e.g. HEAD, OPTIONS, TRACE, lowercase "get", or a typo like "GTE".

Common situations: Typos in the requestMethod field; lowercase method names from variables or templates; attempting to use HEAD/OPTIONS which the delegate does not support; expression/variable injection supplying an unexpected value.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/ad9cb1c48b7c96bb. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/BaseHttpActivityDelegate.java:253

        });
    }

    // HttpRequest validation

    protected void validateRequest(HttpRequest request) throws FlowableException {
        if (request.getMethod() == null) {
            throw new FlowableException(HTTP_TASK_REQUEST_METHOD_REQUIRED);
        }

        switch (request.getMethod()) {
            case "GET":
            case "POST":
            case "PUT":
            case "PATCH":
            case "DELETE":
                break;
            default:
                throw new FlowableException(HTTP_TASK_REQUEST_METHOD_INVALID);
        }

        if (request.getUrl() == null) {
            throw new FlowableException(HTTP_TASK_REQUEST_URL_REQUIRED);
        }
    }
    protected HttpHeaders getRequestHeaders(VariableContainer variableContainer) {
        return parseRequestHeaders(variableContainer, requestHeaders, HTTP_TASK_REQUEST_HEADERS_INVALID);
    }

    protected HttpHeaders getRequestSecureHeaders(VariableContainer variableContainer) {
        return parseRequestHeaders(variableContainer, requestSecureHeaders, HTTP_TASK_REQUEST_SECURE_HEADERS_INVALID);
    }

    protected HttpHeaders parseRequestHeaders(VariableContainer variableContainer, Expression headers, String errorPrefix) {
        try {
            String headersString = ExpressionUtils.getStringFromField(headers, variableContainer);
            return HttpHeaders.parseFromString(headersString);

View on GitHub (pinned to d6d39ce1c6)