Create a secure MongoDB data retrieval API with input validation and HTTP responses
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This workflow has 7 nodes and runs when an HTTP GET request hits its webhook URL. Along the way it connects MongoDB.
How it runs
Trigger: When an HTTP GET request hits its webhook URL.
- Validate Pattern (Code): runs custom JavaScript code
- If: checks a condition and branches into true / false
- MongoDB: uses MongoDB
- Respond code (Respond to Webhook): sends the response back to the webhook caller
- IDS format (Code): runs custom JavaScript code
- Respond to Webhook: sends the response back to the webhook caller
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (5)
- Webhook
n8n-nodes-base.webhook - MongoDB
n8n-nodes-base.mongoDb - Respond to Webhook
n8n-nodes-base.respondToWebhook - If
n8n-nodes-base.if - Code
n8n-nodes-base.code
From the author
Data Extraction from MongoDB Overview This workflow exposes a public HTTP GET endpoint to read all documents from a MongoDB collection, with: - Strict validation of the collection name - Error handling with proper 4xx codes - Response formatting (e.g., id →…