Back to Integrations
integrationHTTP Request node
integrationMongoDB node

HTTP Request and MongoDB integration

Save yourself the work of writing custom integrations for HTTP Request and MongoDB and use n8n instead. Build adaptable and scalable Development, Core Nodes, and Data & Storage workflows that work with your technology stack. All within a building experience you will love.

How to connect HTTP Request and MongoDB

  • Step 1: Create a new workflow
  • Step 2: Add and configure nodes
  • Step 3: Connect
  • Step 4: Customize and extend your integration
  • Step 5: Test and activate your workflow

Step 1: Create a new workflow and add the first step

In n8n, click the "Add workflow" button in the Workflows tab to create a new workflow. Add the starting point – a trigger on when your workflow should run: an app event, a schedule, a webhook call, another workflow, an AI chat, or a manual trigger. Sometimes, the HTTP Request node might already serve as your starting point.

HTTP Request and MongoDB integration: Create a new workflow and add the first step

Step 2: Add and configure HTTP Request and MongoDB nodes

You can find HTTP Request and MongoDB in the nodes panel. Drag them onto your workflow canvas, selecting their actions. Click each node, choose a credential, and authenticate to grant n8n access. Configure HTTP Request and MongoDB nodes one by one: input data on the left, parameters in the middle, and output data on the right.

HTTP Request and MongoDB integration: Add and configure HTTP Request and MongoDB nodes

Step 3: Connect HTTP Request and MongoDB

A connection establishes a link between HTTP Request and MongoDB (or vice versa) to route data through the workflow. Data flows from the output of one node to the input of another. You can have single or multiple connections for each node.

HTTP Request and MongoDB integration: Connect HTTP Request and MongoDB

Step 4: Customize and extend your HTTP Request and MongoDB integration

Use n8n's core nodes such as If, Split Out, Merge, and others to transform and manipulate data. Write custom JavaScript or Python in the Code node and run it as a step in your workflow. Connect HTTP Request and MongoDB with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

HTTP Request and MongoDB integration: Customize and extend your HTTP Request and MongoDB integration

Step 5: Test and activate your HTTP Request and MongoDB workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from HTTP Request to MongoDB or vice versa. Easily debug your workflow: you can check past executions to isolate and fix the mistake. Once you've tested everything, make sure to save your workflow and activate it.

HTTP Request and MongoDB integration: Test and activate your HTTP Request and MongoDB workflow

Scrape and store data from multiple website pages

This workflow allows extracting data from multiple pages website.

The workflow:

  1. Starts in a country list at https://www.theswiftcodes.com/browse-by-country/.
  2. Loads every country page (https://www.theswiftcodes.com/albania/)
  3. Paginates every page in the country page.
  4. Extracts data from the country page.
  5. Saves data to MongoDB.
  6. Paginates through all pages in all countries.

It uses getWorkflowStaticData('global') method to recover the next page (saved from the previous page), and it goes ahead with all the pages.

There is a first section where the countries list is recovered and extracted.

Later, I try to read if a local cache page is available and I recover the cached page from the disk.

Finally, I save data to MongoDB, and we paginate all the pages in the country and for all the countries.

I have applied a cache system to save a visited page to n8n local disk. If I relaunch workflow, we check if a cache file exists to discard non-required requests to the webpage.

If the data present in the website changes, you can apply a Cron node to check the website once per week.

Finally, before inserting data in MongoDB, the best way to avoid duplicates is to check that swift_code (the primary value of the collection) doesn't exist.

I recommend using a proxy for all requests to avoid IP blocks. A good solution for proxy plus IP rotation is scrapoxy.io.

This workflow is perfect for small data requirements. If you need to scrape dynamic data, you can use a Headless browser or any other service.

If you want to scrape huge lists of URIs, I recommend using Scrapy + Scrapoxy.

Nodes used in this workflow

Popular HTTP Request and MongoDB workflows

Scrape and store data from multiple website pages

This workflow allows extracting data from multiple pages website. The workflow: 1) Starts in a country list at https://www.theswiftcodes.com/browse-by-country/. 2) Loads every country page (https://www.theswiftcodes.com/albania/) 3) Paginates every page in the country page. 4) Extracts data from the country page. 5) Saves data to MongoDB. 6) Paginates through all pages in all countries. It uses getWorkflowStaticData('global') method to recover the next page (saved from the previous page), and it goes ahead with all the pages. There is a first section where the countries list is recovered and extracted. Later, I try to read if a local cache page is available and I recover the cached page from the disk. Finally, I save data to MongoDB, and we paginate all the pages in the country and for all the countries. I have applied a cache system to save a visited page to n8n local disk. If I relaunch workflow, we check if a cache file exists to discard non-required requests to the webpage. If the data present in the website changes, you can apply a Cron node to check the website once per week. Finally, before inserting data in MongoDB, the best way to avoid duplicates is to check that swift_code (the primary value of the collection) doesn't exist. I recommend using a proxy for all requests to avoid IP blocks. A good solution for proxy plus IP rotation is scrapoxy.io. This workflow is perfect for small data requirements. If you need to scrape dynamic data, you can use a Headless browser or any other service. If you want to scrape huge lists of URIs, I recommend using Scrapy + Scrapoxy.

Send RSS feed data to webhook

Filters articles based on keywords, checks against MongoDB for unique links, then sends results to different webhooks

Build your own HTTP Request and MongoDB integration

Create custom HTTP Request and MongoDB workflows by choosing triggers and actions. Nodes come with global operations and settings, as well as app-specific parameters that can be configured. You can also use the HTTP Request node to query data from any app or service with a REST API.

MongoDB supported actions

Aggregate
Aggregate documents
Delete
Delete documents
Find
Find documents
Find And Replace
Find and replace documents
Find And Update
Find and update documents
Insert
Insert documents
Update
Update documents
Use case

Save engineering resources

Reduce time spent on customer integrations, engineer faster POCs, keep your customer-specific functionality separate from product all without having to code.

Learn more

FAQs

  • Can HTTP Request connect with MongoDB?

  • Can I use HTTP Request’s API with n8n?

  • Can I use MongoDB’s API with n8n?

  • Is n8n secure for integrating HTTP Request and MongoDB?

  • How to get started with HTTP Request and MongoDB integration in n8n.io?

Need help setting up your HTTP Request and MongoDB integration?

Discover our latest community's recommendations and join the discussions about HTTP Request and MongoDB integration.
Moiz Contractor
theo
Jon
Dan Burykin
João Textor

Looking to integrate HTTP Request and MongoDB in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate HTTP Request with MongoDB

Build complex workflows, really fast

Build complex workflows, really fast

Handle branching, merging and iteration easily.
Pause your workflow to wait for external events.

Code when you need it, UI when you don't

Simple debugging

Your data is displayed alongside your settings, making edge cases easy to track down.

Use templates to get started fast

Use 1000+ workflow templates available from our core team and our community.

Reuse your work

Copy and paste, easily import and export workflows.

Implement complex processes faster with n8n

red iconyellow iconred iconyellow icon