What This Workflow Does
This workflow updates a MySQL database with book prices from Google Sheets every weekday at 5 AM.
It stops manual data entry and errors by automating the data import.
You get fresh pricing in your online store every morning without doing anything.
The workflow reads Google Sheets data, then inserts titles and prices into MySQL.
Duplicate entries are ignored to avoid errors.
Tools and Services Used
- n8n platform: Builds and runs automated workflows.
- Google Sheets API: Reads book price data from spreadsheets.
- MySQL database: Stores book titles and prices.
- Cron scheduler in n8n: Runs the workflow on weekdays at 5 AM.
Input → Process → Output
Input
- Google Sheets document with columns like title and price.
- Access credentials for Google Sheets and MySQL inside n8n.
Process
- Cron triggers workflow every weekday at 5 AM.
- Google Sheets node reads all book data rows.
- MySQL node inserts each book’s title and price into the table.
- Duplicates are ignored using insertion option to avoid errors.
Output
- MySQL books table updated with latest prices.
- Consistent, error-free pricing data for the online store.
Beginner Step-by-Step: How to Use This Workflow in n8n
Import the Workflow
- Download the workflow file using the Download button on this page.
- In n8n editor, click the menu and select “Import from File.”
- Choose the downloaded workflow file to import.
Configure Credentials and IDs
- Add Google Sheets OAuth2 credentials inside n8n if not done.
- Set your MySQL database credentials in the MySQL node.
- Update the Google Sheets ID in the Google Sheets node with your sheet’s actual ID.
- Confirm the MySQL table “books” matches your database structure or update the table name.
Test and Activate
- Run the workflow manually once to make sure it inserts data correctly.
- Address any errors by checking credentials or table keys.
- Turn ON the workflow switch in n8n to enable automatic runs on weekdays.
- Check n8n’s execution logs to see scheduled runs and success.
If you plan on self-host n8n, make sure your server is running 24/7 to catch the schedule.
Common Issues and Solutions
- Problem: OAuth2 fails on Google Sheets node.
Fix: Refresh OAuth2 credentials or reauthenticate account in n8n. - Problem: Duplicate key errors in MySQL even with ignore enabled.
Fix: Check that the “title” column has a unique constraint in MySQL. - Problem: Workflow does not run on weekdays.
Fix: Ensure the Cron node is set to “Every Week” mode with weekdays selected.
Customizations
- Change the Cron node hour if you want to run updates at a different time.
- Add more fields like author or ISBN in both Google Sheets and MySQL columns.
- Add an IF node before MySQL to insert only changed prices.
- Insert a logging node to track errors to Slack or files for monitoring.
Summary
✓ Saves 30 minutes daily by automating price imports.
✓ Avoids manual entry mistakes for book prices.
✓ Keeps online bookstore pricing up to date automatically.
✓ Runs every weekday at 5 AM with no manual action.
