Script Task
A Script Task executes an automated script written in a language the process engine can interpret. Unlike Service Tasks that call external services, Script Tasks run inline code within the engine.
What is a Script Task?
A Script Task executes code scripts directly within the process engine. The script is typically written in JavaScript, Groovy, Python, or another language supported by the engine, running inline without external service calls.
Visual Representation
A Script Task shows a rounded rectangle containing a document/script icon (often depicted as a page with lines). This represents the inline code or script to be executed.
Key Characteristics
- Inline execution: Script runs within the process engine, not externally
- Engine-dependent: Available languages depend on the process engine
- Variable access: Can read and write process variables directly
- Quick logic: Ideal for simple calculations, transformations, or data manipulation
Common Use Cases
Data Calculation
Calculate order totals, tax amounts, and discounts using a simple inline script.
Variable Transformation
Transform data formats or concatenate fields before passing to the next activity.
Conditional Logic
Evaluate complex conditions and set flag variables for downstream gateway decisions.
Frequently Asked Questions
Related BPMN Elements
Try this element in Crismo
Create beautiful BPMN diagrams with our modern process modeling platform.