PulbotDocumentation

Variables and expressions


Variables are data that travels through the flow. Each node can read variables from previous nodes and generate new ones. {{...}} expressions are how you reference them.

When to use it

Any time you need to use data generated in a previous step: the user's message, an API result, a customer ID, etc.

Steps

  1. 1Trigger variables are available in all nodes: {{trigger.message}}, {{trigger.user_id}}, {{trigger.channel}}, etc.
  2. 2Each node generates an output. The output of a node named «get_customer» is accessed with {{get_customer.output}}.
  3. 3To reference a specific output field: {{get_customer.output.name}}
  4. 4You can declare constant variables in the canvas «Variables» section (settings icon in the bar).
  5. 5KV Store lets you save variables between executions: use the «KV Save» tool to write and «KV Get» to read.

Reference

{{trigger.*}}
Variables from the event that activated the flow. Vary by channel (WA, Telegram, Instagram).
{{node_name.output}}
Full output of the node. Use dot notation for specific fields.
{{node_name.output.field}}
Specific field from the node's output.
Global variables
Defined in the canvas Variables section. Available in all flow nodes.
KV Store
For variables that must persist between executions for the same user. Scope: per channel + user.
Expressions in strings
Mix text and variables: «Hello {{trigger.name}}, your order #{{order.output.id}} is ready.»

Common errors

{{variable}} shows literally in the response
The variable wasn't replaced because it doesn't exist in that context. Check the exact name and that the node generating it comes before this one.
Undefined output in action node
The previous node didn't generate output (it failed or returned empty). Check the execution history to see what happened.

Next step

Learn about the trigger types available per channel.

¿Necesitas ayuda?