Tags are the programming logic of your workflow’s text and data transformations. They allow you to create conditional blocks and loops to handle data dynamically.

if / else / elsif

This is the most common tag for conditional logic. It lets you execute a block of text only if a certain condition is met.

Operators

  • == (equals)
  • != (does not equal)
  • > (greater than)
  • < (less than)
  • >= (greater than or equal to)
  • <= (less than or equal to)
  • and (logical AND)
  • or (logical OR)
  • contains (checks for a substring in a string, or a value in an array)
{% if node_1.item_count > 10 %}
  You have many items.
{% endif %}

unless

unless is the opposite of if. It executes a block of code only if a condition is not met.
{% unless node_1.is_active == true %}
  This user is inactive.
{% endunless %}

case / when

The case tag creates a switch statement to compare a variable against a series of values. It’s a cleaner way to write a long chain of elsif statements.
{% case node_1.plan_type %}
  {% when "free" %}
    Plan is Free Tier.
  {% when "pro" %}
    Plan is Professional.
  {% when "enterprise" %}
    Plan is Enterprise.
  {% else %}
    Plan is unknown.
{% endcase %}

for

The for tag lets you loop through each item in an array (a list). This is incredibly useful for creating reports or formatted lists.

Basic Loop

User List:
{% for user in node_1.users %}
- {{ user.name }} ({{ user.email }})
{% endfor %}

Special Loop Variables

Inside a for loop, you have access to special variables to get information about the loop’s progress:
  • forloop.index: The current iteration of the loop (1-based).
  • forloop.first: Returns true if it’s the first iteration.
  • forloop.last: Returns true if it’s the last iteration.
  • forloop.length: The total number of items in the array.

Handling Empty Arrays

You can use an {% else %} block inside a for loop that will only be executed if the array is empty.
{% for user in node_1.users %}
  - {{ user.name }}
{% else %}
  No users found.
{% endfor %}