Automate Gmail Contact Saving to MySQL Database
detail.loadingPreview
This n8n workflow automatically captures sender names and email addresses from incoming Gmail messages and saves them to a MySQL database. It helps businesses build contact lists, manage leads, and create a reliable backup of their client communication data.
About This Workflow
This powerful n8n workflow streamlines the process of extracting valuable contact information directly from your incoming Gmail emails. It continuously monitors your Gmail inbox, identifies the sender's name and email address using a custom code node, and then efficiently stores or updates this data in a designated MySQL database table. Ideal for sales teams, marketing agencies, or any business looking to centralize client contact information, this automation ensures your contact database is always up-to-date and provides a crucial safeguard against data loss, enabling effective lead management and targeted communication.
Key Features
- Automated Email Monitoring: Continuously listens for new emails in your Gmail inbox.
- Intelligent Contact Extraction: Automatically parses sender's name and email address from incoming messages.
- Smart Database Upsert: Inserts new contacts or updates existing contact names in MySQL if the email already exists, preventing duplicates.
- Customizable Data Storage: Easily extend the workflow to save additional email details like subject lines, message IDs, or recipient info.
- Flexible Filtering: Add custom filters to the Gmail trigger to capture contacts from specific labels or criteria.
How To Use
- Configure Credentials:
- Set up your Gmail credential for the "Receive Email" node.
- Set up your MySQL credential for the "Insert New Client in MySQL" node.
- Prepare MySQL Database:
- Create a table in your MySQL database to store contacts (e.g.,
contacts). - Ensure this table includes:
- A
namecolumn (should allowNULLvalues). - An
emailcolumn (must be set toUNIQUE).
- A
- Create a table in your MySQL database to store contacts (e.g.,
- Customize MySQL Node:
- In the "Insert New Client in MySQL" node, select the correct table you created.
- Choose your
emailcolumn to match on for upserting. - Choose your
namecolumn to store the sender's name.
- Optional: Add Gmail Filters:
- In the "Receive Email" node, you can add filters (e.g., by "Label") to process only specific types of emails.
- Optional: Save More Data:
- In the "Insert New Client in MySQL" node, click "Add Value" to save additional fields from the Gmail input (e.g., Subject, Snippet, Recipient Info) into corresponding MySQL columns.
Apps Used
Workflow JSON
{
"id": "e3e10ada-5736-45ba-9a34-df1209ba8f83",
"name": "Automate Gmail Contact Saving to MySQL Database",
"nodes": 15,
"category": "Sales",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: e3e10ada-5736...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Typeform to HubSpot Lead Qualification & Gmail Follow-up
Streamline your lead capture process by automatically syncing Typeform submissions to HubSpot. Qualify leads based on their interest and send personalized follow-up emails instantly. This workflow ensures no lead is missed and interested prospects receive immediate attention.
AI-Powered Upwork Proposal Automation Suite
This n8n workflow leverages AI to automate the entire freelance proposal process, from crafting personalized application text to generating professional Google Doc proposals and visual workflow diagrams. It significantly reduces manual effort, allowing freelancers to scale their client acquisition rapidly and effectively.
AI-Powered Stack Overflow Lead Generation
Unleash the power of AI to automatically scrape valuable lead data from Stack Overflow user profiles. This workflow intelligently identifies and extracts key information like names, locations, skills, and reputation, then seamlessly organizes it into your Google Sheet for effortless lead management.