Task

Script Task

Script Task

Evaluates an inline FEEL expression and stores the result as process variables — no external worker or HTTP call needed. The engine runs the script synchronously before advancing the token.

Properties

PropertyTypeRequiredDescription
IDstringyesUnique element identifier
NamestringyesDisplay label
ScriptFEEL expressionyesExpression to evaluate
Result VariablestringconditionalVariable name for scalar output (omit when using context output)

Output Modes

Context output

When the expression returns a context literal { key: value, ... }, each key is stored as a separate process variable:

{ fee: amount * 0.05, tier: if amount > 1000 then "premium" else "standard" }

Both fee and tier become available to subsequent elements.

Scalar output

When the expression returns a single value, set Result Variable to name where it is stored:

amount + shipping

If resultVariable is totalCost, the value is stored as the variable totalCost.

FEEL Quick Reference

ConceptSyntax
Equality= (not ==)
Inequality!=
Boolean operatorsand, or, not(expr)
String literals"double quotes"
Context literal{ key: expr, key2: expr2 }
Conditionalif condition then value1 else value2
List lengthcount(myList)
List accessmyList[1] (1-based index)
Substringsubstring("hello", 1, 3)"hel"

XML Example

<bpmn:scriptTask id="calc_fee" name="Calculate Fee" scriptFormat="FEEL">
  <bpmn:script>
    { fee: amount * 0.05, tier: if amount > 1000 then "premium" else "standard" }
  </bpmn:script>
  <bpmn:incoming>flow_to_calc</bpmn:incoming>
  <bpmn:outgoing>flow_to_next</bpmn:outgoing>
</bpmn:scriptTask>
<!-- Scalar output with result variable -->
<bpmn:scriptTask id="sum_total" name="Sum Total" scriptFormat="FEEL"
  conduit:resultVariable="totalCost">
  <bpmn:script>amount + shipping</bpmn:script>
  <bpmn:incoming>flow_in</bpmn:incoming>
  <bpmn:outgoing>flow_out</bpmn:outgoing>
</bpmn:scriptTask>

Notes

Script tasks execute synchronously inside the engine — they are not suitable for I/O-bound work (HTTP calls, database queries). For those use cases, use a Service Task instead.