Template Expressions
Loopstack uses two distinct expression syntaxes for dynamic content rendering and data access throughout your automation configurations.
Handlebars Expressions ({{ }})
Used for rendering dynamic content within text, typically in tool arguments, message content, and document templates. Template expressions are powered by Handlebars and always evaluate to strings.
transitions:
# ...
- id: next
from: signup_received
to: user_email_notified
call:
- tool: EmailTool
arguments:
subject: "Welcome {{user.name}}!"
body: |
Hello {{user.name}},
{{#if user.isPremium}}
Thank you for being a premium member!
{{else}}
Consider upgrading to premium for more features.
{{/if}}
Best regards,
The TeamLearn more about Template Expressions
JEXL Expressions (${{ }})
Used for evaluating expressions and accessing data in YAML configuration values. Powered by JEXL , these expressions support arithmetic, comparisons, ternaries, and more — while preserving the original data type.
transitions:
# ...
- id: next
from: signup_received
to: user_email_notified
call:
- tool: DataProcessingHandler
arguments:
user_id: ${{ ctx.workflow.user_id }}
input_data: ${{ inputData }} # preserves data type (object, array, etc.)
is_eligible: ${{ user.age >= 18 && user.isActive }} # evaluates to boolean
total: ${{ price - price * discount }} # evaluates to number
label: ${{ score > 90 ? "excellent" : "good" }} # ternary expressionLearn more about JEXL Expressions
Key Differences
Both syntaxes can access the same underlying data, but serve different purposes:
- Template expressions render dynamic text content with conditional logic and formatting (always outputs strings)
- JEXL expressions evaluate full expressions and inject the result into configuration parameters while preserving the original data type (string, number, object, array, boolean, null, etc.)
Last updated on