Building Your First Visual Bot in SMSPort

A complete step-by-step tutorial on designing, configuring, testing, and deploying an automated WhatsApp chatbot using the SMSPort Visual Bot Builder and helper nodes.


🎯 What You Will Build

In this tutorial, you will build an Intelligent Clinic Triage & Appointment Bot that:

  1. Greets patients when they message your official WhatsApp Business number.
  2. Presents native interactive choices (In-Clinic vs Video Consultation).
  3. Looks up the patient's phone number in a Google Sheet to check if they are an existing registered patient.
  4. Uses a Condition helper node to branch:
    • Existing Patient: Dispatches a native Meta WhatsApp Flow form to confirm their appointment slot.
    • New Patient: Collects their full name and assigns a priority ticket to the front desk via Human Handoff.

πŸ—ΊοΈ Flow Architecture Overview

graph TD
    Trigger([1. Inbound Keyword Trigger: 'hi', 'book']) --> Greet[2. Ask Button: Welcome & Choose Visit Type]
    Greet -->|In-Clinic| SheetCheck[3. Google Sheets: Lookup Phone Number]
    Greet -->|Video Call| TelehealthMsg[Send Text: Video Call Payment Link]
    SheetCheck -->|success| FlowForm[4. Send WhatsApp Flow: Select Slot Form]
    SheetCheck -->|not_found| AskName[5. Ask Text: What is your full name?]
    AskName --> Handoff[6. Human Handoff: Register New Patient]

Step 1: Create a New Bot Canvas

  1. Log into your SMSPort Web Console: https://smsport.in.
  2. In the left navigation menu, click Chatbot > Visual Bot Builder.
  3. Click the blue + Create Bot button in the top right.
  4. Enter your bot details:
    • Bot Name: Apollo Clinic Triage Bot
    • Description: Automated patient intake, Google Sheets verification, and slot booking.
  5. Click Create Canvas. You will be presented with the infinite drag-and-drop workspace.

Step 2: Configure the Inbound Trigger

Every bot starts with a Trigger Card:

  1. Click on the default Inbound Trigger card on the canvas.
  2. In the right-side Inspector panel:
    • Trigger Type: Select Keyword / Exact Match.
    • Keywords: Enter hi, hello, book, appointment, doctor, clinic.
    • Channel: Select your connected Meta WhatsApp Phone Number (e.g. +91 98765 43210).

Step 3: Add the Greeting & Quick Reply Choices

  1. From the left sidebar node palette, drag an Ask Button card onto the canvas.
  2. Connect the output wire of the Trigger card into the top input port of the Ask Button card.
  3. Configure the inspector fields:
    • Prompt / Body Text:
      Welcome to Apollo City Clinic! πŸ₯
      How would you like to consult with our medical specialists today?
    • Buttons:
      • Button 1: In-Clinic Visit
      • Button 2: Video Call
    • Store Choice In Variable: visit_type

Step 4: Look Up Patient in Google Sheets

  1. Drag a Google Sheets card onto the canvas.
  2. Connect the In-Clinic Visit handle from the Ask Button card into the Google Sheets card.
  3. Configure the Google Sheets inspector fields:
    • Select Google Account: Choose your connected OAuth account.
    • Spreadsheet Document ID: Copy the ID from your Google Sheet URL:
      https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit
      Paste: 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms
    • Sheet Tab Name: RegisteredPatients
    • Action / Operation: get_rows
    • Lookup Variable: {{contact.phone}}
    • Key Column: Phone
    • Result Column: PatientName
    • Output Variable Name: patient_name

Step 5: Handle Existing Patients (WhatsApp Flow)

  1. Drag a Send WhatsApp Flow card onto the canvas.
  2. Connect the success handle of the Google Sheets card into this card.
  3. Configure the inspector fields:
    • Flow ID: Select your approved Meta Flow (e.g. Slot Selection Form).
    • Body Text:
      Welcome back, {{patient_name}}!
      Please tap the button below to pick your doctor and preferred time slot:
    • Button Label (CTA): Select Slot

Step 6: Handle New Patients & Human Escalation

  1. Drag an Ask Text card onto the canvas.
  2. Connect the not_found handle of the Google Sheets card into this card.
    • Prompt: "We could not find an existing record with your phone number. Could you please share your full name for registration?"
    • Output Variable: new_patient_name
  3. Drag a Human Handoff card onto the canvas.
  4. Connect the output of the Ask Text card into Human Handoff:
    • Notice to Customer: "Thank you {{new_patient_name}}. We have notified our front desk team to open your medical chart. An agent will reply momentarily!"
    • Department: General Reception
    • Priority: Normal
    • Tags: new_registration

Step 7: Test in the Realtime Simulator

Before activating your bot on live customer numbers, use the built-in SMSPort simulator:

  1. Click the Run Simulator (β–Ά) button in the top toolbar.
  2. The interactive chat drawer will slide open on the right.
  3. Type: hi and press Enter.
  4. The bot will send your greeting and display the two interactive buttons.
  5. Tap In-Clinic Visit.
  6. Watch the canvas highlight the executed cards in green:
    • The Google Sheets node executes and checks the simulated phone number.
    • The simulator transitions to the respective success or not_found branch!

Step 8: Publish to Production

  1. Click Save Draft in the top right.
  2. Review the validation check (ensure 0 disconnected wires or missing required parameters).
  3. Click Publish Bot.
  4. Your bot is now active and answering live WhatsApp customers 24/7!