n8nflow.net logo

Google Sheets Duplication & Enrichment Automation

by Amit Mehtaโ€ขUpdated: Last update 4 months agoโ€ขSource: n8n.io
Loading workflow viewer...

Getting Started

How it Works

This workflow reads sheet details from a source Google Spreadsheet, creates a new spreadsheet, replicates the sheet structure, enriches the content by reading data, and writes it into the corresponding sheets in the new spreadsheet. The process is looped for every sheet, providing an automated way to duplicate and transform structured data.

๐ŸŽฏ Use Case

  • Automate duplication and data enrichment for multi-sheet Google Spreadsheets
  • Replicate templates across new documents with consistent formatting
  • Data team workflows requiring repetitive structured Google Sheets setup

Setup Instructions

1. Required Google Sheets

  • You must have a source spreadsheet with multiple sheets.
  • The destination spreadsheet will be created automatically.

2. API Credentials

  • Google Sheets OAuth2 โ€“ connect to both read and write spreadsheets.
  • HTTP Request Auth โ€“ if external API headers are needed.

3. Configure Fields in Write Sheet

  • Ensure you define appropriate columns and mapping for the destination sheet.

๐Ÿ” Workflow Logic

  1. Manual Trigger : Starts the flow on user demand.
  2. Create New Spreadsheet : Generates a blank spreadsheet.
  3. HTTP Request : Retrieves all sheet names from the source spreadsheet.
  4. JavaScript Code : Extracts titles and metadata from the HTTP response.
  5. Loop Over Sheets : Iterates through each sheet retrieved.
  6. Delete Default Sheet : Removes the placeholder 'Sheet1'.
  7. Create Sheets : Replicates each original sheet in the new document.
  8. Read Spreadsheet1 : Pulls data from the matching original sheet.
  9. Write Sheet : Appends the data to the newly created sheets.

๐Ÿงฉ Node Descriptions

Node NameDescription
Manual TriggerStarts the workflow manually by user test.
Create New SpreadsheetCreates a new Google Spreadsheet for output.
HTTP RequestFetches metadata from the source spreadsheet including sheet names.
CodeProcesses sheet metadata into a list for iteration.
Loop Over ItemsLoops over each sheet to replicate and populate.
Google Sheets2Deletes the default 'Sheet1' from the new spreadsheet.
Create SheetsCreates a new sheet matching each source sheet.
Read Spreadsheet1Reads data from the source sheet.
Write sheetWrites the data into the corresponding new sheet.

๐Ÿ› ๏ธ Customization Tips

  • Adjust the Google Sheet title to be dynamic or user-input driven
  • Add filtering logic before writing data
  • Append custom audit columns like 'Timestamp' or 'Processed By'
  • Enable logging or Slack alerts after each sheet is created

๐Ÿ“Ž Required Files

File NamePurpose
My_workflow_4.jsonMain workflow JSON file for sheet duplication and enrichment

๐Ÿงช Testing Tips

  • Test with a spreadsheet containing 2โ€“3 simple sheets
  • Validate whether all sheets are duplicated
  • Check if columns and data structure remain intact
  • Watch for authentication issues in Google Sheets nodes

๐Ÿท Suggested Tags & Categories

#GoogleSheets #Automation #DataEnrichment #Workflow #Spreadsheet