flowable/flowable-engine · error · FlowableException

Endpoint not defined for ${key}

Error message

Endpoint not defined for ${key}

What it means

CamelBehavior.createEndpoint looks up a pre-registered FlowableEndpoint in the CamelContext by endpoint key derived from the process/activity. If no FlowableEndpoint with that key exists in the context, a FlowableException is thrown.

Source

Thrown at modules/flowable-camel/src/main/java/org/flowable/camel/CamelBehavior.java:158

            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);
    }

    protected abstract CamelContext getCamelContext(DelegateExecution execution, boolean isV5Execution);

    protected FlowableEndpoint getEndpoint(CamelContext camelContext, String key) {
        for (Endpoint e : camelContext.getEndpoints()) {
            if (e.getEndpointKey().equals(key) && (e instanceof FlowableEndpoint)) {
                return (FlowableEndpoint) e;
            }
        }
        throw new FlowableException("Endpoint not defined for " + key);
    }

    protected Exchange createExchange(DelegateExecution activityExecution, FlowableEndpoint endpoint) {
        Exchange ex = endpoint.createExchange();
        ex.setProperty(FlowableProducer.PROCESS_ID_PROPERTY, activityExecution.getProcessInstanceId());
        ex.setProperty(FlowableProducer.EXECUTION_ID_PROPERTY, activityExecution.getId());
        Map<String, Object> variables = activityExecution.getVariables();
        TargetType toTargetType = determineToTargetType(endpoint);
        copyVariables(variables, ex, endpoint, toTargetType);
        return ex;
    }

    protected boolean handleCamelException(Exchange exchange, DelegateExecution execution, boolean isV5Execution) {
        Exception camelException = exchange.getException();
        boolean notHandledByCamel = exchange.isFailed() && camelException != null;
        if (notHandledByCamel) {
            if (camelException instanceof BusinessError) {
                if (isV5Execution) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Define the Camel route in the same CamelContext with a URI matching the key, e.g. from("flowable:orderProcess")
  2. Ensure the endpoint URI in the BPMN extension exactly matches the route's from URI
  3. Verify a single CamelContext instance is shared between the route registry and Flowable

Example fix

// before: no route defined for the URI used by camelBehavior
// after
from("flowable:camelProcess:camelTask").to("bean:myBean?method=handle");
Defensive patterns

Strategy: try-catch

Try / catch

try { /* execute task */ } catch (FlowableException e) { if (e.getMessage().startsWith("Endpoint not defined")) { /* register the flowable: endpoint */ } }

Prevention

When it happens

Trigger: A service task configured with camelBehavior runs, but no flowable:<routeName> endpoint was registered in the CamelContext matching the key (usually the route URI used in the camelExtension).

Common situations: Camel route declared but not started; URI in the BPMN camel connector does not match the registered endpoint URI; CamelContext is a different instance than the one containing the endpoints.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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