Skip to main content

Filter WhatsApp messages using a Google Sheets blacklist and rate limiting

Workflow preview

Workflow preview
100%
Filter WhatsApp messages using a Google Sheets blacklist and rate limiting preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow validates an incoming WhatsApp style message by normalizing the sender phone number, checking it against a Google Sheets blacklist, and applying a per minute rate limit...

Best for

  • Ticket Management automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.code, n8n-nodes-base.googlesheets, n8n-nodes-base.merge, n8n-nodes-base.if, n8n-nodes-base.stickynote, n8n-nodes-base.noop

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Luis R..

Original n8n.io source

1.1 Workflow description

Title
Filter WhatsApp messages using a Google Sheets blacklist and rate limiting
Workflow name
Filter WhatsApp messages using a Google Sheets blacklist and rate limiting

Quick overview

This workflow validates an incoming WhatsApp-style message by normalizing the sender phone number, checking it against a Google Sheets blacklist, and applying a per-minute rate limit before passing approved messages onward.

How it works

  1. Runs manually for testing and generates a mock WhatsApp payload containing a phone number and message.
  2. Sanitizes the sender phone number by stripping non-numeric characters.
  3. Fetches blacklist entries from Google Sheets and sanitizes each listed phone number.
  4. Compares the sender’s sanitized phone number to the sanitized blacklist and marks the message as blocked when a match is found.
  5. Stops processing for blacklisted numbers, otherwise attaches a configurable messages-per-minute threshold.
  6. Logs the request in workflow static data and evaluates whether the sender exceeds the rate limit within a 60-second window.
  7. Stops processing when the rate limit is exceeded, otherwise outputs a clean payload (phoneNumber, cleanPhone, message) for downstream processing.

Setup

  1. Connect Google Sheets OAuth2 credentials and update the Google Sheets document and sheet name that contain your blacklist.
  2. Ensure the blacklist sheet has columns for the phone number (e.g. phone) and an optional block reason (e.g. reason).
  3. Replace the manual trigger and mock input with your WhatsApp (or messaging) trigger that provides phoneNumber and message fields.
  4. Set the allowed request volume by updating the limitThreshold value (default: 30 messages per minute).
  5. Remove the flood-simulation step used for testing so rate limiting reflects real traffic only.

Customization

  • Replace Google Sheets with any database — Airtable, PostgreSQL, or a hardcoded array for simpler deployments
  • Adjust the rate limit threshold by changing limitThreshold in the "Set — Config" node (default: 30 msgs/min)
  • Modify the rate limit time window by changing 60000 (ms) in Code — Rate Limiter Engine
  • Add auto-reply nodes on both blocked branches to notify the user
  • Connect a logging database or Telegram alert for security monitoring

Additional info

Rate limiting uses n8n's native workflow static data ($getWorkflowStaticData) — no external Redis or database required. Phone numbers are sanitized before comparison to handle formatting variations (+52 181..., 52181..., etc.).

The "Code — Mock Review Flood" node simulates 31 rapid messages to force a rate limit breach during testing. Delete it before deploying to production.

Built from a real production multi-tenant WhatsApp AI system handling live customer conversations.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Manual Trigger — Test Execution

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Set — Mock WhatsApp Input

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Code — Sanitize Phone Number

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 4 - Google Sheets — Fetch Blacklist

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 5 - Merge — Match Blacklist

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 6 - Code — Sanitize Blacklist Rows

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Code — Evaluate Blacklist Status

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - If — is Blocked?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 9 - Code — Mock Review Flood (DELETE IN PRODUCTION)

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 10 - Code — Rate Limiter Engine

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Overview

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - If — Rate Limit Exceeded?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 14 - Set — Production Payload

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 15 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - NoOp — Blocked by Blacklist

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 17 - NoOp — Blocked by Rate Limit

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 18 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Set — Max messages per minute

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

3. Summary Table

Workflow Filter WhatsApp messages using a Google Sheets blacklist and rate limiting
Complexity advanced
Nodes 22
Categories Ticket Management
Author Luis R.
Published 03 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16075/16075.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Filter WhatsApp messages using a Google Sheets blacklist and rate limiting do?

Quick overview This workflow validates an incoming WhatsApp style message by normalizing the sender phone number, checking it against a Google Sheets blacklist, and applying a per minute rate limit...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management use case.