n8n

How to Sync Google Sheets MySQL Lead Management?

Turn Google Form entries into a clean lead database without copy and paste. The flow reads a Google Sheet, writes new leads into MySQL, and flags items that need a fast reply. It fits teams that manage event inquiries or bookings.

A weekday schedule runs every 30 minutes and a manual run is available for testing. The Google Sheets node pulls rows and a Set step renames columns into clear fields like timestamp, email, name, and event details. A MySQL select loads current records. A dataset compare step matches by timestamp and source name and ignores audit fields, so only true changes move forward. New or changed items upsert into MySQL. If a record is older than four hours with no response, it routes to a notification step. When database status changes, the Google Sheet gets updated, and MySQL marks synced items.

You need a Google Sheet fed by a form with a DB Status column and a MySQL table that matches these fields. Expect faster intake, fewer mistakes, and quicker follow up. This setup suits venues, agencies, and teams that track event requests in Sheets but need a reliable database for reporting and follow up.

What are the key features?

  • Weekday schedule runs every 30 minutes and supports manual testing.
  • Reads rows from Google Sheets and maps headers to clean field names.
  • Compares Google Sheet and MySQL by timestamp and source name while skipping id and audit fields.
  • Upserts records into MySQL using timestamp as the match key to avoid duplicates.
  • Checks if the last reply is older than four hours and routes to a notification step.
  • Writes database status back to the Google Sheet to keep both sides in sync.
  • Marks synced MySQL records by updating the source name for easy tracking.
  • Filters on the DB Status column in Sheets to focus on actionable rows.

What are the benefits?

  • Reduce manual updates from 60 minutes a day to 10 minutes
  • Streamline form to database updates by 80%
  • Eliminate duplicate entries and status mismatches by 90%
  • Connect Google Sheets and MySQL without coding
  • Respond to new inquiries within 4 hours using alerts
  • Handle hundreds of form entries per day

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Sheets and MySQL. See the Tools Required section above for links to create accounts with these services.
  3. Prepare your Google Form and Sheet: include Email Address, Name, Event name, Event date, Event location, and Event details. Add a DB Status column in the Sheet. Keep the Timestamp column as provided by Google.
  4. Create the MySQL table using your preferred client. Use the provided schema so fields match the mapped names such as timestamp, email_address, name, occasion, event_date, event_location, details, source_name, db_status, record_created, and record_updated.
  5. In the n8n credentials manager, open the Google Sheets node and create a new Google Sheets OAuth2 credential. Sign in with your Google account, save, and test the connection.
  6. In the MySQL nodes, create a new MySQL credential. Enter host, port, database name, user, and password. Ensure your database allows connections from n8n Cloud. Save and test.
  7. Open the Google Sheets node and select your spreadsheet and the correct sheet tab. Confirm the filter uses the DB Status column if you want to limit which rows are read.
  8. Open the Set node and confirm each field maps to the correct Sheet header. Add a static field for source_name set to GoogleForm so it matches the MySQL filter and compare logic.
  9. Open Compare Datasets and verify merge by fields are timestamp and source_name. Confirm skipped fields include id, record_created, and record_updated.
  10. In the MySQL upsert node, select the target table and set the column to match on to timestamp. Save and test with a few rows.
  11. Open Update GSheet status and select the same spreadsheet and sheet. Ensure DB Status is mapped to the value from the comparison output.
  12. Adjust the Schedule Trigger if needed. The default cron runs every 30 minutes from 6 to 22 on weekdays.
  13. Validation: click Execute Workflow to run a test. Confirm new rows appear in MySQL, DB Status updates in the Sheet, and the notification branch fires when a record is older than four hours.
  14. Troubleshooting: if the time check does not work, ensure the Timestamp format in the Sheet matches MM/d/yyyy HH:mm:ss. If MySQL fails, verify network access and user permissions. If no rows appear, recheck the Sheet and table names.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Sheets

Sign up

Free: $0 (Google Sheets API usage has no additional cost; quota limits apply)

MySQL

Sign up

MySQL Community Edition (GPL) – Free ($0)

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.