Variables & Templates

Use workflow variables and template syntax to reference data between nodes.

TogoFlow uses double-curly template syntax to reference data anywhere in node configuration — prompts, URLs, headers, function code, and more.

Template syntax

{{path.to.value}}

Common paths:

ReferenceWhat it contains
{{inputs}}Data sent when the workflow was triggered (webhook body, manual run inputs)
{{inputs.fieldName}}A specific input field
{{lastOutput}}Output from the immediately previous node
{{variables.myKey}}A workflow variable you defined
{{context}}Execution metadata (execution ID, timestamps, etc.)
{{nodeId.output}}Output from a specific node by ID

Inserting variables in the editor

Every node configuration panel has a Variables button. Click it to open the variable selector, which shows:

  • Trigger inputs
  • Outputs from upstream nodes (based on canvas connections)
  • Workflow variables
  • Loop context (loopItem, loopIndex) when inside a loop

Click any item to insert the correct {{path}} at your cursor position.

Workflow variables

Workflow variables are persistent key-value pairs attached to the workflow definition.

  1. Open a workflow and click the Variables tab in the header.
  2. Click Add Variable and set a key, value, and optional description.
  3. Reference them anywhere with {{variables.yourKey}}.

Use cases:

  • API endpoints that change per environment
  • Default email recipients
  • Brand tone or company name used in AI prompts
  • Feature flags or configuration toggles

Variables are stored in workflow metadata and travel with import/export.

Nested data access

Access nested fields with dot notation:

{{lastOutput.user.email}}
{{inputs.order.items[0].name}}

In Function node code

Inside a Function node, scope values are injected as read-only variables. You can reference them in templates before execution, or access them directly in your JavaScript:

const inputs = {{inputs}};
const lastOutput = {{lastOutput}};
const apiKey = {{variables.apiKey}};

return {
  greeting: `Hello, ${lastOutput.name}`,
  count: inputs.items.length,
};

See the Function Node guide for full details.

Tips

  • If a template resolves to undefined, check the Execution Data tab to see what the upstream node actually returned.
  • Use the variable selector instead of typing paths manually — it prevents typos.
  • Workflow variables are great for secrets you don't want hardcoded in every node (pair with organization-level API keys where possible).