# Workflow Automation

WhatSnap's workflow automation capabilities allow you to create sophisticated WhatsApp messaging sequences, automated responses, and complex business logic using GoHighLevel's powerful workflow system. The level of automation available depends on your WhatSnap configuration.

{% hint style="success" %}
**Maximum Automation**: Using SMS channel override provides the most comprehensive workflow automation capabilities with WhatSnap.
{% endhint %}

## Understanding GoHighLevel SMS Actions

Before diving into WhatSnap integration, it's essential to understand the full scope of SMS capabilities in GoHighLevel workflows. These powerful features become even more impactful when channeled through WhatsApp via WhatSnap's SMS override.

### Complete GHL SMS Action Capabilities

{% tabs %}
{% tab title="Send SMS Action" %}
\*\*Automated Message Dispatch\*\*

The **Send SMS** action is GHL's primary automated messaging tool, offering comprehensive customization:

**Core Features:**

* **Dynamic Personalization**: Use merge fields like `{{contact.first_name}}`, `{{contact.company}}`, `{{contact.custom_field}}`
* **Rich Content Support**: Include attachments via URLs (images, documents, videos)
* **Template Integration**: Save and reuse message templates for consistency
* **Conditional Content**: Show/hide message parts based on contact data
* **AI-Powered Generation**: Use GHL's AI assistant to generate contextual messages
* **Timing Control**: Schedule messages or set delays between actions
* **Testing Capabilities**: Preview and test messages before deployment

**Advanced Personalization Options:**

```
Hi {{contact.first_name}},

{% if contact.company %}
Thanks for {{contact.company}}'s interest in our services!
{% else %}
Thanks for your personal interest in our services!
{% endif %}

Your appointment is scheduled for {{appointment.date}} at {{appointment.time}}.

{% if contact.timezone != "EST" %}
(That's {{appointment.local_time}} in your local timezone)
{% endif %}

Best regards,
{{user.first_name}}
{{user.company}}
```

{% endtab %}

{% tab title="Manual SMS Action" %}
**Human-in-the-Loop Messaging**

The **Manual SMS** action creates tasks for team members to send personalized messages:

**Key Capabilities:**

* **Task Generation**: Creates actionable tasks in GHL's Manual Actions queue
* **Context Preservation**: Includes conversation history and contact details
* **Assignment Control**: Route tasks to specific team members
* **Priority Setting**: Mark urgent messages for immediate attention
* **Template Suggestions**: Provide message templates for consistency
* **Approval Workflows**: Require manager approval for sensitive communications
* **Deadline Management**: Set response time requirements

**Manual Action Task Structure:**

* **Contact Information**: Full contact profile and history
* **Suggested Message**: AI-generated or template-based message draft
* **Context Notes**: Background information and conversation context
* **Action Deadline**: When the message should be sent
* **Assigned User**: Team member responsible for sending
* **Priority Level**: Normal, urgent, or critical classification
  {% endtab %}

{% tab title="Internal Notifications" %}
**Team Communication System**

SMS-based internal notifications keep teams informed and coordinated:

**Notification Triggers:**

* **New Lead Alerts**: Notify sales team of qualified prospects
* **Escalation Warnings**: Alert managers to support issues
* **Goal Achievements**: Celebrate team wins and milestones
* **System Events**: Technical alerts and status updates
* **Performance Metrics**: Daily/weekly summary reports

**Advanced Notification Features:**

* **Role-Based Routing**: Send notifications to relevant team members only
* **Escalation Chains**: Automatic escalation if initial notification ignored
* **Batch Notifications**: Group similar alerts to reduce noise
* **Custom Formatting**: Rich formatting for clear, actionable notifications
* **Reply Handling**: Allow team members to respond directly via SMS/WhatsApp

**Example Internal Notification:**

```
🔥 HOT LEAD ALERT 🔥

Contact: {{contact.first_name}} {{contact.last_name}}
Company: {{contact.company}}
Lead Source: {{lead_source}}
Interest Level: {{custom_field.interest_level}}/10
Budget: {{custom_field.budget_range}}

Qualification Notes:
{{custom_field.qualification_notes}}

Action Required: Call within 15 minutes
Assigned to: {{assigned_user.first_name}}

Contact Details: {{contact.phone}}
CRM Link: {{contact.crm_url}}
```

