Skip to content

[One-Time] Recovery Message to Samahani Users

A one-time recovery workflow that sends personalized messages to 47 specific users who received "samahani" (apology) messages but haven't replied, informing them that technical issues have been resolved and they can resume submitting their sales data.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

This workflow appears to be part of a customer recovery effort, targeting users who experienced service disruptions. The workflow sends personalized messages in Swahili to users via their preferred communication channel (WhatsApp or SMS), letting them know that "Sifa" (likely a service or system) had minor issues that are now resolved and they can continue with their activities.

How It Works

  1. Manual Trigger: The workflow starts when manually triggered by an operator
  2. Load User List: A hardcoded list of 47 users is loaded, each with their phone number, name, and preferred communication channel
  3. Process in Batches: Users are processed one by one through a loop
  4. Channel Detection: For each user, the workflow checks if their preferred channel is WhatsApp or SMS
  5. Send WhatsApp Message: If the user prefers WhatsApp, a message is sent via Twilio
  6. Send SMS Message: If the user prefers SMS, a message is sent via Africa's Talking API
  7. Continue Loop: The process continues until all 47 users have been contacted

Workflow Diagram

graph TD
    A[Send Recovery Messages] --> B[User List]
    B --> C[Loop Users]
    C --> D{Is WhatsApp?}
    D -->|Yes| E[Send WhatsApp]
    D -->|No| F[Send SMS Shortcode 24436]
    E --> C
    F --> C
    C --> G[Complete]

Trigger

Manual Trigger: This workflow must be started manually by an operator. It's designed as a one-time execution to handle a specific recovery scenario.

Nodes Used

Node Type Node Name Purpose
Manual Trigger Send Recovery Messages Starts the workflow when manually executed
Code User List Contains hardcoded list of 47 users with phone numbers, names, and preferred channels
Split in Batches Loop Users Processes users one by one in a loop
If Is WhatsApp? Routes users to appropriate messaging service based on their preferred channel
Twilio Send WhatsApp Sends WhatsApp messages via Twilio API
HTTP Request Send SMS Shortcode 24436 Sends SMS messages via Africa's Talking API

External Services & Credentials Required

Twilio (WhatsApp Messages)

  • Credential: twilioApi (ID: dEOy4AckE29MTkk3)
  • Purpose: Sending WhatsApp messages
  • From Number: +254203892316

Africa's Talking (SMS Messages)

  • API Key: Required for SMS sending
  • Username: toll_free_sms_ke
  • Shortcode: 24436
  • Purpose: Sending SMS messages to users who prefer SMS over WhatsApp

Environment Variables

No environment variables are used in this workflow. All configuration is hardcoded, including: - User list (47 users) - Message content - API credentials - Phone numbers and shortcodes

Data Flow

Input

  • Trigger: Manual execution (no input data required)
  • User Data: Hardcoded list containing:
    • phone: User's phone number (Kenyan format +254...)
    • name: User's first name
    • channel: Preferred communication method ("WhatsApp" or "SMS")

Output

  • WhatsApp Messages: Sent via Twilio to users preferring WhatsApp
  • SMS Messages: Sent via Africa's Talking to users preferring SMS
  • Message Content: "Habari {name}! 😊 Sifa alikuwa na tatizo kidogo lakini sasa kila kitu kiko sawa. Tuko tayari kuendelea nawe! Tuma sales zako za leo ukitaka."

Processing

Each user record flows through the channel detection logic and gets routed to the appropriate messaging service while maintaining their personal information for message customization.

Error Handling

This workflow has minimal error handling: - No Retry Logic: Failed messages will not be automatically retried - No Error Notifications: Operators won't be notified of delivery failures - Manual Monitoring Required: Success/failure must be monitored through n8n execution logs - API Failures: If Twilio or Africa's Talking APIs fail, the workflow will stop at that point

Known Limitations

  • One-Time Use: Designed for a specific recovery scenario with hardcoded user list
  • No Delivery Confirmation: No tracking of message delivery success/failure
  • Hardcoded Data: User list and message content cannot be easily modified without editing the workflow
  • No Deduplication: If run multiple times, users will receive duplicate messages
  • Limited Error Recovery: No automatic handling of API failures or rate limits

No related workflows identified from the provided context.

Setup Instructions

  1. Import Workflow: Import the JSON into your n8n instance

  2. Configure Twilio Credentials:

    • Create a Twilio credential in n8n
    • Add your Twilio Account SID and Auth Token
    • Ensure WhatsApp messaging is enabled for your Twilio number
  3. Configure Africa's Talking:

    • Obtain API key from Africa's Talking
    • Update the API key in the "Send SMS Shortcode 24436" node
    • Verify shortcode 24436 is available for your account
  4. Verify Phone Numbers:

    • Ensure the sender number (+254203892316) is configured in Twilio
    • Verify shortcode 24436 is properly set up with Africa's Talking
  5. Test Execution:

    • Run a test with a small subset of users first
    • Monitor execution logs for any API errors
    • Verify message delivery on both WhatsApp and SMS channels
  6. Execute Recovery:

    • Manually trigger the workflow when ready
    • Monitor progress through the n8n execution interface
    • Check for any failed deliveries in the logs

⚠️ Important: This is a one-time workflow. Running it multiple times will send duplicate messages to all 47 users.