flowable/flowable-engine · warning

No script provided for scriptTask {}

Error message

No script provided for scriptTask {}

What it means

When parsing a scriptTask configured with the secure JavaScript behavior, the parser checks the script body. If the script attribute is empty or missing, it logs this warning; the behavior is still attached but will have a null script and fail at runtime when the task executes.

Source

Thrown at modules/flowable-secure-javascript/src/main/java/org/flowable/scripting/secure/behavior/SecureJavascriptTaskParseHandler.java:44

    private static final Logger LOGGER = LoggerFactory.getLogger(SecureJavascriptTaskParseHandler.class);

    public static final String LANGUAGE_JAVASCRIPT = "javascript";

    @Override
    protected void executeParse(BpmnParse bpmnParse, ScriptTask scriptTask) {
        String language = scriptTask.getScriptFormat();
        if (LANGUAGE_JAVASCRIPT.equalsIgnoreCase(language)) {
            createSecureJavascriptTaskBehavior(bpmnParse, scriptTask, language);
        } else {
            super.executeParse(bpmnParse, scriptTask);
        }
    }

    protected void createSecureJavascriptTaskBehavior(BpmnParse bpmnParse, ScriptTask scriptTask,
        String language) {
        if (StringUtils.isEmpty(scriptTask.getScript())) {
            LOGGER.warn("No script provided for scriptTask {}", scriptTask.getId());
        }

        scriptTask.setBehavior(new SecureJavascriptTaskActivityBehavior(scriptTask.getId(),
            scriptTask.getScript(), language, scriptTask.getResultVariable(),
            scriptTask.getSkipExpression(), scriptTask.isAutoStoreVariables()));
    }

}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Add the <flowable:script> child element (or script attribute) with a non-empty script body to the scriptTask in the BPMN XML.
  2. If the script is supplied at runtime, verify the variable/expression that populates it resolves to a non-empty string.
  3. Fix the process model in the designer before deploying so the task has script content.
  4. If an empty script is intentional, replace the scriptTask with a different service task type (e.g. delegateExpression).

Example fix

// before
<serviceTask id="task1" flowable:type="javascript"/>
// after
<serviceTask id="task1" flowable:type="javascript">
  <extensionElements>
    <flowable:script><![CDATA[ return 1 + 1; ]]></flowable:script>
  </extensionElements>
</serviceTask>
Defensive patterns

Strategy: validation

Validate before calling

function validateBpmn(xml) {
  const doc = new DOMParser().parseFromString(xml, 'application/xml');
  const tasks = doc.getElementsByTagNameNS('*', 'scriptTask');
  for (const t of tasks) {
    const scripts = t.getElementsByTagNameNS('*', 'script');
    if (!scripts.length || !scripts[0].textContent.trim()) {
      throw new Error('scriptTask ' + t.getAttribute('id') + ' has no script');
    }
  }
}

Prevention

When it happens

Trigger: BPMN XML containing <serviceTask>/<scriptTask> with flowable:delegateExpression or the secure Javascript handler and no (or empty) <script> child element or script attribute; createSecureJavascriptTaskBehavior invoked during BpmnParse.executeParse.

Common situations: Hand-edited BPMN where the script element was deleted; modeler exporting a script task with empty script field; dynamically generated process XML where the script variable was null at build time.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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