Variables
Learn how to access variables, follow valid variable naming rules, and safely use escaped names when working with FEEL expressions.
Access variables
Access the value of a variable by its variable name.
FEEL doesn't use a separate assignment operator to create or update process variables. Instead, FEEL evaluates variables that are already available in the current context, or you can define local values with context entries.
a + b
If the value of the variable is a context, a context entry can be accessed by its key.
a.b
For example, in an AI agentAI agentAn addressable execution of an LLM-driven loop with shared memory context across iterations. An agent runs an agent loop where the model decides what to do next, which tools to invoke, and when to stop. tool definition, the toolCall variable is a context holding the parameters an LLM supplies at runtime. See fromAi() for how tool parameters are declared.
If no variable exists with the given name, the expression returns null.
Use a null-check if the variable can be null or is optional.
a != null and a.b > 10
Variable names
The name of a variable can be any alphanumeric string including the _ symbol. For a combination of
words, it's recommended to use the camelCase or the snake_case format. The kebab-case format
is not allowed because it contains the operator -.
When accessing a variable in an expression, keep in mind the variable name is case-sensitive.
Restrictions of a variable name:
- It may not start with a number (e.g.
1stChoiceis not allowed; you can usefirstChoiceinstead). - It may not contain whitespaces (e.g.
order numberis not allowed; you can useorderNumberinstead). - It may not contain an operator (e.g.
+,-,*,/,=,>,<,?,.). - It may not be a literal (e.g.
null,true,false) or a keyword (e.g.function,if,then,else,for,return,between,instance,of,not,in,and,or,some,every,satisfies).
Escape variable names
Camunda Extension
If a variable name or a context key contains any special character (e.g. whitespace, dash, etc.)
then the name can be wrapped into single backquotes/backticks (e.g. `foo bar`).
`first name`
`tracking-id`
order.`total price`
Use the get value() function
to retrieve the context value of an arbitrary key.
get value(order, "total price")