Notumation
Building Flows

Variables & Templates

Pass data between steps using template variables.

What Are Template Variables?

Template variables let you pass data from one step to another inside a flow. They use double curly braces: {{trigger.Name}}, {{stepName.property}}, or {{var.KEY}}. You can insert them into any text field in the flow builder.

Trigger Data

Every trigger provides data about the event that started the flow. Access it with the trigger prefix:

  • {{trigger.page_id}} — the unique ID of the page that triggered the flow
  • {{trigger.Name}} — shorthand for reading the Name (title) property of the trigger page
  • {{trigger.Status}} — shorthand for any property by name
  • {{trigger.properties.Name.title}} — full path for advanced access to nested property data

For webhook triggers, use {{trigger.body}} to access the incoming JSON payload, and {{trigger.body.fieldName}} for specific fields.

For the bot_mentioned trigger, {{trigger.block_text}} contains the full text of the block where @Notumation was mentioned. You also get {{trigger.block_id}} and {{trigger.block_type}}.

Step Results — Every Step Outputs Data

Every step in a flow produces output data that downstream steps can access. This works automatically — you don’t need to do anything special.

Referencing by Name (saveAs)

Set the Save result as field on any step to give it a name. Then reference it in later steps:

  • {{savedName}} — the full result object
  • {{savedName.id}} — the page ID (for steps that return a Notion page)
  • {{savedName.Name}} — a property from the result page
  • {{savedName.status}} — specific output fields (e.g., HTTP status from call_api)

Referencing by Step ID

Every step has an auto-generated ID like step-1, step-2, etc. You can use these even without setting “Save result as”:

  • {{step-1}} — the full result of step 1
  • {{step-1.id}} — a field from step 1’s result
  • {{step-2.body}} — the response body from an HTTP request in step 2

What Each Step Type Returns

Page operations (create_page, update_page, archive_page, restore_page, duplicate_page, move_page, set_icon, set_relation): Return the full Notion page object — you can access any property by name.

Query operations (query_database): Returns count and rows. Use in a For Each loop or access {{rows.count}}.

Search (search_pages): Returns count and pages array with id, title, and properties.

Lookup: Returns the full page object including id, found, and all properties.

Get Property: Returns value, propertyName, and type.

HTTP Request (call_api): Returns status, headers, and body.

Run Code (run_js): Returns whatever value your JavaScript code returns.

Set Variable: Returns variableName and value.

List Comments: Returns count and comments array.

Get Users: Returns count and users array with id, name, email, type.

Switch/Case: Returns expression (resolved), matchedCase (index), and matched (boolean).

Two Identical Steps Don’t Collide

If you have two steps of the same type (e.g., two “Set Variable” steps), they don’t overwrite each other. Each step has a unique ID (step-1, step-2), and named variables (saveAs) are controlled by you — just give them different names.

Stored Variables

Stored variables are persistent key-value pairs you create in the Settings page. Reference them with the var prefix:

  • {{var.SLACK_WEBHOOK_URL}} — a saved webhook URL
  • {{var.DEFAULT_ASSIGNEE}} — a default user name
  • {{var.API_KEY}} — a stored API key

Stored variables are useful for values you reuse across multiple flows. See Stored Variables for full details.

Where to Use Variables

You can insert template variables into any text field in the flow builder, including:

  • Property values in Update Page and Create Page actions
  • Search queries in Query Database and Search Pages
  • URLs and headers in HTTP Request actions
  • Comment text in Add Comment
  • Variable values in Set Variable
  • Messages in Log Message
  • Case expressions in Switch/Case
  • JavaScript code in Run JavaScript (via the ctx global)

Click the { } button next to any text field to open the variable picker. It shows all available variables from the trigger and every previous step, organized by step with their specific output fields.

Chaining Example

Here is a practical example of passing data through multiple steps:

  1. Trigger: Row Added on Tasks database — gives you {{trigger.Name}} and {{trigger.Project}}
  2. Set Variable: Store pageName = “Task: {{trigger.Name}}”
  3. Query Database: Find the project page where Name equals {{trigger.Project}}. Save result as project.
  4. Update Page: Update {{project}} — set Task Count to {{project.Task Count}} + 1
  5. Add Comment: Comment on {{project}} with text “New task added: {{pageName}}”
  6. Log Message: Log “Processed task {{trigger.Name}} for project {{project.Name}}” at info level

Each step feeds data into the next, letting you build powerful multi-step workflows without writing code.