{% endtab %}
{% endtabs %}

## SMS Channel Override: Complete WhatsApp Integration

When WhatSnap overrides your SMS channel, every GHL SMS capability becomes a WhatsApp superpower:

### Enhanced WhatsApp Capabilities Through SMS Override

{% tabs %}
{% tab title="Automated WhatsApp Actions" %}
**All SMS Actions → WhatsApp Messages**

* **Send SMS** → Send WhatsApp messages with rich media
* **Manual SMS** → Create WhatsApp message tasks for team members
* **Internal Notifications** → Team alerts via WhatsApp
* **Conditional Logic** → Smart branching based on WhatsApp responses
* **Wait for Reply** → Pause workflows until WhatsApp response
* **Bulk Actions** → Mass WhatsApp messaging campaigns
* **Scheduled Messages** → Time-delayed WhatsApp delivery

**Rich Media Enhancement:**

```
Original SMS: "Check out our new product: https://link.com/product"

WhatsApp Enhancement via Override:
- Image thumbnail auto-generated
- Link preview with description
- Interactive buttons (if supported)
- Delivery confirmations
- Read receipts
- Typing indicators
```

{% endtab %}

{% tab title="Advanced Workflow Triggers" %}
**WhatsApp-Specific Triggers via SMS Override**

* **WhatsApp Received**: Any incoming WhatsApp message
* **WhatsApp Reply**: Response to specific workflow messages
* **WhatsApp Keyword**: Keyword detection in WhatsApp messages
* **WhatsApp Opt-In/Out**: Subscription management via WhatsApp
* **WhatsApp Read Receipt**: Message read confirmations
* **WhatsApp Delivery Status**: Failed/delivered message tracking
* **WhatsApp Media Received**: Image, video, or document uploads

**Advanced Trigger Conditions:**

```
Trigger: WhatsApp Keyword "HELP"
Conditions:
- Message received between 9 AM - 6 PM
- Contact has tag "customer"  
- Not contacted in last 24 hours
- WhatsApp account = "whatsnap-account-support"

Action: Route to appropriate support specialist
```

{% endtab %}

{% tab title="Seamless Integration Benefits" %}
**Zero Configuration Advantage**

* **Instant Activation**: All existing SMS workflows work immediately
* **No Workflow Changes**: Current automations continue unchanged
* **Full GHL Feature Access**: Every SMS feature available for WhatsApp
* **Unlimited Complexity**: Build sophisticated WhatsApp automation
* **Bidirectional Communication**: Full conversation capabilities
* **Team Collaboration**: Multiple team members manage WhatsApp conversations
* **Analytics Integration**: Complete reporting and performance tracking

**Migration Benefits:**

* Convert existing SMS workflows to WhatsApp instantly
* Maintain all personalization and automation logic
* Keep existing triggers and conditions
* Preserve workflow testing and optimization
* Retain all integration connections
  {% endtab %}
  {% endtabs %}

### Custom WhatSnap Channel

When using a custom WhatSnap channel, automation requires webhook integration:

{% tabs %}
{% tab title="Webhook Setup" %}
**Required Configuration**

1. **Access Webhook URLs**: Get WhatSnap webhook URLs from settings
2. **Workflow Integration**: Use webhook actions in GHL workflows
3. **Message Formatting**: Format messages for webhook delivery
4. **Response Handling**: Set up webhook triggers for responses
   {% endtab %}

{% tab title="Available Features" %}
**Webhook-Based Automation**

* **Send Messages**: Use webhooks to send WhatsApp messages
* **Trigger Workflows**: Webhook triggers for incoming messages
* **Custom Logic**: Build custom automation with webhook data
* **Integration Control**: Fine-grained control over integration behavior
  {% endtab %}

{% tab title="Setup Complexity" %}
**Additional Configuration Required**

* **Webhook URLs**: Copy and configure webhook endpoints
* **Message Format**: Learn webhook message formatting
* **Trigger Setup**: Configure webhook-based triggers
* **Testing Required**: Verify webhook functionality
  {% endtab %}
  {% endtabs %}

## Advanced SMS Action Features in WhatsApp Workflows

### AI-Powered Message Generation

GHL's AI assistant can generate contextual WhatsApp messages through SMS override:

{% tabs %}
{% tab title="AI Message Generation" %}
**Intelligent Content Creation**

