Script Modules
Reusable JavaScript modules shared across workflows and batch scripts.
VARIO Cloud Script Modules are reusable JavaScript files stored directly in the ERP. Instead of duplicating logic across workflows and batch scripts, you write it once as a module and import it wherever needed. Modules are managed under System → Scripts in VARIO Cloud.
Module Groups
Groups organize modules into named collections. Every group has a unique name and an optional description.
A module can belong to exactly one group or exist ungrouped at the top level.
Import Mechanism
Any workflow or batch script in VARIO Cloud can import a module using standard ES module syntax. The import path determines how the module is resolved at runtime through a virtual module system:
// Module without a group — looked up by name
import helpers from "my_module";Module resolution is virtual — there is no filesystem involved. When a script executes, the engine resolves the import path against all registered modules in the database at runtime. The file system is read-only: scripts can import modules, but cannot read or write files.
Domains
Each module has a domain that indicates its intended usage context. The domain is organizational — it helps categorize modules in the UI and signals to other developers what the module is designed for.
LIBRARY
Shared modules importable by other scripts
WORKFLOW_SCRIPT
Workflow script tasks
WORKFLOW_SPLIT_GATEWAY
Workflow split gateways
WORKFLOW_INTERMEDIATE_EVENT
Workflow intermediate events
IMPORT_BATCH_PROCESSING
Batch processing scripts
APP
App-specific modules
UNDEFINED
Not yet categorized
Parameters
Modules can define typed parameters that make them configurable. Each parameter has a name and a valueType (string, boolean, or number). When a module is used in a workflow or batch script, the parameter values are passed at runtime and accessible inside the script via ctx.parameters.
This allows a single module to serve multiple use cases — for example, one print module configured with different templates or output formats depending on the context it runs in.
Presettings
VARIO Cloud ships with preset modules — default implementations for common tasks like printing documents, sending emails, or assigning images to articles. These presets belong to the group Vorgabe-Stapel-Skripte and can be used out of the box.
Users can customize a preset module by editing its script. The original version is preserved internally, and the module can be reset to its presetting at any time to restore the default implementation.
Unmodified presets run without a scripting licence; VARIO signs them so the system can recognise them. As soon as a preset is edited, saving and running it requires the scripting licence. Without the licence, workflows and batch actions only offer preset modules.
Built-in Modules
The scripting engine provides built-in modules that are always available and cannot be modified. They are the entry points for every place where a script can run:
work_item_script
Workflow script tasks
setPrepare, setGuard, setAction
work_item_split_gateway
Workflow split gateways
setPrepare, setSplit (returns the ID of the outgoing branch)
work_item_intermediate_event
Workflow intermediate events
setPrepare, setGuard, setTrigger
batch_script
Batch processing and script processing
setGuard, setAction, setAfterBatch
output_module_script
Output scripts (Einstellungen → Allgemein → Ausgabe)
setBeforePrint — output continues only if it returns true
app_scripting_proxy
App scripts (System → Apps → tab Skripte)
setProcess — receives the app's JSON and returns the changed JSON
picklist_script_pick_box_connect
Picklist templates with consolidation or rolling picking
setProcess — distributes picklist lines to pick boxes
These are imported at the top of every script — e.g. import workItem from "work_item_script". User-created modules are imported alongside them using the same syntax.
Example
A reusable module that validates address fields:
Importing it in a workflow:
Last updated
Was this helpful?