adcwangfeng/whatsapp-message-handler
Overview
This skill handles multi-module WhatsApp message reception and responses, supporting text, images, documents, locations, and more. It centralizes parsing, routing, history, and response generation to streamline automated and semi-automated WhatsApp workflows. The system is built for Node.js environments and integrates with WhatsApp Web connectors and webhook endpoints.
How this skill works
Incoming WhatsApp events are parsed to identify message type and extract structured payloads. A router dispatches each payload to the appropriate handler module (text, media, document, location), which applies business logic and builds replies. The response builder formats outbound messages and the connector sends them back via the WhatsApp channel. Built-in logging, retry, and error handling ensure delivery and traceability.
When to use it
- Automating replies to customer queries on WhatsApp
- Routing different media types to dedicated processing modules
- Collecting user feedback, forms, or attachments via WhatsApp
- Sending notifications, alerts, or transactional messages
- Integrating WhatsApp conversations into backend workflows
Best practices
- Authenticate WhatsApp Web sessions securely and refresh tokens when needed
- Validate and sanitize all incoming payloads before processing
- Store minimal message history needed for context and compliance
- Use idempotent handlers and retry logic for transient failures
- Separate heavy media processing to background jobs to keep handlers responsive
Example use cases
- Customer support bot that answers FAQs and forwards complex tickets to agents
- Automated notification service that sends delivery updates with attachments
- Feedback collector that parses form responses and attached photos
- Workflow trigger that starts order fulfillment when a structured message arrives
- Document intake system that saves and indexes user-uploaded files for compliance
FAQ
Text, images, documents, locations, and other common WhatsApp media types are parsed and routed to corresponding handlers.
How does retry and error handling work?
Handlers implement retry policies for transient errors, log failures, and surface persistent issues for manual inspection.
Does it store message history?
Yes, configurable message history storage captures minimal context for routing, analytics, and audit purposes.