Skip to main content

Tutorial: Lead Generation Bot

Build a bot that collects user information for marketing or sales purposes.


What We're Building

A bot that:

  1. Greets new users
  2. Asks for their name, email, and phone
  3. Stores the information
  4. Thanks them and follows up

Step 1: Welcome Trigger

Create the starting point:

  1. Add a Command Trigger
  2. Set command to /start
  3. Add a Send Message node
  4. Connect them

Message:

👋 Welcome to [Your Company]!

I'll help you get started. First, I'll need a few details.

Step 2: Collect Name

  1. Add an Ask Question node
  2. Connect it to the welcome message
  3. Configure:
    • Question: What's your name?
    • Save to: var.lead_name

Step 3: Collect Email

  1. Add another Ask Question node
  2. Connect it after the name question
  3. Configure:
    • Question: Great, {{var.lead_name}}! What's your email address?
    • Save to: var.lead_email
Validation

For production, add email validation using a regex pattern!


Step 4: Collect Phone (Optional)

  1. Add an Ask Question node
  2. Configure:
    • Question: And your phone number? (or type "skip")
    • Save to: var.lead_phone

Step 5: Thank and Confirm

  1. Add a Send Message node
  2. Configure:
✅ Thanks, {{var.lead_name}}!

Here's what we have:
📧 Email: {{var.lead_email}}
📞 Phone: {{var.lead_phone}}

Our team will contact you within 24 hours.

Step 6: Mark as Lead

  1. Add a Set Variable node
  2. Set var.is_lead to true
  3. Set var.lead_date to {{date("2006-01-02")}}

This helps you track and segment users later.


Complete Flow


Enhancements

Add a Lead Magnet

Offer something in return:

🎁 As a thank you, here's our free guide!
[📥 Download Guide](https://your-link.com)

Admin Notification

Add a Forward Message or Send Message node to notify admins:

🔔 New Lead!

Name: {{var.lead_name}}
Email: {{var.lead_email}}
Phone: {{var.lead_phone}}

Follow-up Reminder

Use a Delay node to schedule a follow-up:


Tips

Quick Wins
  • Use emojis to make messages friendly
  • Keep questions short and focused
  • Offer to skip optional fields
  • Confirm what you collected

Next Steps