flowable/flowable-engine · error · FlowableException

Could not execute script task instance: no scripting engines

Error message

Could not execute script task instance: no scripting engines found. For ${planItemInstanceEntity}

What it means

A CMMN script task needs a JSR-223 ScriptingEngines component in the engine configuration to evaluate its script. When getScriptingEngines() returns null — no script engine support was configured — execute() throws a FlowableException and the plan item fails.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/ScriptTaskActivityBehavior.java:49

import org.flowable.common.engine.impl.variable.MapDelegateVariableContainer;

/**
 * Implementation of ScriptActivity CMMN 2.0 PlanItem.
 */
public class ScriptTaskActivityBehavior extends TaskActivityBehavior {

    protected ScriptServiceTask scriptTask;

    public ScriptTaskActivityBehavior(ScriptServiceTask scriptTask) {
        super(scriptTask.isBlocking(), scriptTask.getBlockingExpression());
        this.scriptTask = scriptTask;
    }

    @Override
    public void execute(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) {
        ScriptingEngines scriptingEngines = CommandContextUtil.getCmmnEngineConfiguration().getScriptingEngines();
        if (scriptingEngines == null) {
            throw new FlowableException("Could not execute script task instance: no scripting engines found. For " + planItemInstanceEntity);
        }
        String scriptFormat = scriptTask.getScriptFormat() != null ? scriptTask.getScriptFormat() : ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE;
        
        try {
            ScriptEngineRequest.Builder request = ScriptEngineRequest.builder()
                    .language(scriptFormat)
                    .script(scriptTask.getScript())
                    .scopeContainer(planItemInstanceEntity)
                    .traceEnhancer(trace -> trace.addTraceTag("type", "scriptTask"));
            if (scriptTask.isAutoStoreVariables()) {
                request.storeScriptVariables();
            }

            List<IOParameter> inParameters = scriptTask.getInParameters();
            if (inParameters != null && !inParameters.isEmpty()) {
                MapDelegateVariableContainer inputVariableContainer = new MapDelegateVariableContainer();
                IOParameterUtil.processInParameters(inParameters, planItemInstanceEntity, inputVariableContainer,
                        CommandContextUtil.getExpressionManager(commandContext));

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Add the scripting support: include the flowable-engine scripting segment/dependency (groovy-jsr223 or juel) so ScriptingEngines is registered in the configuration
  2. Ensure a JSR-223 provider for the script language is on the classpath (e.g. org.codehaus.groovy:groovy for Groovy)
  3. If scripts are not needed, refactor the case model to replace script tasks with service tasks or expressions
  4. In Spring Boot, verify no exclusion of Flowable scripting auto-configuration and that javax.script.ScriptManagerFactory is available at runtime

Example fix

// before (pom.xml)
<dependency>org.flowable:flowable-cmmn-engine</dependency> <!-- no scripting -->
// after
<dependency>org.flowable:flowable-cmmn-engine</dependency>
<dependency>org.flowable:flowable-script-task</dependency> <!-- registers ScriptingEngines -->
<dependency>org.codehaus.groovy:groovy</dependency> <!-- JSR-223 provider -->
Defensive patterns

Strategy: validation

Validate before calling

ScriptEngineManager mgr = new ScriptEngineManager();
if (mgr.getEngineByName("groovy") == null) {
    throw new IllegalStateException("No JSR-223 engine for script tasks");
}
// plus: assert cmmnEngineConfiguration.getScriptingEngines() != null

Try / catch

try {
    cmmnRuntimeService.triggerPlanItemInstance(planItemId);
} catch (FlowableException e) {
    if (e.getMessage().contains("no scripting engines found")) {
        // engine misconfiguration: add scripting module/dependency
    }
}

Prevention

When it happens

Trigger: execute() for a script task plan item runs while CmmnEngineConfiguration.getScriptingEngines() is null, i.e. the scripting module was never installed.

Common situations: Using flowable-cmmn-engine without the scripting dependency/segment (scriptingEngines not configured); GraalVM/native-image builds where javax.script engines are missing; spring-boot app excluding the script engine auto-configuration; running with a minimal engine config for tests.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


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