WhatsApp Daily Market Summary Automation (AI + n8n + Twilio + Google Sheets)

Building an AI-Powered WhatsApp Market Alert System with n8n

Overview

Automate daily financial market summaries delivered directly to WhatsApp using n8n’s powerful workflow automation. This workflow scrapes multiple Indian financial news sources, generates AI-powered summaries, and broadcasts them to subscribers—all without writing complex backend code.

What This Workflow Does

This n8n workflow creates a fully automated daily market alert system that:

  • Scrapes financial news from multiple trusted sources

  • Processes and cleans data using AI

  • Generates concise, WhatsApp-friendly market summaries

  • Broadcasts personalized alerts to active subscribers

  • Logs delivery metrics for analytics

Architecture Overview

Manual Trigger → Scrape News → Process Data → AI Summary → 
Get Subscribers → Format Messages → Batch Send → Log Results

Key Components Breakdown

1. :newspaper: Multi-Source News Scraping

The workflow pulls data from three major Indian financial news sources:

  • Moneycontrol - Business & stocks news

  • ET Markets - Economic Times markets section

  • LiveMint - Stock market news

Implementation: Uses dynamic CSS selectors for each source to extract headlines, links, and summaries.

{
  name: 'Moneycontrol',
  url: 'https://www.moneycontrol.com/news/business/stocks/',
  containerSelector: 'ul',
  titleSelector: 'h2 a',
  limit: 15,
  type: 'business'
}

2. :broom: Data Processing & Cleaning

Raw HTML is cleaned and normalized:

  • Removes scripts, styles, and comments

  • Strips unnecessary whitespace

  • Validates data completeness

  • Timestamps each source

3. :robot: AI-Powered Summarization

Uses OpenRouter Chat Model (Mistral-7B) to generate structured summaries with:

  • :newspaper: Top Headlines - 2-3 key market-moving stories

  • :chart_increasing: Market Movers - Top gainers/losers with percentages

  • :bar_chart: Technical Outlook - NIFTY 50 & Sensex analysis

  • :bullseye: Key Events - Earnings, economic data, policy meetings

Prompt Engineering: The AI agent receives detailed instructions to format output specifically for WhatsApp (under 1000 characters, emoji-rich, professional yet engaging).

4. :clipboard: Subscriber Management

Integrates with Google Sheets to:

  • Fetch active subscriber list

  • Filter by status and valid phone numbers

  • Support dynamic subscriber management (no code deploys needed)

5. :speech_balloon: WhatsApp Broadcasting via Twilio

  • Formats messages with WhatsApp markdown

  • Includes unsubscribe option

  • Batch processes subscribers (10 at a time) to avoid rate limits

  • Handles failures gracefully

6. :bar_chart: Analytics & Logging

Tracks:

  • Total broadcasts sent

  • Success/failure rates

  • Subscriber engagement

  • Historical summaries for analysis

Technical Highlights

Smart Batch Processing

batchSize: 10
// Prevents API rate limiting while ensuring delivery

Error Handling

  • Validates scraped data length

  • Logs failed deliveries with phone numbers

  • Continues execution even if individual sources fail

Phone Number Formatting

to: "+91" + $json.phone
// Automatically formats Indian phone numbers

Use Cases Beyond Finance

This workflow pattern can be adapted for:

  • Daily News Digests - Any niche topic

  • E-commerce Price Alerts - Track competitor pricing

  • Social Media Monitoring - Brand mentions & sentiment

  • Weather/Traffic Updates - Location-based alerts

  • Content Publishing - Automated newsletter distribution

Required Services

  1. n8n (self-hosted or cloud)

  2. OpenRouter (AI model access)

  3. Twilio (WhatsApp Business API)

  4. Google Sheets (subscriber management)

Key Advantages

:white_check_mark: No Backend Required - Everything runs in n8n
:white_check_mark: Visual Workflow Builder - Easy to modify and debug
:white_check_mark: Scalable - Handles batching and rate limits automatically
:white_check_mark: Cost-Effective - Pay only for API usage (OpenRouter + Twilio)
:white_check_mark: Maintainable - Update sources/prompts without code changes

Performance Considerations

  • Scraping Duration: ~5-10 seconds per source

  • AI Processing: ~10-15 seconds for summary generation

  • WhatsApp Delivery: ~2-3 seconds per message

  • Total Runtime: ~3-5 minutes for 50 subscribers

Security Best Practices

  • API credentials stored in n8n’s credential manager

  • Phone numbers dynamically loaded (not hardcoded)

  • Rate limiting prevents abuse

  • Unsubscribe mechanism included

  • GDPR-compliant subscriber management

Future Enhancements

  • Personalization: Tailor summaries based on user preferences

  • Interactive Responses: Handle replies (STOP, HELP, etc.)

  • Multi-Language Support: Use AI translation for regional languages

  • Sentiment Analysis: Include market sentiment scores

  • Chart Generation: Attach visual charts to messages

Conclusion

This n8n workflow demonstrates how powerful automation can be achieved with minimal code. By combining web scraping, AI summarization, and messaging APIs, you can build production-ready notification systems that scale.

2 Likes

great workflow!

do you get normalized data? How would you ensure data quality & structure?

1 Like

Yes — the workflow normalizes scraped data into a consistent JSON structure (source, title, summary, link, timestamp). Data quality is ensured through HTML cleaning, field validation, deduplication, and type consistency before AI summarization.

1 Like

如何将这个一键部署到N8N