Route client onboarding webhook events through RabbitMQ to Gmail alerts
Publish Subscribe Example - Webhook to RabbitMQ, RabbitMQ to GMAIL
How it works
This workflow demonstrates a resilient publish/subscribe automation pattern using n8n, RabbitMQ, JSON Schema validation, and Gmail.
It contains two flows in the same workflow:
A publisher flow receives client onboarding JSON through a webhook. The payload is validated against a JSON Schema. If valid, the workflow publishes the event to RabbitMQ. A subscriber flow listens to the RabbitMQ queue. The subscriber validates the received event again. If the message is valid, it prepares and sends a Gmail notification. Invalid messages and processing failures are routed to a dead-letter/error queue.
This template is useful for client onboarding, accounting intake, document processing, form submissions, internal notifications, and event-driven workflow automation.
Set up steps
Create or connect a RabbitMQ instance. Create the following RabbitMQ resources: Exchange: client.onboarding.exchange Exchange type: topic Main queue: client.onboarding.queue Routing key: client.onboarding.received Dead letter/error queue: client.onboarding.dlq
In n8n, configure your RabbitMQ credentials. Replace the RabbitMQ credential placeholder with your own RabbitMQ credential. Replace the JSON Schema Validator placeholder nodes with your preferred JSON Schema validation node or validation service. Configure the Gmail credential. Replace the Gmail placeholder node with the Gmail Send Email node. Update the recipient email address in the “Prepare Gmail Email” node. Test the publisher webhook with a sample client onboarding JSON payload. Confirm the message is published to RabbitMQ and then consumed by the subscriber flow. Confirm Gmail receives the formatted notification email.
Required credentials
RabbitMQ credentials Gmail OAuth2 credentials Optional JSON Schema validator community node or external validation service
Example input JSON
{ "clientId": "C1001", "clientName": "John Smith", "email": "john.smith@example.com", "serviceType": "Individual Tax Return", "taxYear": 2025, "documents": [ { "documentType": "Photo ID", "fileName": "john-smith-passport.pdf" }, { "documentType": "PAYG Summary", "fileName": "john-smith-payg-summary.pdf" } ] }
Resilience and Error Handling
This template includes: Validation before publish Validation after subscribe Correlation ID Schema version Dead-letter queue Email failure branch Invalid message branch RabbitMQ publish failure branch
Invalid or failed messages are routed to client.onboarding.dlq.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
⚡ AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments