Advanced Automation
Take your automation to the next level with advanced features and techniques.
Custom Variables
Use dynamic variables in your workflows to personalize interactions.
Available Variables
Lead Variables:
{{firstName}}- Lead's first name{{lastName}}- Lead's last name{{email}}- Email address{{phone}}- Phone number{{leadScore}}- Calculated lead score{{source}}- Lead source
Property Variables:
{{propertyAddress}}- Property address{{price}}- Listing price{{bedrooms}}- Number of bedrooms{{bathrooms}}- Number of bathrooms{{sqft}}- Square footage
System Variables:
{{currentDate}}- Current date{{currentTime}}- Current time{{agentName}}- Assigned agent name{{agentPhone}}- Agent phone number
Using Variables
In email templates:
Hi {{firstName}},
Thank you for your interest in {{propertyAddress}}.
This beautiful {{bedrooms}} bed, {{bathrooms}} bath home
is listed at {{price}}.
I'd love to schedule a showing for you.
Best regards,
{{agentName}}
Conditional Logic
Create complex workflows with if/then logic.
Basic Conditions
IF {{leadScore}} > 80
THEN assign to senior agent
ELSE IF {{leadScore}} > 50
THEN assign to junior agent
ELSE
THEN add to nurture campaign
Multiple Conditions
Combine conditions with AND/OR:
IF {{source}} = "Website" AND {{leadScore}} > 70
THEN send premium property list
ELSE IF {{source}} = "Referral" OR {{leadScore}} > 90
THEN assign to top agent
Time-Based Conditions
IF {{currentTime}} between 9am-5pm
THEN call lead immediately
ELSE
THEN schedule call for next business day
Webhooks
Integrate with external services using webhooks.
Outgoing Webhooks
Send data to external systems:
- Go to Workflows → Add Action
- Select Send Webhook
- Configure:
- URL:
https://your-system.com/api/webhook - Method: POST
- Headers:
Authorization: Bearer YOUR_TOKEN - Body:
{
"leadName": "{{firstName}} {{lastName}}",
"email": "{{email}}",
"score": "{{leadScore}}"
} - URL:
Incoming Webhooks
Trigger workflows from external systems:
- Go to Settings → Webhooks
- Click Create Webhook
- Copy the webhook URL
- Configure in your external system
- Map incoming data to bot fields
API Integration
Use the Realtor Bot API for custom integrations.
Authentication
All API requests require authentication:
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.realtorbot.app/v1/leads
Common Endpoints
Create Lead:
POST /v1/leads
{
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"phone": "+1234567890",
"source": "website"
}
Get Bot Status:
GET /v1/bots/{botId}/status
Trigger Workflow:
POST /v1/workflows/{workflowId}/trigger
{
"leadId": "lead_123"
}
Custom Scripts
Add custom JavaScript for advanced logic.
Script Actions
- Go to Workflows → Add Action
- Select Run Script
- Write your custom code:
// Calculate custom lead score
const score = 0;
if (lead.source === 'referral') score += 30;
if (lead.budget > 500000) score += 25;
if (lead.preApproved) score += 20;
if (lead.timeframe === 'immediate') score += 25;
return { leadScore: score };
Available Functions
sendEmail(to, subject, body)- Send emailsendSMS(to, message)- Send SMScreateTask(title, assignee)- Create taskupdateLead(leadId, data)- Update leadlog(message)- Write to logs
A/B Testing
Test different approaches to optimize performance.
Creating Tests
- Go to Workflows → A/B Tests
- Click Create Test
- Configure:
- Test Name: "Email Subject Test"
- Variant A: "Quick question about your home search"
- Variant B: "I found the perfect home for you"
- Split: 50/50
- Duration: 7 days
Analyzing Results
After the test runs:
- View open rates
- Compare click rates
- Check conversion rates
- Select winning variant
Rate Limiting
Control workflow execution frequency.
Per-Lead Limits
Prevent over-communication:
Max emails per lead: 3 per day
Max SMS per lead: 1 per day
Min time between contacts: 4 hours
Global Limits
Manage overall volume:
Max workflows per hour: 100
Max API calls per minute: 60
Max concurrent conversations: 50
Error Handling
Handle failures gracefully.
Retry Logic
Configure automatic retries:
On failure:
Retry: 3 times
Delay: 5 minutes between retries
Backoff: Exponential
If all retries fail:
Send alert to admin
Log error details
Fallback Actions
Define backup actions:
Try: Send via primary email service
On failure: Send via backup email service
On failure: Create task for manual follow-up
Best Practices
- ✅ Test thoroughly - Always test in staging first
- ✅ Monitor performance - Watch for bottlenecks
- ✅ Handle errors - Plan for failures
- ✅ Document workflows - Keep notes on complex logic
- ✅ Version control - Save workflow versions before changes