For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dashboard
User GuideDeveloper GuidesAPI Reference
User GuideDeveloper GuidesAPI Reference
  • Getting Started
    • What is Runtype?
    • Creating your account
    • Platform Keys vs. BYOK
    • Understanding the Runtype UI
    • Quickstart: Social Media Post Generator
    • Quickstart: From Agent to Chat Widget
  • Dashboard
    • What is the Dashboard?
    • Daily Executions
  • Playground
    • What is the Playground?
  • Products & Surfaces
    • What are Products?
    • What are Surfaces?
    • Creating a Product
    • Setting up a Chat Surface
    • Setting up an API Surface
    • Setting up an MCP Surface
    • Setting up an A2A Surface
    • Setting up a Slack Surface
    • MCP authentication
    • Authenticating with product API keys
    • Embedding the chat widget (script tag)
    • Embedding the chat widget (React)
    • Surface orchestration modes
    • Product views
    • Adding Capabilities to a product
    • Connecting external agents
    • How A2A works
    • Connecting to Cursor / VS Code
    • Connecting to Claude Desktop
    • Scoping API keys to capabilities
    • Auto-generated OpenAPI spec
    • Calling your API endpoints
    • Client tokens and domain restrictions
    • AI-powered theme generation
    • Widget theming and customization
    • Product versioning and status
  • Flows
    • What are Flows?
    • Creating and Editing Flows
    • Flow step types overview
    • Agent and Flow Templates
    • Using prompt steps
    • Using transform-data steps
    • Using conditional steps
    • Using fetch-url and api-call steps
    • Using record steps (upsert/retrieve)
    • Flow variables and templates
    • Flow versioning and publishing
    • Running flows in batch
    • Handling batch failures
    • Debugging flows
  • Agents
    • What are Agents?
    • Creating and configuring Agents
    • Agent tools
  • Records
    • What are Records?
    • Creating and managing records
    • Using records in flows
    • Filtering and searching records
  • Tools
    • What are Tools?
    • Built-in Tools
    • Creating custom tools
    • Creating external tools
    • Runtime tools
  • Evals
    • What are Evals?
    • Running an Eval
    • Interpreting eval results
  • Schedules
    • What are Schedules?
    • Automating batch processing
  • Logs
    • What are Logs?
    • Working with Logs
  • Integrations
    • Connecting AI model providers
    • Slack integration
    • Google Workspace integration
    • GitHub integration
    • Linear integration
    • Weaviate (vector search)
    • Firecrawl (web scraping)
    • Exa (web search)
  • Settings
    • What's in Settings?
    • Available AI models
    • What are Organizations?
    • Managing AI models
    • Managing API keys
    • Billing and plans
    • Usage data
    • Team members and permissions
    • Appearance and preferences
    • Integrations (PostHog, Weaviate, Daytona)
  • Troubleshooting & FAQ
    • FAQ
    • Rate Limits and Usage
    • Managing Runtype with Claude
    • Flow execution failures
    • Common errors and solutions
    • Authentication issues
Dashboard
LogoLogo
On this page
  • Basic syntax
  • Flow input
  • Step outputs
  • Nested properties
  • Array access
  • System variables
  • Default values
  • String concatenation
  • Calculations and conditional logic
  • Using variables in JSON
  • Debugging variables
  • Variable scope
  • Best practices
  • Next steps
Flows

Flow variables and templates

Was this page helpful?
Previous

Flow versioning and publishing

Next
Built with

Template variables let you pass data between steps and reference flow inputs using {{variable}} syntax.

Basic syntax

Reference variables with double curly braces:

{{variableName}}

This works in any text field: prompts, URLs, request bodies, conditions, etc.

Flow input

When you trigger a Flow through the API, pass values in the inputs field. Access them directly by key name:

Name: {{customerName}}
Email: {{email}}
Order ID: {{orderId}}

For record-based executions, access record metadata with the _record prefix:

Customer: {{_record.metadata.customer_name}}
Status: {{_record.metadata.status}}

Step outputs

Reference the output of earlier steps by their outputVariable name:

{{summary_result}}

If the output is a JSON object, access nested fields with dot notation:

Summary: {{generate_summary}}
Sentiment: {{analyze_sentiment.label}}
Confidence: {{analyze_sentiment.score}}

Nested properties

Use dot notation to access nested data:

{{customer_data.metadata.tier}}
{{api_response.data[0].name}}
{{_record.metadata.address.city}}

Array access

Reference array items by index:

{{search_results[0].metadata.title}}
{{search_results[1].metadata.content}}

System variables

Runtype provides system variables prefixed with _:

VariableDescriptionExample
{{_now.iso}}Current timestamp (ISO 8601, UTC)2026-01-15T10:30:00Z
{{_now.date}}Current date in execution timezone2026-01-15
{{_now.weekday}}Day of the weekWednesday
{{_now.time}}Current time (24-hour)10:30:00
{{_execution.id}}Unique ID for this Flow runexec_xxxxxx
{{_execution.timestamp}}Execution start time2026-01-15T10:30:00.000Z
{{_execution.type}}Execution typestandalone, record, batch
{{_user.id}}User who triggered the Flowuser_12345
{{_user.organizationId}}Organization of the triggering userorg_67890
{{_flow.id}}Flow IDflow_abc123
{{_flow.name}}Flow nameMy Flow
{{_record.id}}Record ID (record-based executions)rec_xyz
{{_record.metadata.field}}Record metadata fieldvaries

The _schedule variable is available only in schedule-fired executions and includes .id, .name, .cron, .timezone, .lastRunAt, and .nextRunAt.

Default values

Provide fallbacks when variables might be undefined:

{{customerId || "unknown"}}
{{customerData.tier || "standard"}}

The || operator uses truthy fallback. Use ?? for nullish fallback (only triggers on null/undefined, not empty string or 0).

String concatenation

Combine strings and variables:

Customer {{customerName}} placed order #{{orderId}} on {{_now.date}}

Calculations and conditional logic

For calculations, ternary expressions, and complex logic, use a transform-data step. The {{variable}} template syntax supports variable references and fallback chains, but not arithmetic or comparison operators.

Using variables in JSON

When building JSON request bodies or metadata:

1{
2 "customer": "{{customerId}}",
3 "summary": "{{generate_summary}}",
4 "amount": {{calculate_total}},
5 "timestamp": "{{_now.iso}}"
6}

Note: Numbers and booleans don’t need quotes. Strings do.

Variables are evaluated at runtime. If a referenced step has not executed yet, the variable will be undefined.

Debugging variables

Use a transform-data step to inspect variable values. Flow variables are available directly by their outputVariable name:

1return {
2 debug: true,
3 customer_data_value: customer_data,
4 analysis_value: analysis
5};

Check the step output in the execution results to see the returned values.

Variable scope

Variables are scoped to the Flow execution:

  • Can reference any earlier step’s outputVariable in the same Flow
  • Cannot reference variables from other Flows
  • Variables set inside conditional branches are accessible after the conditional completes

Best practices

  • Use descriptive step names: Makes variable references clearer
  • Check for null: Use defaults or conditionals when data might be missing
  • Keep nesting shallow: Deep property chains are error-prone
  • Test with real data: Ensure variables resolve correctly in all scenarios

Next steps

  • Using prompt steps for AI generation with variables
  • Using transform-data steps for complex variable manipulation
  • Using conditional steps for variable-based branching
  • Debugging flows to trace variable values