In this post, I share how I automated the forwarding of messages from a WhatsApp group to a channel using n8n, Docker, and the WAHA library. I set everything up on an old laptop I use as a local server. The goal is to make it easier to manage a ridesharing group between Zamora and Salamanca, which had reached its participant limit.



# filepath: ./docker-compose.yml
version: '3'
services:
waha:
image: devlikeapro/whatsapp-http-api
restart: always
ports:
- "3000:3000"
environment:
- WHATSAPP_API_KEY=XXXX
- WAHA_DASHBOARD_USERNAME=XXXX
- WAHA_DASHBOARD_PASSWORD=XXXX
- WHATSAPP_DEFAULT_ENGINE=WEBJS
- WAHA_PRINT_QR=False
- WAHA_MEDIA_STORAGE=LOCAL
- WHATSAPP_FILES_LIFETIME=0
- WHATSAPP_FILES_FOLDER=/app/.media
- WHATSAPP_RESTART_ALL_SESSIONS=True
- WAHA_AUTO_START_DELAY_SECONDS=0
- WHATSAPP_HOOK_URL=https://MY-DOMAIN/webhook/22ad9ac5-be66-XXXX-XXXX-XXXXXXXXX/waha
- WHATSAPP_HOOK_EVENTS=message,state.change
n8n:
image: n8nio/n8n
restart: always
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=true
# ...otras variables necesarias...
volumes:
- ./n8n-data:/home/node/.n8n
This automation has reduced manual effort and made the group much more useful for everyone. If you have a large group and need to automate repetitive tasks, I encourage you to try n8n and Docker.
Would you like to see the full n8n workflow or need help configuring WAHA? Leave your questions in the comments.