Variables
The Variables block updates workflow variables during execution. Variables must first be initialized in your workflow's Variables section, then you can use this block to update their values as your workflow runs.

Access variables anywhere in your workflow using <variable.variableName> syntax.
Overview
The Variables block enables you to:
Update workflow variables: Change variable values during execution
Store dynamic data: Capture block outputs into variables
Maintain state: Track counters, flags, and intermediate results
How to Use Variables
1. Initialize in Workflow Variables
First, create your variables in the workflow's Variables section (accessible from the workflow settings):
customerEmail = ""
retryCount = 0
currentStatus = "pending"2. Update with Variables Block
Use the Variables block to update these values during execution:
customerEmail = <api.email>
retryCount = <variable.retryCount> + 1
currentStatus = "processing"3. Access Anywhere
Reference variables in any block:
Agent prompt: "Send email to <variable.customerEmail>"
Condition: <variable.retryCount> < 5
API body: {"status": "<variable.currentStatus>"}Example Use Cases
Loop Counter and State
Scenario: Track progress through loop iterations
- Initialize in workflow: itemsProcessed = 0,lastResult = ""
- Loop iterates over items
- Inside loop: Agent processes current item
- Inside loop: Variables updates itemsProcessed = <variable.itemsProcessed> + 1
- Inside loop: Variables updates lastResult = <agent.content>
- Next iteration: Access <variable.lastResult>to compare with current result
Retry Logic
Scenario: Track API retry attempts
- Initialize in workflow: retryCount = 0
- API block attempts request
- If failed, Variables increments: retryCount = <variable.retryCount> + 1
- Condition checks if <variable.retryCount>< 3 to retry or fail
Dynamic Configuration
Scenario: Store user context for workflow
- Initialize in workflow: userId = "",userTier = ""
- API fetches user profile
- Variables stores: userId = <api.id>,userTier = <api.tier>
- Agent personalizes response using <variable.userTier>
- API uses <variable.userId>for logging
Outputs
- <variables.assignments>: JSON object with all variable assignments from this block
Best Practices
- Initialize in workflow settings: Always create variables in the workflow Variables section before using them
- Update dynamically: Use Variables blocks to update values based on block outputs or calculations
- Use in loops: Perfect for tracking state across iterations
- Name descriptively: Use clear names like currentIndex,totalProcessed, orlastError
