Guides v1.0 2 min read

Creating Flows

Learn how to create and manage automated WhatsApp flows in Wasapia

Creating WhatsApp Flows

Learn how to create automated flows to handle WhatsApp conversations efficiently.

What is a Flow?

A flow is an automated sequence of messages and actions that are triggered when specific conditions are met. Flows help you automate conversations, collect information, and provide responses without manual intervention.

Creating Your First Flow

  1. Access Flow Builder

    • Log in to your Wasapia dashboard
    • Navigate to FlowsCreate New Flow
    • Give your flow a descriptive name
  2. Define Trigger

    • Choose what starts your flow:
      • Message received
      • Keyword detected
      • API call
      • Scheduled time
  3. Add Steps

    • Click the "+" button to add steps
    • Available step types:
      • Send message
      • Wait for response
      • Condition check
      • API call
      • Data collection

Example Flow: Welcome Message

Here's a simple flow that sends a welcome message and collects user information:

{
  "name": "Welcome Flow",
  "trigger": {
    "type": "keyword",
    "value": "start"
  },
  "steps": [
    {
      "type": "send_message",
      "message": "Welcome to our service! What's your name?"
    },
    {
      "type": "wait_response",
      "timeout": 300,
      "save_as": "user_name"
    },
    {
      "type": "send_message",
      "message": "Nice to meet you, {{user_name}}! How can we help you today?"
    }
  ]
}

Best Practices

  1. Keep it Simple

    • Start with basic flows
    • Test thoroughly before adding complexity
  2. Use Clear Messages

    • Write clear, concise instructions
    • Include call-to-action in messages
  3. Handle Timeouts

    • Set appropriate timeout values
    • Provide fallback options
  4. Test Your Flows

    • Use the test mode before publishing
    • Verify all possible paths

Flow Variables

Use variables to make your flows dynamic:

  • {{user_name}} - User's name
  • {{phone}} - User's phone number
  • {{last_message}} - Last received message
  • {{timestamp}} - Current time

Error Handling

Always include error handling in your flows:

  1. Timeout Handling

    {
      "type": "wait_response",
      "timeout": 300,
      "on_timeout": {
        "type": "send_message",
        "message": "We haven't heard from you. Please try again later."
      }
    }
    
  2. Invalid Input

    {
      "type": "condition",
      "check": "{{last_message}}",
      "on_invalid": {
        "type": "send_message",
        "message": "Sorry, I didn't understand that. Please try again."
      }
    }
    

Share this documentation

On this page