Sifa Apology Outreach (WhatsApp users via SMS)¶
This workflow sends apology messages via SMS to WhatsApp channel users who have onboarded into the Sifa coaching program. It works around WhatsApp's 24-hour messaging window limitation by using SMS delivery instead, ensuring all affected users receive the apology regardless of when they last interacted with the system.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
Based on the workflow implementation, this appears to be a crisis communication tool that allows program administrators to quickly reach out to all onboarded WhatsApp users with an apology message when system issues occur. The workflow targets users who prefer WhatsApp communication but delivers the message via SMS to bypass WhatsApp's messaging restrictions.
How It Works¶
- Manual Trigger: An administrator (likely Edith based on the notes) manually executes the workflow
- Configuration Setup: The workflow loads Africa's Talking SMS credentials and sets the outreach tag for tracking
- User Query: Fetches all WhatsApp channel users who have completed onboarding and haven't already received this specific apology
- Individual Processing: Loops through each user one at a time to avoid overwhelming the SMS service
- Message Rendering: Prepares a standardized apology message in Swahili with a WhatsApp link for future communication
- SMS Delivery: Sends the message via Africa's Talking SMS service using a toll-free sender code
- Activity Logging: Records each sent message in the chat log to prevent duplicates and maintain audit trail
- Rate Limiting: Waits 1.5 seconds between sends to respect API limits
Workflow Diagram¶
graph TD
A[Manual Trigger] --> B[Config]
B --> C[Fetch Queue]
C --> D[Loop 1 row]
D --> E[Render SMS]
E --> F[SMS Live Send]
F --> G[Log chatLog]
G --> H[Rate Limit Wait]
H --> D
D --> I[Complete]
Trigger¶
Manual Trigger: The workflow must be manually executed by an administrator. This is appropriate for crisis communication scenarios where timing and oversight are critical.
Nodes Used¶
| Node Type | Node Name | Purpose |
|---|---|---|
| Manual Trigger | Manual Trigger | Allows manual execution by administrator |
| Set | Config | Stores SMS credentials and tracking tag |
| Postgres | Fetch Queue | Queries for WhatsApp users needing apology |
| Split in Batches | Loop (1 row) | Processes users individually |
| Set | Render SMS | Prepares SMS message content |
| HTTP Request | SMS Live Send | Sends SMS via Africa's Talking API |
| Postgres | Log chatLog | Records sent messages for tracking |
| Wait | Rate Limit Wait | Prevents API rate limit violations |
External Services & Credentials Required¶
Africa's Talking SMS Service¶
- API Key: Required for authentication
- Username: Account identifier (
toll_free_sms_ke) - Sender Code: Short code for SMS sending (
24436)
PostgreSQL Database¶
- Connection: Access to tables
youthEntrepreneursReal,youthProgressReport, andchatLog - Permissions: SELECT on user tables, INSERT on chatLog table
Environment Variables¶
The workflow uses hardcoded configuration values in the Config node:
- outreach_tag: "system/apology-2026-04-25"
- at_username: "toll_free_sms_ke"
- at_sender_code: "24436"
- at_api_key: Africa's Talking API key (should be moved to credentials)
Data Flow¶
Input¶
- No external input required (manual trigger)
- Queries database for eligible users
Processing¶
- Filters for WhatsApp channel users who have onboarded
- Excludes users who already received this specific apology
- Renders Swahili apology message with WhatsApp contact link
Output¶
- SMS messages sent to eligible users
- Chat log entries for audit trail
- Estimated 7-8 minutes total runtime for ~295 users
Sample Message¶
1 | |
Error Handling¶
The workflow does not include explicit error handling nodes. Failed SMS sends or database operations will cause the workflow to stop. Consider adding error handling for: - SMS API failures - Database connection issues - Invalid phone numbers
Known Limitations¶
- Hardcoded API Key: Security risk - should use n8n credentials instead
- No Error Recovery: Failed sends will stop the entire workflow
- Fixed Message: No personalization beyond first name
- Rate Limiting: 1.5 second delays make large batches slow
- Manual Only: No automated triggering based on system events
Related Workflows¶
No related workflows identified from the provided context.
Setup Instructions¶
-
Import Workflow: Import the JSON into your n8n instance
-
Configure Database Connection:
- Set up PostgreSQL credentials named "Postgres account"
- Ensure access to required tables
-
Set Up SMS Credentials:
- Create Africa's Talking account
- Replace hardcoded API key in Config node with credential reference
- Verify sender code and username
-
Test with Small Batch:
- Modify the SQL query to add
LIMIT 5for testing - Execute manually and verify SMS delivery
- Modify the SQL query to add
-
Update Message Content:
- Modify the
preview_bodyin "Render SMS" node as needed - Update the outreach tag for new campaigns
- Modify the
-
Security Improvements:
- Move API key to n8n credentials
- Add error handling nodes
- Consider adding approval step before mass sending
-
Monitoring:
- Monitor chat log for delivery confirmation
- Check Africa's Talking dashboard for send statistics