The AI assistant analyzes contact data and context to generate personalized messages:

**AI Generation Process:**

1. **Context Analysis**: Reviews contact history, tags, and custom fields
2. **Tone Matching**: Adapts to your brand voice and communication style
3. **Personalization**: Includes relevant contact-specific information
4. **Goal Alignment**: Focuses on your specified call-to-action
5. **Compliance Check**: Ensures messages follow messaging best practices

**AI Prompt Examples:**

```
"Generate a follow-up message for a dental appointment reminder"
→ AI creates: "Hi {{contact.first_name}}! Just a friendly reminder about your dental cleaning appointment tomorrow at {{appointment.time}}. Please reply CONFIRM or call us at {{business.phone}} if you need to reschedule. See you soon! 😊"

"Create a nurturing message for a real estate lead"
→ AI creates: "Hi {{contact.first_name}}, I hope you're doing well! I wanted to check in about your home search in {{contact.city}}. I've found some new listings that match your criteria for {{custom_field.price_range}}. Would you like me to send them over?"
```

**AI Customization Options:**

* **Industry Templates**: Pre-trained for specific business types
* **Tone Settings**: Professional, casual, friendly, urgent
* **Length Control**: Brief, standard, or detailed messages
* **CTA Integration**: Automatic call-to-action suggestions
* **Compliance Mode**: TCPA/CAN-SPAM compliant messaging
  {% endtab %}

{% tab title="Conditional Content Logic" %}
\*\*Dynamic Message Adaptation\*\*

Create messages that adapt based on contact data and behavior:

**Advanced Conditional Examples:**

```liquid
Hi {{contact.first_name}},

{% if contact.tags contains "vip-customer" %}
As one of our VIP customers, you get early access to our new service!
{% elsif contact.tags contains "new-lead" %}
Welcome! We're excited to help you with your {{custom_field.service_interest}}.
{% else %}
Thanks for your continued interest in our services.
{% endif %}

{% assign days_since_last_contact = "now" | date: "%s" | minus: contact.last_contacted | divided_by: 86400 %}
{% if days_since_last_contact > 30 %}
It's been a while since we last spoke - I wanted to check in and see how things are going.
{% elsif days_since_last_contact > 7 %}
Hope you've had a great week!
{% endif %}

{% if contact.birthday and contact.birthday == "today" %}
🎉 Happy Birthday! We hope you have a wonderful day!
{% endif %}

Best regards,
{{user.first_name}}
```

**Conditional Logic Capabilities:**

* **Tag-Based Content**: Different messages for different customer segments
* **Date Calculations**: Time-sensitive content based on dates
* **Custom Field Logic**: Adapt content based on contact properties
* **Behavioral Triggers**: Content based on past actions
* **Geographic Personalization**: Location-specific messaging
  {% endtab %}

{% tab title="Rich Media Integration" %}
**Enhanced WhatsApp Media via SMS Override**

Transform basic SMS attachments into rich WhatsApp media:

**Media Enhancement Features:**

```
SMS Action Setup:
Message: "Here's your invoice"
Attachment URL: https://yourdomain.com/invoice.pdf

WhatsApp Enhancement via Override:
✓ Document preview generated
✓ File size and type displayed  
✓ Download progress indicator
✓ Automatic thumbnail creation
✓ Media compression optimization
✓ Multiple format support
```

**Supported Media Types:**

* **Images**: JPG, PNG, GIF with automatic compression
* **Videos**: MP4, AVI with size optimization
* **Documents**: PDF, DOC, XLS with preview generation
* **Audio**: MP3, WAV with waveform preview
* **Contacts**: vCard format for easy saving
* **Locations**: Interactive maps with directions

**Advanced Media Workflows:**

```
Trigger: Proposal sent in CRM
Action 1: Send WhatsApp via SMS override
"Hi {{contact.first_name}}, your custom proposal is ready! 📋"
Attachment: {{opportunity.proposal_url}}

Action 2: Wait 2 hours
Action 3: Follow-up WhatsApp message
"Did you have a chance to review the proposal? I'm here to answer any questions! 💬"
```

{% endtab %}
{% endtabs %}

### Response Handling & Conversation Management

{% tabs %}
{% tab title="Wait for Reply Advanced Features" %}
**Sophisticated Response Management**

The "Wait for Reply" action offers powerful conversation control:

**Advanced Wait Configurations:**

* **Timeout Handling**: Define actions when no reply received
* **Keyword Detection**: Branch based on specific words in replies
* **Sentiment Analysis**: Route based on positive/negative responses
* **Multi-Choice Recognition**: Handle option-based responses
* **Intent Classification**: Understand what the contact really wants

**Complex Response Logic Example:**

```
Action: Send WhatsApp message
"Are you interested in scheduling a consultation? Reply YES for this week, LATER for next week, or NO if not interested."

Wait for Reply Configuration:
├─ Reply contains "YES" → Schedule immediately
├─ Reply contains "LATER" → Add to next week's campaign  
├─ Reply contains "NO" → Add to nurture sequence
├─ Reply contains "PRICE" → Send pricing information
├─ No reply after 48 hours → Send gentle follow-up
└─ Unrecognized reply → Route to human agent
```

**Response Classification Options:**

* **Explicit Keywords**: Exact word matching
* **Fuzzy Matching**: Similar words and phrases
* **Intent Recognition**: Understanding beyond keywords
* **Emoji Recognition**: React to emoji responses
* **Media Response**: Handle image/video replies
  {% endtab %}

{% tab title="DND & Compliance Management" %}
**Do Not Disturb & Compliance Features**

Respect contact preferences and maintain compliance:

**DND Management Capabilities:**

* **Automatic DND Detection**: Recognize opt-out requests
* **Time-Based DND**: Respect business hours and time zones
* **Channel-Specific DND**: WhatsApp vs SMS preference handling
* **Temporary DND**: Vacation or busy period management
* **Progressive DND**: Reduce frequency for non-responsive contacts

**Compliance Workflows:**

```
Trigger: Contact replies "STOP" or "UNSUBSCRIBE"
Actions:
1. Add tag "dnd-all-channels"
2. Remove from all active campaigns
3. Send confirmation: "You've been removed from our messages. Reply START to resume."
4. Log compliance action in contact notes
5. Notify team of opt-out

Auto-Reactivation Logic:
IF contact replies "START" or "YES"
THEN remove DND tag and send welcome back message
```

**Advanced Compliance Features:**

* **TCPA Compliance**: Time-based restrictions and consent tracking
* **GDPR Support**: Data processing consent management
* **CAN-SPAM Compliance**: Automated unsubscribe handling
* **Industry Regulations**: Healthcare (HIPAA), Finance (CFPB) compliance
* **Audit Trails**: Complete message and consent logging
  {% endtab %}

{% tab title="Team Collaboration Features" %}
**Multi-User WhatsApp Management**

Enable team collaboration through SMS override:

**Team Management Capabilities:**

* **User Assignment**: Route conversations to specific team members
* **Workload Distribution**: Balance conversations across the team
* **Escalation Paths**: Automatically route complex issues to supervisors
* **Handoff Protocols**: Seamless conversation transfers between agents
* **Coverage Management**: Handle after-hours and vacation coverage

**Advanced Team Workflows:**

```
New WhatsApp Conversation Flow:
1. Determine contact type (lead, customer, support)
2. Check team availability and workload
3. Assign to appropriate team member
4. Notify assigned agent via internal WhatsApp
5. Set response time expectations
6. Monitor and escalate if needed

Internal Team Notification:
"📞 New WhatsApp conversation assigned

Contact: {{contact.first_name}} {{contact.last_name}}
Type: {{contact.type}}
Last Contact: {{contact.last_contacted}}
Priority: {{custom_field.priority_level}}

Context: {{conversation.summary}}
Respond within: 15 minutes

View conversation: {{conversation.link}}"
```

**Collaboration Features:**

* **Internal Notes**: Team members can add private notes
* **Conversation History**: Full context available to all team members
* **Performance Tracking**: Response times and resolution rates
* **Training Integration**: New agent onboarding workflows
* **Quality Assurance**: Supervisor review and feedback systems
  {% endtab %}
  {% endtabs %}

## SMS Channel Override Workflows

### Real-World Implementation Examples

\### AI-Enhanced Welcome Sequence

**Trigger**: Contact added to specific tag (e.g., `whatsnap-account-sales`)

**Enhanced SMS Actions via WhatsApp Override:**

**Action 1**: Send SMS (AI-Generated)

* **AI Prompt**: "Create a warm welcome message for a new sales lead"
* **Generated Message**: "Hi {{contact.first\_name}}! 👋 Welcome to {{business.name}}! I'm {{user.first\_name}}, and I'm excited to help you with {{custom\_field.interest\_area}}. What's the best way I can assist you today?"
* **Attachments**: Company welcome video (auto-optimized for WhatsApp)

**Action 2**: Wait for Reply (Advanced Configuration)

* **Timeout**: 4 hours
* **Keywords**: "price", "info", "call", "schedule"
* **Sentiment Analysis**: Enabled

**Action 3**: Conditional Response

```liquid
{% if reply.sentiment == "positive" %}
That's wonderful! I can see you're excited about {{custom_field.interest_area}}. 
{% elsif reply.sentiment == "neutral" %}
I appreciate you taking the time to respond!
{% else %}
I understand this might be a lot to consider.
{% endif %}

{% if reply.keywords contains "price" %}
Let me send you our current pricing options right away.
{% elsif reply.keywords contains "call" %}
Perfect! I'd love to speak with you directly. When works best?
{% else %}
I'm here to answer any questions you might have.
{% endif %}
```

**Result**: Intelligent, conversational WhatsApp welcome sequence that adapts to each contact

\### Smart Appointment Management System

**Trigger**: Appointment created in calendar

**Advanced Workflow Sequence:**

**24 Hours Before - Confirmation Request:**

```
Send SMS Action (Enhanced for WhatsApp):
Message: "Hi {{contact.first_name}}! 📅 
Appointment reminder: {{appointment.service}} tomorrow at {{appointment.time}}

📍 Location: {{appointment.location}}
⏱️ Duration: {{appointment.duration}} minutes

Reply:
✅ CONFIRM - You're all set!
🔄 RESCHEDULE - Need a different time?
❌ CANCEL - Need to cancel?

Looking forward to seeing you!"

Attachments:
- Calendar reminder (ICS file)
- Location map image
- Preparation instructions PDF
```

**Wait for Reply with Complex Logic:**

```
Reply Processing:
├─ "CONFIRM" or ✅ → Send confirmation + preparation reminder
├─ "RESCHEDULE" or 🔄 → Route to scheduling assistant
├─ "CANCEL" or ❌ → Process cancellation + offer future booking
├─ No reply after 4 hours → Trigger follow-up sequence
├─ Questions detected → Route to human agent with context
└─ Unrecognized response → AI-powered interpretation attempt
```

**2 Hours Before - Final Reminder (if confirmed):**

```
AI-Generated Contextual Message:
"Hi {{contact.first_name}}! Your {{appointment.service}} appointment is in 2 hours. 

{% if appointment.type == "virtual" %}
Join link: {{appointment.zoom_link}}
Test your connection: {{tech_check_url}}
{% else %}
Address: {{appointment.location}}
Parking info: {{parking_instructions}}
{% endif %}

{% if custom_field.first_time_customer %}
As a first-time customer, please arrive 10 minutes early for quick paperwork.
{% endif %}

See you soon! 😊"
```

**Result**: Comprehensive appointment management with 94% show-up rates

\### Intelligent Lead Qualification Engine

**Trigger**: Contact responds to marketing campaign

**Multi-Stage Qualification Process:**

**Stage 1 - Interest Assessment:**

```
AI-Powered Initial Response:
"Thanks for your interest in {{campaign.topic}}, {{contact.first_name}}! 

I'd love to understand your specific situation better so I can provide the most helpful information.

What's your biggest challenge with {{industry_pain_point}} right now?"

Wait Configuration:
- Intent analysis enabled
- Keyword extraction active
- Sentiment monitoring on
```

**Stage 2 - Qualification Questions (Dynamic):**

```liquid
{% assign qualification_score = 0 %}

{% if reply contains "urgent" or reply contains "need help" %}
  {% assign qualification_score = qualification_score | plus: 20 %}
  Follow-up: "It sounds like this is urgent for you. When do you need a solution in place?"
{% endif %}

{% if reply contains "budget" or reply contains "cost" %}
  {% assign qualification_score = qualification_score | plus: 15 %}  
  Follow-up: "Budget is always important! What range were you considering for solving this challenge?"
{% endif %}

{% if reply contains "team" or reply contains "company" %}
  {% assign qualification_score = qualification_score | plus: 10 %}
  Follow-up: "Tell me about your team size and who else would be involved in this decision."
{% endif %}
```

**Stage 3 - Smart Routing:**

```
Qualification Score Routing:
├─ Score ≥ 60: Immediate sales team notification + booking link
├─ Score 30-59: Schedule discovery call + send case study
├─ Score 15-29: Add to nurture sequence + educational content
├─ Score < 15: Thank + add to newsletter + long-term nurture
└─ Complex/unclear response: Route to human with AI analysis
```

**Sales Team Notification (Internal SMS):**

```
"🔥 QUALIFIED LEAD - Action Required

{{contact.first_name}} {{contact.last_name}}
Score: {{qualification_score}}/100
Source: {{campaign.name}}

Key Indicators:
- Urgency: {{urgency_level}}
- Budget Indicated: {{budget_range}}
- Decision Authority: {{authority_level}}
- Timeline: {{timeline}}

Pain Points Mentioned:
{{extracted_pain_points}}

Next Action: Call within 15 minutes
Contact: {{contact.phone}}
WhatsApp: Active conversation

Full details: {{contact.crm_url}}"
```

**Result**: 73% improvement in lead quality and 45% faster sales cycle

### Advanced Workflow Examples

{% tabs %}
{% tab title="Customer Onboarding" %}
**Multi-Stage Onboarding Sequence**

```
Trigger: Customer tag added
Day 1: Welcome message + setup instructions
Day 2: Check-in + answer questions
Day 5: Tutorial resources + video links
Day 7: Success metrics + next steps
Day 14: Feedback request + support options
```

**Workflow Features:**

* **Timed sequences** with appropriate delays
* **Conditional branching** based on responses
* **Resource delivery** with attachments
* **Progress tracking** through pipeline stages
* **Support escalation** for problems
  {% endtab %}

{% tab title="Sales Follow-up" %}
**Automated Sales Nurturing**

```
Trigger: Lead status = "Interested"
Immediate: Personalized thank you + next steps
Day 1: Case study relevant to their industry
Day 3: Answer common objections
Day 5: Limited-time offer
Day 7: Social proof + testimonials
Day 10: Final follow-up + alternative solutions
```

**Workflow Features:**

* **Personalized messaging** with merge fields
* **Industry-specific content** based on tags
* **Objection handling** with educational content
* **Urgency creation** with time-sensitive offers
* **Alternative paths** for different responses
  {% endtab %}

{% tab title="Customer Support" %}
**Intelligent Support Routing**

```
Trigger: Support keyword detected
Immediate: "Thanks for reaching out! What type of help do you need?"
Response A ("Technical"): Route to tech support specialist
Response B ("Billing"): Route to billing department  
Response C ("General"): Route to general support
No Response (30 min): Send escalation message
Still No Response (2 hours): Assign to manager
```

**Workflow Features:**

* **Intelligent routing** based on request type
* **Escalation paths** for unresolved issues
* **Time-based actions** for response management
* **Department specialization** for expertise
* **Management oversight** for quality control
  {% endtab %}
  {% endtabs %}

### Command Integration in Workflows

Combine WhatSnap commands with workflows for sophisticated routing:

**Example: Marketing to Sales Handoff**

```
Trigger: Contact responds "YES" to marketing campaign
Action 1: Send SMS with command
"#switch|whatsnap-account-sales Great! I'm connecting you with our sales specialist Sarah. She'll reach out within the hour with personalized pricing."

Action 2: Wait 1 hour  
Action 3: Send SMS (now from sales account)
"Hi {{first_name}}, this is Sarah from sales. I have your pricing ready. When's a good time to discuss?"
```

**Result**: Seamless handoff with account switching and personalized follow-up

## Custom Channel Webhook Workflows

### Webhook Configuration

For users who chose the custom WhatSnap channel, webhook integration is required for automation:

{% stepper %}
{% step %}

#### Access Webhook Settings

Navigate to WhatSnap Settings → Workflow Webhooks to access your webhook URLs.
{% endstep %}

{% step %}

#### Copy Webhook URLs

Copy the provided webhook URLs for sending messages through your workflows.
{% endstep %}

{% step %}

#### Configure Workflow Actions

In your GoHighLevel workflows, use "Webhook" actions with the copied URLs.
{% endstep %}

{% step %}

#### Format Message Data

Format your webhook payload to include message content and recipient information.
{% endstep %}
{% endstepper %}

### Webhook Message Format

{% hint style="info" %}
**Webhook Documentation**: Specific webhook formatting and parameters are available in your WhatSnap dashboard under Workflow Webhooks.
{% endhint %}

**Basic Webhook Structure:**

```json
{
  "contact_id": "{{contact.id}}",
  "phone": "{{contact.phone}}",
  "message": "Your message content here",
  "account_tag": "whatsnap-account-sales"
}
```

### Webhook Workflow Examples

{% tabs %}
{% tab title="Welcome Message" %}
**Webhook-Based Welcome Sequence**

**Trigger**: Contact added to list **Action**: Webhook with payload:

```json
{
  "contact_id": "{{contact.id}}",
  "message": "Welcome {{first_name}}! Thanks for joining us. Reply with any questions.",
  "account_tag": "{{contact.whatsnap_account_tag}}"
}
```

**Result**: Automated welcome message via webhook
{% endtab %}

{% tab title="Event Notification" %}
**Event-Based Messaging**

**Trigger**: Opportunity stage changed to "Proposal Sent" **Action**: Webhook with payload:

```json
{
  "contact_id": "{{contact.id}}",
  "message": "Hi {{first_name}}, your proposal has been sent! Check your email and let us know if you have questions.",
  "account_tag": "whatsnap-account-sales"
}
```

**Result**: Automatic notification when proposal is sent
{% endtab %}

{% tab title="Command Integration" %}
**Webhook with Account Switching**

**Trigger**: Support ticket escalated **Action**: Webhook with payload:

```json
{
  "contact_id": "{{contact.id}}",
  "message": "#switch|whatsnap-account-manager Hi {{first_name}}, I'm the support manager taking over your case. I'll personally ensure this gets resolved quickly.",
  "account_tag": "whatsnap-account-support"
}
```

**Result**: Account switching via webhook with command
{% endtab %}
{% endtabs %}

## Advanced Automation Strategies

### Multi-Touch Campaign Automation

Create sophisticated campaigns that use multiple WhatsApp accounts:

