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.

0
Downloads
0
Views
8.52
Quality Score
beginner
Complexity
Author:vvrr22042026(View Original →)
Created:5/1/2026
Updated:7/3/2026

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments