flowable/flowable-engine · error · FlowableException
Exception while processing exchange
Error message
Exception while processing exchange
What it means
CamelBehavior.execute routes the Flowable execution through a Camel endpoint. If the synchronous endpoint.process(exchange) call throws any exception, it is wrapped in a FlowableException 'Exception while processing exchange' with the original as cause.
Source
Thrown at modules/flowable-camel/src/main/java/org/flowable/camel/CamelBehavior.java:130
}
}
@Override
public void execute(DelegateExecution execution) {
boolean isV5Execution = false;
if ((Context.getCommandContext() != null && Flowable5Util.isFlowable5ProcessDefinitionId(Context.getCommandContext(), execution.getProcessDefinitionId())) ||
(Context.getCommandContext() == null && Flowable5Util.getFlowable5CompatibilityHandler() != null)) {
isV5Execution = true;
}
final FlowableEndpoint endpoint = createEndpoint(execution, isV5Execution);
final Exchange exchange = createExchange(execution, endpoint);
try {
endpoint.process(exchange);
} catch (Exception e) {
throw new FlowableException("Exception while processing exchange", e);
}
execution.setVariables(ExchangeUtils.prepareVariables(exchange, endpoint));
if (!handleCamelException(exchange, execution, isV5Execution)) {
if (isV5Execution) {
Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();
compatibilityHandler.leaveExecution(execution);
return;
}
leave(execution);
}
}
protected FlowableEndpoint createEndpoint(DelegateExecution execution, boolean isV5Execution) {
String uri = "flowable://" + getProcessDefinitionKey(execution, isV5Execution) + ":" + execution.getCurrentActivityId();
CamelContext camelContext = getCamelContext(execution, isV5Execution);
return getEndpoint(camelContext, uri);
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Inspect the cause chain (FlowableException.getCause()) to find the underlying Camel exception
- Fix the Camel route/processor that threw the original exception
- Check the CamelContext is started and the route is registered before the process runs
- Wrap route-side logic so expected business errors are propagated as BPMN errors/exceptions mapped via mapException
Defensive patterns
Strategy: try-catch
Try / catch
try { /* execute task */ } catch (FlowableException e) { log.error("Camel processing failed", e.getCause()); } Prevention
- Test Camel routes independently; map expected exceptions with mapException
When it happens
Trigger: A Camel route/producer invoked from a service task (camelBehavior) throws: bad route configuration, exception inside the route before completing, endpoint processing failure.
Common situations: Misconfigured Camel routes, exceptions thrown inside route processors, serialization failures in exchange body, CamelContext not started.
Related errors
- Endpoint not defined for ${key}
- Unhandled exception on camel route
- e.getMessage()
- Initiator header '${processInitiatorHeaderName}': Value must
- Initiator header '${processInitiatorHeaderName}': Value must
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/0d0514df16e40d7a.
Report an issue: GitHub.