Archive last month’s invoice tab with Google Sheets and Google Drive
Quick overview This workflow runs monthly to archive last month’s invoice tab from a Google Sheets workbook into a new spreadsheet created in the matching Google Drive month folder, then renames the copied tab for accounting.
How it works Runs on a monthly schedule. Searches Google Drive for the folder named for last month in YYYY-MM format and calls a Google Apps Script web app to create a new spreadsheet in that folder. Calls the Google Sheets API to list all tabs in your main invoice spreadsheet and keeps only the tab whose title matches last month in “Month YYYY” format. Combines the destination spreadsheet details with the selected source tab information. Uses the Google Sheets API to copy the tab into the new spreadsheet and then renames the copied tab to “Month YYYY - Invoices”.
Setup Add Google OAuth2 credentials with access to Google Drive and Google Sheets. Replace YOUR_GOOGLE_SHEET_ID in the Google Sheets API request URLs with your main invoice spreadsheet ID. Deploy a Google Apps Script web app that accepts folderUrl and sheetName and returns the created spreadsheetId, then paste its URL into the workflow’s web request. Ensure a Google Drive folder exists for each month you want to archive, named in YYYY-MM format (for example, 2026-03). Make sure your invoice tab names follow the “Month YYYY” format so the workflow can match last month correctly.
Related Templates
AI Weather Forecasts with MCP Integration
Real-time Weather Forecasts with MCP Tools This n8n workflow demonstrates how to integrate real-time weather intelligen...
Google Sheets UI for n8n Workflow
Google Sheets UI for Workflow Control This n8n template provides a practical and efficient way to manage your n8n workf...
Demo Workflow - How to use workflowStaticData()
This workflow demonstrates how to use the workflowStaticData() function to set any type of variable that will persist wi...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments