Back to Integrations
integrationMongoDB node
integrationMySQL node

MongoDB and MySQL integration

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

How to connect MongoDB and MySQL

  • 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.

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

Step 2: Add and configure MongoDB and MySQL nodes

You can find MongoDB and MySQL 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 MongoDB and MySQL nodes one by one: input data on the left, parameters in the middle, and output data on the right.

MongoDB and MySQL integration: Add and configure MongoDB and MySQL nodes

Step 3: Connect MongoDB and MySQL

A connection establishes a link between MongoDB and MySQL (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.

MongoDB and MySQL integration: Connect MongoDB and MySQL

Step 4: Customize and extend your MongoDB and MySQL 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 MongoDB and MySQL with any of n8n’s 1000+ integrations, and incorporate advanced AI logic into your workflows.

MongoDB and MySQL integration: Customize and extend your MongoDB and MySQL integration

Step 5: Test and activate your MongoDB and MySQL workflow

Save and run the workflow to see if everything works as expected. Based on your configuration, data should flow from MongoDB to MySQL 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.

MongoDB and MySQL integration: Test and activate your MongoDB and MySQL workflow

Score DNS threats with VirusTotal, Abuse.ch, HashiCorp Vault and Gemini

Score DNS Threats with VirusTotal, Abuse.ch, HashiCorp Vault and Gemini

An end-to-end Cyber Threat Intelligence pipeline that turns raw DNS traffic into actionable security verdicts — without manual triage, without leaking credentials, and without alert fatigue.

What this workflow does

This workflow ingests passive DNS observations, enriches each indicator with multi-source threat intelligence, and uses Google Gemini as a senior security analyst to produce a single, defensible verdict per indicator. Every step that touches a secret pulls it from HashiCorp Vault at runtime, and only confirmed threats reach your inbox.

Problems it solves

Manual threat triage takes hours. A SOC analyst checking a suspicious indicator across VirusTotal, ThreatFox, and URLhaus, then writing up the verdict, typically spends 10-20 minutes per IoC. This workflow performs the same correlation in seconds and produces a structured report ready for review or downstream automation.

Hardcoded credentials are a breach waiting to happen. API keys, database passwords, and provider tokens commonly end up in workflow JSON, environment files, or git history. This workflow fetches every secret directly from HashiCorp Vault during execution, so credentials never live inside n8n configuration.

Alert fatigue trains analysts to ignore real threats. The AI agent applies a detection-first scoring model on a 1–5 scale, with email alerts firing only on confirmed malicious indicators (score ≥ 4). Clean traffic and low-signal noise are silently logged for trend analysis, not pushed to the operator.

Single-source intelligence is misleading. Indicators flagged by one provider but absent from others are often false positives — and indicators marked clean by one source may already be active C2 infrastructure tracked by another. This workflow correlates across three independent CTI sources before assigning a verdict.

Trusted infrastructure produces noise. Cloud providers, CDNs, and developer platforms (AWS, Cloudflare, GitHub, Bitbucket) frequently appear in threat feeds because attackers abuse them — the platforms themselves are not malicious. The scoring model recognizes "big player" infrastructure and caps the score unless a specific malware family is confirmed, eliminating a major source of false positives.

How it works

The workflow runs as five coordinated stages:

  1. Indicator capture. Passive DNS logs are read from MySQL using credentials retrieved from Vault. Indicators that have not yet been analyzed are queued for enrichment.

  2. Multi-source enrichment. Three independent CTI branches run in parallel:
    VirusTotal** — primary source for IP/domain reputation and ownership
    ThreatFox (Abuse.ch)** — primary source for active C2 infrastructure and malware family attribution
    URLhaus (Abuse.ch)** — supporting context on URLs historically hosted at the indicator

  3. AI-driven verdict. Google Gemini receives the consolidated intelligence, applies a detection-first scoring policy loaded dynamically from the database, and returns a structured JSON verdict including a numeric score, malicious flag, threat label, English technical summary, and Polish operator commentary.

  4. Persistence. Results are written to MySQL with full referential integrity, ready for Grafana dashboards or further automation.

  5. Conditional alerting. Only indicators with score ≥ 4 trigger an email notification. Email styling adapts to severity: green for informational, amber for review, red for confirmed threats.

Architecture components

Layer Component Role
Traffic source Passive DNS (MySQL) Identifies new IoCs from observed network traffic
Secret engine HashiCorp Vault Provides all credentials and API tokens at runtime
Intelligence VirusTotal, ThreatFox, URLhaus Independent CTI sources for cross-validation
AI reasoning Google Gemini Acts as a senior security analyst, correlating data and generating verdicts
Persistence MySQL (partitioned) Stores results with 6-month automated retention
Alerting Gmail via SMTP Severity-aware notifications, only for confirmed threats

Release v1.0.2-rc1 Highlights

This is the release candidate for the first stable v1.0.2 build, available on the Cyber Sentinel GitHub repository.

Detection-first scoring (1–5 scale)** — replaces the previous 1–10 scale with a clearer mapping to operator actions: Allow, Monitor, Review, Block, Block + Alert.
Dynamic threat scale** — score definitions are loaded from the database at every AI invocation, enabling future self-healing workflows that can auto-tune the scoring model.
Source weighting** — VirusTotal and ThreatFox drive the score; URLhaus contributes only as a supporting modifier, eliminating false positives on legitimate platforms.
Severity-aware email alerts** — color and header adapt to score (green INFO / amber REVIEW / red ALERT) instead of every indicator triggering a red alarm banner.
Partitioned database with automated retention** — DNS queries, network events, and threat indicators are partitioned monthly with automatic cleanup after 6 months.
Unified Vault provisioning** — single Ansible playbook handles initialization, unsealing, and secret provisioning idempotently.
Full Infrastructure-as-Code deployment** — the entire stack (Nginx, Vault, MySQL, MongoDB, n8n) deploys via Ansible with credentials managed through Ansible Vault.
Tested on Proxmox (Debian) and Raspberry Pi 5** — production-grade stability validated on both home-lab and resource-constrained environments.

Documentation

GitHub repository:** https://github.com/lukaszFD/cyber-sentinel
Project documentation:** https://lukaszfd.github.io/cyber-sentinel/
Release notes:** https://github.com/lukaszFD/cyber-sentinel/releases

Nodes used in this workflow

Popular MongoDB and MySQL workflows

+2

Score DNS threats with VirusTotal, Abuse.ch, HashiCorp Vault and Gemini

Score DNS Threats with VirusTotal, Abuse.ch, HashiCorp Vault and Gemini An end-to-end Cyber Threat Intelligence pipeline that turns raw DNS traffic into actionable security verdicts — without manual triage, without leaking credentials, and without alert fatigue. What this workflow does This workflow ingests passive DNS observations, enriches each indicator with multi-source threat intelligence, and uses Google Gemini as a senior security analyst to produce a single, defensible verdict per indicator. Every step that touches a secret pulls it from HashiCorp Vault at runtime, and only confirmed threats reach your inbox. Problems it solves Manual threat triage takes hours. A SOC analyst checking a suspicious indicator across VirusTotal, ThreatFox, and URLhaus, then writing up the verdict, typically spends 10-20 minutes per IoC. This workflow performs the same correlation in seconds and produces a structured report ready for review or downstream automation. Hardcoded credentials are a breach waiting to happen. API keys, database passwords, and provider tokens commonly end up in workflow JSON, environment files, or git history. This workflow fetches every secret directly from HashiCorp Vault during execution, so credentials never live inside n8n configuration. Alert fatigue trains analysts to ignore real threats. The AI agent applies a detection-first scoring model on a 1–5 scale, with email alerts firing only on confirmed malicious indicators (score ≥ 4). Clean traffic and low-signal noise are silently logged for trend analysis, not pushed to the operator. Single-source intelligence is misleading. Indicators flagged by one provider but absent from others are often false positives — and indicators marked clean by one source may already be active C2 infrastructure tracked by another. This workflow correlates across three independent CTI sources before assigning a verdict. Trusted infrastructure produces noise. Cloud providers, CDNs, and developer platforms (AWS, Cloudflare, GitHub, Bitbucket) frequently appear in threat feeds because attackers abuse them — the platforms themselves are not malicious. The scoring model recognizes "big player" infrastructure and caps the score unless a specific malware family is confirmed, eliminating a major source of false positives. How it works The workflow runs as five coordinated stages: Indicator capture. Passive DNS logs are read from MySQL using credentials retrieved from Vault. Indicators that have not yet been analyzed are queued for enrichment. Multi-source enrichment. Three independent CTI branches run in parallel: VirusTotal** — primary source for IP/domain reputation and ownership ThreatFox (Abuse.ch)** — primary source for active C2 infrastructure and malware family attribution URLhaus (Abuse.ch)** — supporting context on URLs historically hosted at the indicator AI-driven verdict. Google Gemini receives the consolidated intelligence, applies a detection-first scoring policy loaded dynamically from the database, and returns a structured JSON verdict including a numeric score, malicious flag, threat label, English technical summary, and Polish operator commentary. Persistence. Results are written to MySQL with full referential integrity, ready for Grafana dashboards or further automation. Conditional alerting. Only indicators with score ≥ 4 trigger an email notification. Email styling adapts to severity: green for informational, amber for review, red for confirmed threats. Architecture components | Layer | Component | Role | |---|---|---| | Traffic source | Passive DNS (MySQL) | Identifies new IoCs from observed network traffic | | Secret engine | HashiCorp Vault | Provides all credentials and API tokens at runtime | | Intelligence | VirusTotal, ThreatFox, URLhaus | Independent CTI sources for cross-validation | | AI reasoning | Google Gemini | Acts as a senior security analyst, correlating data and generating verdicts | | Persistence | MySQL (partitioned) | Stores results with 6-month automated retention | | Alerting | Gmail via SMTP | Severity-aware notifications, only for confirmed threats | Release v1.0.2-rc1 Highlights This is the release candidate for the first stable v1.0.2 build, available on the Cyber Sentinel GitHub repository. Detection-first scoring (1–5 scale)** — replaces the previous 1–10 scale with a clearer mapping to operator actions: Allow, Monitor, Review, Block, Block + Alert. Dynamic threat scale** — score definitions are loaded from the database at every AI invocation, enabling future self-healing workflows that can auto-tune the scoring model. Source weighting** — VirusTotal and ThreatFox drive the score; URLhaus contributes only as a supporting modifier, eliminating false positives on legitimate platforms. Severity-aware email alerts** — color and header adapt to score (green INFO / amber REVIEW / red ALERT) instead of every indicator triggering a red alarm banner. Partitioned database with automated retention** — DNS queries, network events, and threat indicators are partitioned monthly with automatic cleanup after 6 months. Unified Vault provisioning** — single Ansible playbook handles initialization, unsealing, and secret provisioning idempotently. Full Infrastructure-as-Code deployment** — the entire stack (Nginx, Vault, MySQL, MongoDB, n8n) deploys via Ansible with credentials managed through Ansible Vault. Tested on Proxmox (Debian) and Raspberry Pi 5** — production-grade stability validated on both home-lab and resource-constrained environments. Documentation GitHub repository:** https://github.com/lukaszFD/cyber-sentinel Project documentation:** https://lukaszfd.github.io/cyber-sentinel/ Release notes:** https://github.com/lukaszFD/cyber-sentinel/releases

Build your own MongoDB and MySQL integration

Create custom MongoDB and MySQL 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

Create
Drop
List
Update
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

MySQL supported actions

Delete
Delete an entire table or rows in a table
Execute SQL
Execute an SQL query
Insert
Insert rows in a table
Insert or Update
Insert or update rows in a table
Select
Select rows from a table
Update
Update rows in a table

FAQs

  • Can MongoDB connect with MySQL?

  • Can I use MongoDB’s API with n8n?

  • Can I use MySQL’s API with n8n?

  • Is n8n secure for integrating MongoDB and MySQL?

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

Need help setting up your MongoDB and MySQL integration?

Discover our latest community's recommendations and join the discussions about MongoDB and MySQL integration.
João Textor
Mohammadali
Michael Zareno
Neal A Richardson Sr
GabrielBackend

Looking to integrate MongoDB and MySQL in your company?

Over 3000 companies switch to n8n every single week

Why use n8n to integrate MongoDB with MySQL

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