Business rules scripting
Python 3
MVEL
Groovy
JavaScript
Starting with 5.9.0, JavaScript and Python execute on a native subprocess pool by default. Existing scripts that read from
input, write to output, and use language built-ins keep working. output.put(...), output.get(...), and bracket assignment are preserved. To keep a script on the previous GraalVM engine: business rules select the engine per rule — see Script engine per rule (rules created before the move to native keep GraalVM automatically); for workflow scripts, set APPLICATION_SCRIPTENGINE_PROVIDER=graalvm on integration-designer. See Script runtime change in the 5.1 → 5.9 migration guide for the full audit.In version 4.7.2, we’ve deprecated the DMN (Decision Model and Notation) business rule actions. This change affects how business rules are configured on task/user task nodes in business processes.
Integration designer scripting
Input and output
Scripts in FlowX receive data through bound variables. The available variables depend on the context.Available variables
instanceMetadata keys
instanceMetadata contains only instance identifiers:
The process definition name is not available in
instanceMetadata or any other script variable. If a business rule needs the process name as data, set it explicitly — for example as a process parameter on the start node or in the start request — since the name is static per process definition.Writing to output
Assign values to theoutput variable to persist data. Both assignment and .put() syntax work.
- JavaScript
- Python
How output is merged into process data
In process business rules,output starts empty every time the script runs. When the script finishes, FlowX merges output into the existing process data instead of replacing it. Keys you don’t write to keep their current values.
The merge works key by key:
To update one item in an array, read the array from
input, change it, and write the full array back to output.
Reading from input
input is a deep copy of the process or workflow data. Changes to input are not persisted. Always write to output.
- JavaScript
- Python
Accessing configuration parameters
Retrieve project-level configuration parameters throughadditionalData:
Common pitfalls
Output is empty ({})
Output is empty ({})
If your script runs without errors but output is
{}:- Check your variable names.
outputmust be spelled exactly, it’s case-sensitive - Check assignment syntax. In Python on the GraalVM engine, use
output["key"] = value(bracket notation), notoutput.key = value. The default native engine accepts both forms - Don’t reassign output. On the GraalVM engine,
output = {"key": "value"}replaces the reference and is lost, because the engine reads back its ownoutputobject. The default native engine keeps the reassigned object, butoutput["key"] = "value"works on both engines, so use bracket assignment - Don’t use
return. Scripts don’t need a return statement. Write directly tooutput.
Python import errors
Python import errors
On the GraalVM engine (GraalPy), Python scripts run in a sandboxed environment. Standard library modules such as
uuid, re, hashlib, hmac, secrets, and base64 can be imported. The modules that aren’t available are listed under Python Library Support.On the default native engine (CPython), standard library modules such as uuid, re, hashlib, hmac, secrets, and base64 can be imported. Modules that reach the system, network, or files, such as os, subprocess, socket, urllib, and io, are blocked and fail with Import of '<module>' is not allowed in FlowX scripts.Python syntax limitations
Python syntax limitations
Some Python patterns behave differently in the GraalPy sandbox:
Java HashMap interop in JavaScript
Java HashMap interop in JavaScript
When accessing data returned by Java services (such as AI node output), values may be Java HashMaps rather than native JavaScript objects. Standard JS methods like
Object.keys() and spread syntax may not work as expected.Can I use the Node.js crypto module in JavaScript?
Can I use the Node.js crypto module in JavaScript?
No. JavaScript scripts don’t run as Node.js modules, so
require doesn’t exist and Node.js modules such as crypto, fs, or http can’t be loaded. Calling require('crypto') fails with ReferenceError: require is not defined. There is no crypto global either.On the default native engine, a script sees only the standard JavaScript built-ins (JSON, Math, Date, RegExp, and similar) plus the script variables such as input and output. Node.js globals such as process and Buffer aren’t available.To hash data or generate IDs, use a Python script, where hashlib, hmac, secrets, and uuid can be imported on both engines:Scripts in Integration Workflows
Script nodes in Integration Workflows use the sameinput and output variables as process business rules, but the data flow is different:
- In a process business rule,
outputwrites directly to the process instance data store. - In a workflow Script node,
outputbecomes theinputfor the next node in the workflow. The data stays within the workflow until the workflow completes at an End node.
If your workflow Script node produces an empty The
output ({}), subsequent nodes in the workflow receive no data. To pass all input data through to the next node while adding or modifying fields, copy the input to output first:output.put("", input) call copies all keys from input into the root of output.JavaScript
JavaScript scripts run on one of two engines:
Business rules select the engine per rule. See Script engine per rule.
Native engine (default)
Scripts run in an isolated V8 context. A script sees the standard JavaScript built-ins (JSON, Math, Date, RegExp, and similar) plus the script variables such as input and output. require, Node.js modules such as crypto or fs, and Node.js globals such as process and Buffer aren’t available.
GraalVM engine (opt-in)
New in v4.7.1: JavaScript support has been upgraded from Nashorn (ECMAScript 5.1) to GraalJS (ECMAScript 15/2024), providing significantly improved performance and modern language features.
What is GraalJS?
GraalJS is an ECMAScript compliant JavaScript implementation built on GraalVM. It supports the latest ECMAScript features and offers high performance through the GraalVM’s JIT compiler.Properties
- Supports ECMAScript 15 (2024) features including modern syntax and APIs
- Provides consistent scripting across business rules and integration designer
- Runs in a secure sandboxed environment
Limitations
On the GraalVM engine, JavaScript scripts run in a sandboxed environment. Here is a list of JavaScript features not available in the sandbox:- import.meta (ES2020)
- top-level await (ES2022)
- set operations (ES2024)
- Array.fromAsync (ES2024)
Useful links
GraalJS Documentation
ECMAScript 2024 Language Specification
Python 3
Python is a high-level, interpreted programming language known for its simplicity and readability. FlowX.AI runs Python scripts on one of two engines, selected the same way as for JavaScript: per business rule, and for workflow scripts throughAPPLICATION_SCRIPTENGINE_PROVIDER on integration-designer.
Native engine (default)
Standard library modules such asuuid, re, hashlib, hmac, secrets, and base64 can be imported. Modules that reach the system, network, or files, such as os, subprocess, socket, urllib, and io, are blocked and fail with Import of '<module>' is not allowed in FlowX scripts.
Both output["key"] = value and output.key = value write to output.
GraalVM engine (opt-in)
What is GraalPy?
GraalPy is an implementation of Python that runs on the GraalVM. It offers high compatibility with standard Python (CPython) while providing the ability to run within the Java ecosystem. GraalPy supports Python 3 and provides access to a large subset of the standard Python library.Properties
- Supports Python 3.12 (Python 3.13 starting with 5.9.5) with access to most common Python libraries
- Runs up to 3x faster than Python 2.7 via Jython
- Runs in a sandboxed environment for better security
Python Library Support
On the GraalVM engine, Python 3 support in FlowX comes with a subset of the standard Python library. Python runs in a sandboxed environment and the following modules are not available: “stringprep”, “sqlite3”, “plistlib”, “getpass”, “curses”, “curses.textpad”, “curses.ascii”, “curses.panel”, “xml.parsers.expat”, “xmlrpc.client”, “xmlrpc.server”, “turtle”, “tkinter”, “test.support”, “symtable”, “pyclbr”, “msvcrt”, “winreg”, “winsound”, “grp”, “termios”, “tty”, “pty”, “syslog”, “audioop”, “msilib”, “nis”, “ossaudiodev”, “smtpd”, “spwd”, “crypt”Useful links
Python 3.12 Documentation
GraalPy Documentation
MVEL
MVEL is an expression language for Java-based applications. It provides a plethora of features and is suited for everything from the smallest property binding and extraction, to full-blown scripts.- FlowX.AI uses mvel2 - 2.5.2.Final version
Useful links
MVEL Documentation
Maven repository: Mvel 2.5.2 Final
Groovy
Groovy is a multi-faceted language for the Java platform. The language can be used to combine Java modules, extend existing Java applications and write new applications We use and recommend Groovy 3.0.21 version, using groovy-jsr223 engine.Groovy has multiple ways of integrating with Java, some of which provide richer options than available with JSR-223 (e.g. greater configurability and more security control). JSR-223 is recommended when you need to keep the choice of language used flexible and you don’t require integration mechanisms not supported by JSR-223.
JSR-223 (spec) is a standard scripting API for Java Virtual Machine (JVM) languages . The JVM languages provide varying levels of support for the JSR-223 API and interoperability with the Java runtime.
Useful links
Groovy Language Documentation
[Java] Class GroovyScriptEngineImpl
groovy-jsr223
Academy courses
Exclusive Gateways course
Learn to configure conditions in JavaScript and DMN for gateway routing
Debug 101 course
Troubleshoot script execution errors, exceptions, and debugging patterns

