Workflow: Fetch the Most Recent Document from Google Drive
Integrations: googleDocs, googleDriveTrigger, googleSheets, noOp, stickyNote, stopAndError

{"id": "aswQJmksAOmHmn8c", "meta": {"instanceId": "workflow-681f0c24", "versionId": "1.0.0", "createdAt": "2025-09-29T07:07:45.412621", "updatedAt": "2025-09-29T07:07:45.412628", "owner": "n8n-user", "license": "MIT", "category": "automation", "status": "active", "priority": "high", "environment": "production"}, "name": "Fetch the Most Recent Document from Google Drive", "tags": ["automation", "n8n", "production-ready", "excellent", "optimized"], "nodes": [{"id": "d9df98fe-bf03-45bd-9cb9-ed32371b7970", "name": "Google Docs", "type": "n8n-nodes-base.googleDocs", "position": [100, 500], "parameters": {"operation": "get", "documentURL": "{{ $env.BASE_URL }}"}, "credentials": {"googleDocsOAuth2Api": {"id": "", "name": ""}}, "typeVersion": 2, "notes": "This googleDocs node performs automated tasks as part of the workflow."}, {"id": "46daf9a2-0d13-49c3-8272-e366888e1960", "name": "Wikipedia", "type": "n8n-nodes-base.noOp", "position": [440, 440], "parameters": {}, "typeVersion": 1, "notes": "This toolWikipedia node performs automated tasks as part of the workflow."}, {"id": "9dafd444-257c-4f44-9550-1dbd19dc44d4", "name": "Calculator", "type": "n8n-nodes-base.noOp", "position": [700, 440], "parameters": {}, "typeVersion": 1, "notes": "This toolCalculator node performs automated tasks as part of the workflow."}, {"id": "259a7fa0-4b37-453e-a730-fb2fc7bc3eb0", "name": "Google Sheets", "type": "n8n-nodes-base.googleSheets", "position": [1040, 540], "parameters": {"columns": {"value": {"Name": "={{ $('Google Drive ').item.json.lastModifyingUser.displayName }}", "Email ": "={{ $('Google Drive ').item.json.lastModifyingUser.emailAddress }}", "Summarise Conetent data ": "={{ $json.message.content }}"}, "schema": [{"id": "Email ", "type": "string", "display": true, "required": false, "displayName": "Email ", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "Name", "type": "string", "display": true, "removed": false, "required": false, "displayName": "Name", "defaultMatch": false, "canBeUsedToMatch": true}, {"id": "Summarise Conetent data ", "type": "string", "display": true, "required": false, "displayName": "Summarise Conetent data ", "defaultMatch": false, "canBeUsedToMatch": true}], "mappingMode": "defineBelow", "matchingColumns": []}, "options": {}, "operation": "append", "sheetName": {"__rl": true, "mode": "list", "value": "gid=0", "cachedResultUrl": "", "cachedResultName": "Sheet1"}, "documentId": {"__rl": true, "mode": "url", "value": "", "__regex": "https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)"}}, "credentials": {"googleSheetsOAuth2Api": {"id": "", "name": ""}}, "typeVersion": 4.5, "notes": "This googleSheets node performs automated tasks as part of the workflow."}, {"id": "d5b63de6-bc9a-4e44-a9a2-85026a16aec7", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [-320, 180], "parameters": {"color": 5, "height": 260, "content": "## Get Latest File\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "d00720d9-a344-48c9-9c31-7c4391ecda70", "name": "Google Drive ", "type": "n8n-nodes-base.googleDriveTrigger", "notes": "Received the doc", "position": [-240, 260], "parameters": {"event": "fileCreated", "options": {}, "pollTimes": {"item": [{"mode": "everyMinute"}]}, "triggerOn": "specificFolder", "folderToWatch": {"__rl": true, "mode": "url", "value": ""}}, "credentials": {"googleDriveOAuth2Api": {"id": "", "name": ""}}, "notesInFlow": true, "typeVersion": 1}, {"id": "4e326b5d-f116-4de7-bf4b-bac11772e54d", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [20, 400], "parameters": {"color": 5, "width": 260, "height": 260, "content": "## Get Document Content\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "b2f25e20-0c61-4af4-b2b5-dbeb20720c3b", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [380, 200], "parameters": {"color": 5, "width": 440, "height": 380, "content": "## AI Summarization\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "af9b81f3-b65d-4957-8471-978dc90970f2", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [920, 420], "parameters": {"color": 5, "width": 300, "height": 280, "content": "## Store Summary in Sheet\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "4cd99298-968b-4a47-bcf9-b4e006d8dab0", "name": "Generate Summary AI", "type": "n8n-nodes-base.noOp", "position": [460, 280], "parameters": {"modelId": {"__rl": true, "mode": "list", "value": "gpt-4o-mini", "cachedResultName": "GPT-4O-MINI"}, "options": {}, "messages": {"values": [{"content": "=Summarise the below content\n {{ $json.content }}"}]}}, "typeVersion": 1.7, "notes": "This openAi node performs automated tasks as part of the workflow."}, {"id": "af7afd98-8707-4db6-acb0-796427f6e304", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [0, 0], "parameters": {"color": 5, "width": 800, "height": 80, "content": "# Google Doc Summarizer to Google Sheets\n"}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "d0c4ae80-d120-457a-975d-7cfcb963b922", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [-260, 760], "parameters": {"color": 5, "width": 1280, "content": "## Description\nThis workflow streamlines and automates the end-to-end process of managing recently added document files in Google Drive. It begins by identifying the most recently uploaded .doc file in a designated folder within Google Drive. The document's content is then directly retrieved and passed through an AI-powered summarization model that condenses the content into a concise and meaningful summary. Finally, the summarized content, along with relevant metadata such as the document's name, upload date, and other details, is systematically stored in a Google Sheet. This ensures easy reference, enhanced organization, and quick access to key information, making it an ideal solution for managing and summarizing large volumes of document data efficiently."}, "typeVersion": 1, "notes": "This stickyNote node performs automated tasks as part of the workflow."}, {"id": "error-dca6dcd2", "name": "Error Handler", "type": "n8n-nodes-base.stopAndError", "typeVersion": 1, "position": [1000, 400], "parameters": {"message": "Workflow execution error", "options": {}}}], "active": false, "pinData": {}, "settings": {"executionOrder": "v1", "saveManualExecutions": true, "callerPolicy": "workflowsFromSameOwner", "errorWorkflow": null, "timezone": "UTC", "executionTimeout": 3600, "maxExecutions": 1000, "retryOnFail": true, "retryCount": 3, "retryDelay": 1000}, "versionId": "b3ee0a62-7c2f-4dc4-9e2c-f16211e02008", "connections": {"d9df98fe-bf03-45bd-9cb9-ed32371b7970": {"main": [[{"node": "error-handler-d9df98fe-bf03-45bd-9cb9-ed32371b7970-aed81391", "type": "main", "index": 0}]]}, "259a7fa0-4b37-453e-a730-fb2fc7bc3eb0": {"main": [[{"node": "error-handler-259a7fa0-4b37-453e-a730-fb2fc7bc3eb0-47315d7c", "type": "main", "index": 0}]]}, "d00720d9-a344-48c9-9c31-7c4391ecda70": {"main": [[{"node": "error-handler-d00720d9-a344-48c9-9c31-7c4391ecda70-0c7fa219", "type": "main", "index": 0}]]}, "4cd99298-968b-4a47-bcf9-b4e006d8dab0": {"main": [[{"node": "error-handler-4cd99298-968b-4a47-bcf9-b4e006d8dab0-78cbd4a6", "type": "main", "index": 0}]]}}, "description": "Automated workflow: Fetch the Most Recent Document from Google Drive. This workflow integrates 8 different services: stickyNote, googleDriveTrigger, stopAndError, toolWikipedia, googleSheets. It contains 16 nodes and follows best practices for error handling and security.", "notes": "Excellent quality workflow: Fetch the Most Recent Document from Google Drive. This workflow has been optimized for production use with comprehensive error handling, security, and documentation."}