Google Drive workflow with nested folder support
π€ Whoβs it for
- Anyone who needs to recursively fetch all files from a specific Google Drive folder, including files inside all its nested (child) folders.
- Ideal for automation builders, admins, and integrators who want to process, move, list, or report on all files in a complex folder tree.
βοΈ How it works / What it does
This workflow will:
- Accept a Google Drive Folder ID as an input (from another workflow or trigger).
- Recursively discover all child folders starting from the parent, no matter how many levels deep.
- Collect all file IDs & names from every folder (parent + all descendants).
- Return a clean list of all found files (with IDs and names) for further automation, downloading, or processing.
Key features:
- π‘ Works recursively (handles any depth of nested folders).
- π·οΈ Outputs file ID & file name for each discovered file.
- π Can be triggered by other workflows (great for modular automation).
π οΈ How to set up
1. Google Drive Credentials
- Make sure youβve set up a Google Drive OAuth2 credential in n8n.
- Connect this credential to all Google Drive nodes in the workflow.
2. Parent Folder ID
- Input the Google Drive folder ID you want to start from.
- How to pass it:
- If running standalone: update the
When Executed by Another Workflownode with your folder ID. - If called from another workflow: pass the folder ID as an input named
id.
- If running standalone: update the
3. Check Set Nodes
- There are two Set nodes (
Return parentandReturn parent1) and one trigger (When Executed by Another Workflow) where you might want to update the hardcoded folder ID. - β οΈ Change these IDs to match your use case.
4. Run the Workflow
- Start the workflow (or execute it via another workflow).
- The result will be a flat list of files in all subfolders.
β Requirements
- π’ n8n instance
- π’ Google Drive OAuth2 credentials connected in n8n
- π’ A valid Google Drive folder ID to start from
π§βπ» How to customize
- Return Extra Data:
Add fields in the βSearch filesβ node options to return more Google Drive file metadata (e.g., size, webViewLink). - Filter by File Type:
Adjust the search query or add a filter node to only include certain file types (e.g., PDFs, Docs). - Change Output Format:
Edit the βEdit Fieldsβ Set node to structure your output differently. - Integrate Further:
Add new nodes after the Loop to, for example, download, email, or sync files as needed.
π¨ Notes & Tips
- Performance:
This workflow is optimized for up to hundreds of folders. For very large Drive accounts (thousands of folders/files), consider pagination or batching. - Credential Security:
Always use n8nβs built-in credential managerβnever hard-code sensitive data. - Static IDs:
As noted in the sticky note, make sure to update all hardcoded folder IDs for your production use.
ποΈ Node Overview
- When Executed by Another Workflow: Accepts a folder ID (entry point).
- Google Drive β Get children folders: Lists subfolders of the given folder.
- If: Checks if the folder contains any subfolders.
- Execute Workflow: Handles recursion (calls itself on child folders).
- Code: Flattens all discovered folder IDs for next step.
- Loop Over Items: Iterates over all folders to process files.
- Google Drive β Search files: Finds all files in each folder.
- Edit Fields (Set): Structures file data for output.
- Sticky Note: Documentation and reminders inside your workflow.
π Example Output
[
{
"file_id": "1A2B3C...",
"file_name": "MyDoc.pdf"
},
{
"file_id": "2B3C4D...",
"file_name": "Presentation.pptx"
}
]
Google Drive Workflow with Nested Folder Support
This n8n workflow demonstrates how to interact with Google Drive, specifically focusing on handling nested folder structures. It provides a foundational example for automating Google Drive operations within a larger workflow.
What it does
This workflow is designed as a sub-workflow, meaning it's intended to be called and executed by another n8n workflow. It doesn't have a direct trigger of its own but rather acts as a modular component for Google Drive operations.
The workflow performs the following key steps:
- Receives Data from Parent Workflow: It starts by being triggered by another workflow, expecting input data that likely contains information relevant to Google Drive operations (though the specific operations are not defined in this JSON, the presence of the Google Drive node suggests this intent).
- Prepares Data (Edit Fields): It includes an "Edit Fields" node (Set) which is typically used to transform, add, or remove fields from the incoming data. This is crucial for formatting data correctly before passing it to subsequent nodes.
- Conditional Logic (If): An "If" node is present, indicating that the workflow can implement conditional logic based on the processed data. This allows for different paths of execution depending on specific conditions being met (e.g., checking if a folder exists, if a file type is correct, etc.).
- Loop Over Items (Split in Batches): The "Loop Over Items" node (Split in Batches) suggests that the workflow is capable of processing multiple items of data in batches. This is useful when dealing with lists of files or folders from Google Drive.
- Interacts with Google Drive: A "Google Drive" node is included, which is the core component for performing actions within Google Drive. While the specific operation (e.g., create file, list folders, upload) is not defined in this JSON, its presence confirms the workflow's purpose.
- Executes Custom Code: A "Code" node allows for custom JavaScript logic to be executed. This can be used for advanced data manipulation, API calls, or complex conditional checks that aren't easily handled by standard n8n nodes.
- Sticky Note for Documentation: A "Sticky Note" is included for internal documentation within the workflow, providing context or instructions for users.
Prerequisites/Requirements
- n8n Instance: An active n8n instance where you can import and run this workflow.
- Google Drive Account: A Google Drive account with appropriate permissions for the operations you intend to perform.
- Google Drive n8n Credential: An n8n credential configured for your Google Drive account (OAuth 2.0 or Service Account).
Setup/Usage
- Import the Workflow:
- Download the provided JSON file.
- In your n8n instance, go to "Workflows" and click "New".
- Click the "Import from JSON" button and paste the workflow JSON or upload the file.
- Configure Credentials:
- Locate the "Google Drive" node.
- Click on the "Credential" field and select your existing Google Drive credential. If you don't have one, click "Create New" and follow the n8n instructions to set up a Google Drive OAuth 2.0 or Service Account credential.
- Integrate as a Sub-workflow:
- This workflow is designed to be called by an "Execute Sub-workflow" node in a parent workflow.
- In your parent workflow, add an "Execute Sub-workflow" node.
- Configure it to call this "Google Drive Workflow with Nested Folder Support" workflow.
- Pass the necessary input data from your parent workflow to this sub-workflow.
- Customize:
- The "Google Drive" node is currently generic. You will need to configure its specific operation (e.g., "Upload File", "Create Folder", "List Files", "Move File") and parameters based on your use case.
- Adjust the "Edit Fields" (Set) and "Code" nodes to process and prepare data as required for your Google Drive operations.
- Modify the "If" node's conditions to implement your desired branching logic.
- The "Loop Over Items" node can be configured to process items one by one or in custom batch sizes.
Related Templates
Send WooCommerce cross-sell offers to customers via WhatsApp using Rapiwa API
Who Is This For? This n8n workflow enables automated cross-selling by identifying each WooCommerce customer's most frequently purchased product, finding a related product to recommend, and sending a personalized WhatsApp message using the Rapiwa API. It also verifies whether the user's number is WhatsApp-enabled before sending, and logs both successful and unsuccessful attempts to Google Sheets for tracking. What This Workflow Does Retrieves all paying customers from your WooCommerce store Identifies each customer's most purchased product Finds the latest product in the same category as their most purchased item Cleans and verifies customer phone numbers for WhatsApp compatibility Sends personalized WhatsApp messages with product recommendations Logs all activities to Google Sheets for tracking and analysis Handles both verified and unverified numbers appropriately Key Features Customer Segmentation: Automatically identifies paying customers from your WooCommerce store Product Analysis: Determines each customer's most purchased product Smart Recommendations: Finds the latest products in the same category as customer favorites WhatsApp Integration: Uses Rapiwa API for message delivery Phone Number Validation: Verifies WhatsApp numbers before sending messages Dual Logging System: Tracks both successful and failed message attempts in Google Sheets Rate Limiting: Uses batching and wait nodes to prevent API overload Personalized Messaging: Includes customer name and product details in messages Requirements WooCommerce store with API access Rapiwa account with API access for WhatsApp verification and messaging Google account with Sheets access Customer phone numbers in WooCommerce (stored in billing.phone field) How to Use β Step-by-Step Setup Credentials Setup WooCommerce API: Configure WooCommerce API credentials in n8n (e.g., "WooCommerce (get customer)" and "WooCommerce (get customer data)") Rapiwa Bearer Auth: Create an HTTP Bearer credential with your Rapiwa API token Google Sheets OAuth2: Set up OAuth2 credentials for Google Sheets access Configure Google Sheets Ensure your sheet has the required columns as specified in the Google Sheet Column Structure section Verify Code Nodes Code (get paying_customer): Filters customers to include only those who have made purchases Get most buy product id & Clear Number: Identifies the most purchased product and cleans phone numbers Configure HTTP Request Nodes Get customer data: Verify the WooCommerce API endpoint for retrieving customer orders Get specific product data: Verify the WooCommerce API endpoint for product details Get specific product recommend latest product: Verify the WooCommerce API endpoint for finding latest products by category Check valid WhatsApp number Using Rapiwa: Verify the Rapiwa endpoint for WhatsApp number validation Rapiwa Sender: Verify the Rapiwa endpoint for sending messages Google Sheet Required Columns Youβll need two Google Sheets (or two tabs in one spreadsheet): A Google Sheet formatted like this β€ sample The workflow uses a Google Sheet with the following columns to track coupon distribution: Both must have the following headers (match exactly): | name | number | email | address1 | price | suk | title | product link | validity | staus | | ---------- | ------------- | ----------------------------------------------- | ----------- | ----- | --- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- | -------- | | Abdul Mannan | 8801322827799 | contact@spagreen.net | mirpur dohs | 850 | | Sharp Most Demanding Hoodie x Nike | https://yourshopdomain/p-img-nike | verified | sent | | Abdul Mannan | 8801322827799 | contact@spagreen.net | mirpur dohs | 850 | | Sharp Most Demanding Hoodie x Nike | https://yourshopdomain/p-img-nike | unverified | not sent | | Abdul Mannan | 8801322827799 | contact@spagreen.net | mirpur dohs | 850 | | Sharp Most Demanding Hoodie x Nike | https://yourshopdomain/p-img-nike | verified | sent | Important Notes Phone Number Format: The workflow cleans phone numbers by removing all non-digit characters. Ensure your WooCommerce phone numbers are in a compatible format. API Rate Limits: Rapiwa and WooCommerce APIs have rate limits. Adjust batch sizes and wait times accordingly. Data Privacy: Ensure compliance with data protection regulations when sending marketing messages. Error Handling: The workflow logs unverified numbers but doesn't have extensive error handling. Consider adding error notifications for failed API calls. Product Availability: The workflow recommends the latest product in a category, but doesn't check if it's in stock. Consider adding stock status verification. Testing: Always test with a small batch before running the workflow on your entire customer list. Useful Links Dashboard: https://app.rapiwa.com Official Website: https://rapiwa.com Documentation: https://docs.rapiwa.com Support & Help WhatsApp: Chat on WhatsApp Discord: SpaGreen Community Facebook Group: SpaGreen Support Website: https://spagreen.net Developer Portfolio: Codecanyon SpaGreen
Track SDK documentation drift with GitHub, Notion, Google Sheets, and Slack
π Description Automatically track SDK releases from GitHub, compare documentation freshness in Notion, and send Slack alerts when docs lag behind. This workflow ensures documentation stays in sync with releases, improves visibility, and reduces version drift across teams. πππ¬ What This Template Does Step 1: Listens to GitHub repository events to detect new SDK releases. π§© Step 2: Fetches release metadata including version, tag, and publish date. π¦ Step 3: Logs release data into Google Sheets for record-keeping and analysis. π Step 4: Retrieves FAQ or documentation data from Notion. π Step 5: Merges GitHub and Notion data to calculate documentation drift. π Step 6: Flags SDKs whose documentation is over 30 days out of date. β οΈ Step 7: Sends detailed Slack alerts to notify responsible teams. π Key Benefits β Keeps SDK documentation aligned with product releases β Prevents outdated information from reaching users β Provides centralized release tracking in Google Sheets β Sends real-time Slack alerts for overdue updates β Strengthens DevRel and developer experience operations Features GitHub release trigger for real-time monitoring Google Sheets logging for tracking and auditing Notion database integration for documentation comparison Automated drift calculation (days since last update) Slack notifications for overdue documentation Requirements GitHub OAuth2 credentials Notion API credentials Google Sheets OAuth2 credentials Slack Bot token with chat:write permissions Target Audience Developer Relations (DevRel) and SDK engineering teams Product documentation and technical writing teams Project managers tracking SDK and doc release parity Step-by-Step Setup Instructions Connect your GitHub account and select your SDK repository. Replace YOURGOOGLESHEETID and YOURSHEET_GID with your tracking spreadsheet. Add your Notion FAQ database ID. Configure your Slack channel ID for alerts. Run once manually to validate setup, then enable automation.
Automate Gmail responses with GPT and human-in-the-loop verification
Try It Out! This n8n template uses AI to automatically respond to your Gmail inbox by drafting response for your approval via email. How it works Gmail Trigger monitors your inbox for new emails AI Analysis determines if a response is needed based on your criteria Draft Generation creates contextually appropriate replies using your business information Human Approval sends you the draft for review before sending Auto-Send replies automatically once approved Setup Connect your Gmail account to the Gmail Trigger node Update the "Your Information" node with: Entity name and description Approval email address Resource guide (FAQs, policies, key info) Response guidelines (tone, style, formatting preferences) Configure your LLM provider (OpenAI, Claude, Gemini, etc.) with API credentials Test with a sample email Requirements n8n instance (self-hosted or cloud) Gmail account with API access LLM provider API key Need Help? Email Nick @ nick@tropicflare.com