Skip to content
Skip to content

Variables and expressions

During a run, Knot keeps a JSON context: previous node outputs, trigger metadata, and global variables. You read it with Mustache expressions {{ }}.

💡 Context flow

triggernode Anode Brun context{{ nodes.A.email }}{{ trigger.entity }}

Each node reads the accumulated context and adds its own output (key usually derived from the node id).

💡 Mustache syntax

PatternUsage
{{ nodes.<id>.field }}Output field from a node
{{ trigger.payload.x }}Trigger input data
{{ entity }}Current Dolibarr entity (multi-entity)

Example in an HTTP body or email field:

{
"subject": "Reminder {{ nodes.fetch_invoice.ref }}",
}

💡 Common patterns

  • Concatenation: multiple {{ }} in one string.
  • Conditions: prefer a Logic node (If/Else) over complex inline logic.
  • Defaults: stub values in Simulate to avoid empty fields while designing.

💡 Good practices

  1. Rename nodes clearly in the editor — easier to find nodes.* keys.
  2. Never store secrets in plain text — use encrypted credentials for API tokens.
  3. Simulate every branch before activating the workflow.

💡 See also