{% @mermaid/diagram content="graph TD;
A\["🚀 Campaign Start"] --> B\["📢 Marketing Account Message"];
B --> C{Response?};
C -->|"✅ Yes"| D\["💼 Switch to Sales Account"];
C -->|"❌ No"| E\["⏰ Wait 3 Days"];
E --> F\["📞 Follow-up from Marketing"];
D --> G\["🎯 Sales Qualification"];
G --> H{Qualified?};
H -->|"✅ Yes"| I\["💰 Continue Sales Process"];
H -->|"❌ No"| J\["🌱 Switch to Nurture Account"];
F --> K{Response?};
K -->|"✅ Yes"| D;
K -->|"❌ No"| L\["🔚 End Campaign"];

```
classDef start fill:#e3f2fd,stroke:#1976d2,stroke-width:3px,color:#000000;
classDef marketing fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000000;
classDef sales fill:#e8f5e8,stroke:#00695c,stroke-width:2px,color:#000000;
classDef decision fill:#e1f5fe,stroke:#3f51b5,stroke-width:2px,color:#000000;
classDef nurture fill:#e8f5e8,stroke:#00695c,stroke-width:2px,color:#000000;
classDef end fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000000;

class A start;
class B,E,F marketing;
class D,G,I sales;
class C,H,K decision;
class J nurture;
class L end;" %}
```

### Conditional Account Routing

Use workflow conditions to route messages through different WhatsApp accounts:

**Example: Geographic Routing**

```
IF contact.state = "California" 
THEN send via "whatsnap-account-west-coast"
ELSE IF contact.state IN ["New York", "Florida", "Georgia"]
THEN send via "whatsnap-account-east-coast"  
ELSE send via "whatsnap-account-national"
```

### Time-Based Automation

Create workflows that consider time zones and business hours:

**Example: Business Hours Messaging**

```
Trigger: Contact requests information
IF current_time BETWEEN 9AM-6PM (contact's timezone)
THEN send immediate response
ELSE schedule message for 9AM next business day
```

## Workflow Best Practices

### Message Personalization

{% hint style="success" %}
**Personal Touch**: Use merge fields and conditional content to create personalized experiences that feel human despite being automated.
{% endhint %}

**Personalization Techniques:**

* **Name Usage**: Include first names in messages naturally
* **Context Awareness**: Reference previous interactions or purchases
* **Behavioral Triggers**: Respond to specific actions or behaviors
* **Industry Relevance**: Tailor content to contact's industry or interests

### Response Management

**Handling Responses:**

* **Wait Actions**: Use appropriate wait times for responses
* **Timeout Handling**: Plan actions for non-responsive contacts
* **Escalation Paths**: Route complex issues to human team members
* **Context Preservation**: Maintain conversation context across workflow steps

### Performance Optimization

**Optimization Strategies:**

* **A/B Testing**: Test different message variations
* **Timing Optimization**: Find optimal sending times for your audience
* **Response Analysis**: Monitor response rates and adjust accordingly
* **Workflow Analytics**: Track workflow performance and completion rates

## Testing and Monitoring

### Workflow Testing

{% stepper %}
{% step %}

#### Test Environment Setup

Create test contacts and scenarios to verify workflow behavior before production deployment.
{% endstep %}

{% step %}

#### Step-by-Step Verification

Test each workflow step individually to ensure proper functionality and message delivery.
{% endstep %}

{% step %}

#### Integration Testing

Verify that WhatSnap commands and account switching work correctly within workflows.
{% endstep %}

{% step %}

#### Performance Testing

Test workflows with realistic contact volumes to ensure system performance.
{% endstep %}
{% endstepper %}

### Monitoring and Analytics

**Key Metrics to Track:**

* **Workflow Completion Rates**: Percentage of contacts completing full workflows
* **Response Rates**: Percentage of messages receiving responses
* **Conversion Rates**: Goal completions from workflow participants
* **Time to Response**: How quickly contacts respond to automated messages

**Monitoring Tools:**

* **GHL Analytics**: Use built-in GoHighLevel reporting
* **WhatSnap Metrics**: Monitor account-specific performance
* **Custom Tracking**: Implement custom tracking for specific goals
* **Regular Audits**: Conduct periodic workflow performance reviews

## Troubleshooting Automation

### Common Workflow Issues

<details>

<summary>Messages Not Sending in Workflows</summary>

**Possible Causes:**

* WhatsApp account disconnected
* Workflow trigger conditions not met
* Contact missing required tags
* Message formatting errors

**Solutions:**

* Verify all WhatsApp accounts are connected
* Check workflow trigger conditions and test data
* Ensure contacts have appropriate WhatSnap tags
* Validate message content and formatting

</details>

<details>

<summary>Commands Not Working in Workflows</summary>

**Possible Causes:**

* Command syntax errors in workflow messages
* Target account not connected
* Workflow action formatting issues

**Solutions:**

* Verify command syntax is correct
* Check target WhatsApp account connection
* Test commands outside workflows first
* Review workflow action configuration

</details>

<details>

<summary>Wait Actions Not Functioning</summary>

**Possible Causes:**

* Using custom channel without SMS override
* Workflow timing conflicts
* Response detection issues

**Solutions:**

* Verify SMS channel override is enabled
* Check workflow timing and sequencing
* Test response detection manually
* Review wait action configuration

**Workflows not automating correctly?** Salvador can review your automation setup and get it working properly → [Chat with Salvador](https://wa.me/17543029801?text=Hey%20Salvador%2C%20my%20WhatSnap%20workflows%20aren%27t%20working%20right)

</details>

## Next Steps

After mastering workflow automation:

1. [**Outreach Campaigns**](https://github.com/WhatSnap/documentation/blob/main/outreach/campaign-overview.md) - Apply automation to mass messaging campaigns
2. [**Advanced Strategies**](https://github.com/WhatSnap/documentation/blob/main/advanced/multi-account-strategies.md) - Implement sophisticated multi-account automation
3. [**Performance Analytics**](https://github.com/WhatSnap/documentation/blob/main/settings/analytics.md) - Monitor and optimize automation performance
4. [**Team Training**](https://github.com/WhatSnap/documentation/blob/main/advanced/team-management.md) - Train your team on automation best practices

{% hint style="info" %}
**Automation Success**: Effective WhatsApp automation with WhatSnap combines understanding of workflow logic, proper account management, and strategic use of commands and timing.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whatsnap.gitbook.io/whatsnap-docs/conversations/workflow-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
