Skip to main content

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:

  1. Go to WorkflowsAdd Action
  2. Select Send Webhook
  3. Configure:
    • URL: https://your-system.com/api/webhook
    • Method: POST
    • Headers: Authorization: Bearer YOUR_TOKEN
    • Body:
    {
    "leadName": "{{firstName}} {{lastName}}",
    "email": "{{email}}",
    "score": "{{leadScore}}"
    }

Incoming Webhooks

Trigger workflows from external systems:

  1. Go to SettingsWebhooks
  2. Click Create Webhook
  3. Copy the webhook URL
  4. Configure in your external system
  5. 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

  1. Go to WorkflowsAdd Action
  2. Select Run Script
  3. 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 email
  • sendSMS(to, message) - Send SMS
  • createTask(title, assignee) - Create task
  • updateLead(leadId, data) - Update lead
  • log(message) - Write to logs

A/B Testing

Test different approaches to optimize performance.

Creating Tests

  1. Go to WorkflowsA/B Tests
  2. Click Create Test
  3. 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