Variables & Template Strings
ReplyWolf uses {{double curly braces}} to insert dynamic values into messages, prompts, and other text fields. When a flow runs, these placeholders are replaced with real data from your contacts, incoming messages, AI outputs, and more.
Contact Fields
Any column from your contact table can be used as a variable. If your table has columns called name, phone, and company, you can write:
Hi {{name}}, thanks for choosing {{company}}!
Common contact field variables:
| Variable | Description |
|---|---|
{{name}} | Contact's name |
{{phone}} | Contact's phone number |
{{email}} | Contact's email address |
These are not hardcoded -- they match whatever columns exist in your contact table. If you have a column called plan or appointment_date, you can use {{plan}} or {{appointment_date}}.
Incoming Message Data
When a flow is triggered by an incoming WhatsApp message, these variables are available:
| Variable | Description |
|---|---|
{{incoming_message}} | The text body of the incoming message |
{{sender_phone}} | The phone number of the person who sent the message |
{{media_type}} | The type of media attached (image, video, audio, document), if any |
Chat History
| Variable | Description |
|---|---|
{{chat_history}} | Formatted recent messages with the contact (from a Get Chat History node) |
{{message_count}} | Number of messages fetched by the Get Chat History node |
The {{chat_history}} variable is particularly useful in AI prompts. It gives the AI context about the conversation so far.
AI Outputs
| Variable | Description |
|---|---|
{{ai_reply}} | The text generated by an AI Response node |
{{classification}} | The category chosen by an AI Classify node |
{{extracted}} | The value pulled out by an AI Extract node |
When multiple AI nodes exist in a flow, these variables return the output from the most recent one.
Date & Time
| Variable | Description |
|---|---|
{{today}} | Current date in DD-MM-YYYY format (in your configured timezone) |
{{today_dm}} | Current date in DD-MM format |
{{now}} | Current date and time in ISO format |
{{timestamp}} | Current Unix timestamp in milliseconds |
HTTP / API Call Outputs
After an API Call node runs, these variables are available:
| Variable | Description |
|---|---|
{{http_response}} | The full response body as text |
{{http_status}} | The HTTP status code (200, 404, 500, etc.) |
{{http_ok}} | Whether the request succeeded (true/false) |
{{http_data}} | Parsed JSON response -- use with the json_get filter |
Flow Context
| Variable | Description |
|---|---|
{{flow_id}} | The unique ID of the current flow |
{{execution_id}} | The unique ID of the current execution |
{{account_id}} | The WhatsApp account ID |
{{random_id}} | A random UUID (useful for unique identifiers) |
Custom Variables
Use the Set Variable node to define your own variables during a flow. Access them with the variables. prefix:
| Variable | Description |
|---|---|
{{variables.myVar}} | A variable you set earlier in the flow |
Step-Specific Outputs
If a flow has multiple nodes of the same type (e.g., two AI Response nodes), you can reference a specific node's output using its step name. Each node gets an auto-generated step name that you can customize in the config panel.
{{ai_1.ai_output}}
{{http_1.http_response}}
The format is {{stepName.fieldName}}.
Putting It All Together
Here is an example message template that combines several variable types:
Hi {{name}}, thank you for your message: "{{incoming_message}}"
{{ai_reply}}
Best regards,
Your Support Team
And here is an AI system prompt that uses chat history and contact data:
You are a support agent for {{company}}.
The customer's name is {{name}} and their plan is {{plan}}.
Recent conversation:
{{chat_history}}
Pipe Filters
You can transform variable values using pipe filters with the | syntax:
{{name | upper}} → JOHN DOE
{{name | lower}} → john doe
{{name | slice(0, 5)}} → John
{{amount | add(10)}} → 110
{{date | format_date(DD/MM/YYYY)}} → 15/03/2026
{{status | default(active)}} → active (if status is empty)
Available filters include:
String: upper, lower, trim, length, default, if_empty, slice, replace, split, url_encode, base64
Math: add, subtract, multiply, divide, round, floor, ceil, abs, mod
Date: add_days, subtract_days, format_date, days_until, days_since
Boolean: not_empty, equals, contains
JSON: json_get -- extract a value from a JSON string (e.g., {{http_data | json_get(result.name)}})
Where Variables Are Used
You can use {{variables}} in the following places:
- Send Message -- message body
- AI Response -- system prompt and user prompt
- AI Classify -- input text and system prompt
- AI Condition -- condition prompt
- AI Extract -- input text and system prompt
- API Call -- URL, headers, and request body
- Send Email -- recipient, subject, and body
- Send Template -- variable mappings
- Update Row -- field value templates
- Set Variable -- value template
What Happens With Missing Variables
If a variable doesn't exist at runtime (for example, a contact doesn't have an email field), it resolves to an empty string. The {{placeholder}} text is not left in the output -- it just becomes blank. Use the default filter to provide a fallback value:
{{email | default(no email on file)}}