flowable/flowable-engine · error · FlowableException

${errorPrefix} for ${variableContainer}

Error message

${errorPrefix} for ${variableContainer}

What it means

parseRequestHeaders converts a headers Expression into an HttpHeaders object by reading the expression value from the variable container and parsing it. If the header string is malformed, HttpHeaders.parseFromString throws FlowableIllegalArgumentException, which is rethrown as FlowableException with the error prefix (e.g. HTTP_TASK_REQUEST_HEADERS_INVALID) plus the variable container description. The root cause is an unparsable header definition string.

Source

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

        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);
        } catch (FlowableIllegalArgumentException ex) {
            throw new FlowableException(errorPrefix + " for " + variableContainer, ex);
        }
    }

    protected abstract void propagateError(VariableContainer container, String code);

    public static class ExecutionData {

        protected RequestData request;
        protected HttpResponse response;
        protected Throwable exception;

        public ExecutionData(RequestData request, HttpResponse response) {
            this(request, response, null);
        }

        public ExecutionData(RequestData request, HttpResponse response, Throwable exception) {
            this.request = request;
            this.response = response;

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Fix the headers string so each header is 'Name: value' separated by commas or newlines per HttpHeaders.parseFromString rules
  2. Inspect the cause (FlowableIllegalArgumentException) in the stack trace for the exact parse failure position
  3. Print the resolved headers value with an execution listener before the HTTP task to see what the expression evaluates to
  4. Move header construction to a script task that produces a known-good string

Example fix

// before
execution.setVariable("myHeaders", "Content-Type application/json");
// after
execution.setVariable("myHeaders", "Content-Type: application/json");
Defensive patterns

Strategy: validation

Validate before calling

String headers = (String) execution.getVariable("requestHeaders");
if (headers != null && java.util.Arrays.stream(headers.split("[\\n,]")).anyMatch(h -> !h.contains(":"))) {
    throw new IllegalArgumentException("Each header must be 'Name: value'");
}

Try / catch

try {
    HttpHeaders.parseFromString(headersString);
} catch (FlowableIllegalArgumentException ex) {
    throw new IllegalStateException("Malformed header definition: " + headersString, ex);
}

Prevention

When it happens

Trigger: The requestHeaders or secureHeaders expression resolves to a string that HttpHeaders.parseFromString cannot parse — e.g. missing colon separator, blank name, wrong line/separator format — for request headers or secure headers.

Common situations: Passing headers via a process variable that contains free-form text; using 'Header-Name Value' without a colon; embedding newlines in the wrong place; typos in header names copied from curl commands.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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