flowable/flowable-engine · error · FlowableException

Could not find engine configuration with variable service…

Error message

Could not find engine configuration with variable service configuration

What it means

TraceableObject (used by traceable serializable variable types to reach the engine) scans registered engine configurations to find one exposing a VariableServiceConfiguration. When no known engine configuration carries the variable service configuration, this FlowableException is thrown. It indicates the object is being resolved outside a properly initialized engine context.

Solutions

  1. Ensure the process engine (and its variable service configuration) is fully built and registered before objects using TraceableObject are serialized/deserialized
  2. Check that the scope type maps to a registered engine configuration (getEngineType lookup) and that EngineConfigurationConstants.KEY_VARIABLE_SERVICE_CONFIG is present in the service configurations
  3. In tests, build the full engine via ProcessEngineConfiguration rather than partial configuration objects
  4. If deserializing in another application, register an engine configuration implementing HasVariableServiceConfiguration first

Example fix

// before
EngineConfiguration cfg = EngineConfigurations.getEngineConfiguration(engineType); // null -> throw
// after
if (cfg == null) {
    cfg = ProcessEngines.getDefaultProcessEngine().getProcessEngineConfiguration();
}
Defensive patterns

Strategy: validation

Validate before calling

EngineConfiguration cfg = ProcessEngineConfigurationImpl
    .getEngineConfigurations() == null ? null
    : org.flowable.common.engine.impl.EngineConfigurations.getEngineConfiguration(
          ProcessEngines.getDefaultProcessEngine().getProcessEngineConfiguration().getEngineType());
if (cfg == null || !(cfg instanceof HasVariableServiceConfiguration)) {
    throw new IllegalStateException("No engine configuration with variable service support registered");
}

Prevention

When it happens

Trigger: Calling getVariableServiceConfiguration when EngineConfigurations.getEngineConfiguration(...) returns null for the engine type — i.e., the engine configuration was not registered, the scope type maps to an unknown engine, or the code runs outside any started process engine.

Common situations: Using traceable variable types in a standalone/unit-test setup where the full engine configuration set was never registered; multiple engine configurations where the variable-service key was removed; deserializing traceable objects in a different JVM/app that lacks the engine configuration.

Related errors


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

Appendix: source

Thrown at modules/flowable-variable-service/src/main/java/org/flowable/variable/service/impl/types/TraceableObject.java:73

                        variableInstanceEntity, variableServiceConfiguration.getClock().getCurrentTime());
            }
        }
    }
    
    protected VariableServiceConfiguration getVariableServiceConfiguration() {
        String engineType = getEngineType(variableInstanceEntity.getScopeType());
        Map<String, AbstractEngineConfiguration> engineConfigurationMap = Context.getCommandContext().getEngineConfigurations();
        AbstractEngineConfiguration engineConfiguration = engineConfigurationMap.get(engineType);
        if (engineConfiguration == null) {
            for (AbstractEngineConfiguration possibleEngineConfiguration : engineConfigurationMap.values()) {
                if (possibleEngineConfiguration instanceof HasVariableServiceConfiguration) {
                    engineConfiguration = possibleEngineConfiguration;
                }
            }
        }
        
        if (engineConfiguration == null) {
            throw new FlowableException("Could not find engine configuration with variable service configuration");
        }
        
        if (!(engineConfiguration instanceof HasVariableServiceConfiguration)) {
            throw new FlowableException("Variable entity engine scope has no variable service configuration " + engineType);
        }
        
        return (VariableServiceConfiguration) engineConfiguration.getServiceConfigurations().get(EngineConfigurationConstants.KEY_VARIABLE_SERVICE_CONFIG);
    }
    
    protected String getEngineType(String scopeType) {
        if (StringUtils.isNotEmpty(scopeType)) {
            return scopeType;
        } else {
            return ScopeTypes.BPMN;
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)