Alex Kim
n8n Ambassador & Certified Expert Partner
Templates by Alex Kim
Generate leads with Google Maps
This workflow leverages n8n to perform automated Google Maps API queries and manage data efficiently in Google Sheets. It's designed to extract specific location data based on a given list of ZIP codes and categories. --- Features Queries the Google Maps API for location data using predefined ZIP codes and subcategories. Filters, de-duplicates, and organizes data into structured rows in Google Sheets. Implements exponential backoff retries to handle API rate limits. Logs and updates statuses directly in Google Sheets for easy tracking. --- Prerequisites Google OAuth Credentials: A configured Google Cloud project for Google Maps API and Sheets API access. Google Sheets: A sheet with ZIP codes and categories defined (e.g., "AZ Zips"). n8n Setup: A running instance of n8n with credentials configured for Google OAuth. --- Setup Instructions Prepare Google Sheets Add the ZIP codes to the "AZ Zips" sheet. Define subcategories in another sheet (e.g., "Google Maps Categories"). Provide the sheet's URL in the Settings node of the workflow. Configure API Access Set up Google OAuth credentials for Maps and Sheets APIs in n8n. Ensure your API key has access to the places.searchText endpoint. Workflow Customization Modify textQuery parameters in the GMaps API node to match your query needs. Adjust trigger intervals as required (e.g., manual or scheduled execution). Run the Workflow Execute the workflow manually or schedule periodic runs to keep your data updated. --- Notes This workflow includes robust error handling to retry failed API calls with exponential backoff. All data is organized and logged directly in Google Sheets for easy reference and updates. For more information or issues, feel free to reach out!
Hacker News to video content
Hacker News to Video Content Overview This workflow converts trending articles from Hacker News into engaging video content. It integrates AI-based tools to analyze, summarize, and generate multimedia content, making it ideal for content creators, educators, and marketers. --- Features Article Retrieval: Pulls trending articles from Hacker News. Limits the number of articles to process (configurable). Content Analysis: Uses OpenAI's GPT model to: Summarize articles. Assess their relevance to specific topics like automation or AI. Extract key image URLs. Image and Video Generation: Leonardo.ai: Creates stunning AI-generated images based on extracted prompts. RunwayML: Converts images into high-quality videos. Structured Content Creation: Parses content into structured formats for easy reuse. Generates newsletter-friendly blurbs and social media-ready captions. Cloud Integration: Uploads generated assets to: Dropbox Google Drive Microsoft OneDrive MinIO Social Media Posting (Optional): Supports posting to YouTube, X (Twitter), LinkedIn, and Instagram. --- Workflow Steps Trigger Initiated manually via the "Test Workflow" button. Fetch Articles Retrieves articles from Hacker News. Limits the results to avoid processing overload. Content Filtering Evaluates if articles are related to AI/Automation using OpenAI's language model. Image and Video Generation Generates: AI-driven image prompts via Leonardo.ai. Videos using RunwayML. Asset Management Saves the output to cloud storage services or uploads directly to social media platforms. --- Prerequisites API Keys: Hacker News OpenAI Leonardo.ai RunwayML Creatomate n8n Installation: Ensure n8n is installed and configured locally or on a server. Credentials: Set up credentials in n8n for all external services used in the workflow. --- Customization Replace Hacker News with any other data source node if needed. Configure the "Article Analysis" node for different topics. Adjust the cloud storage services or add custom storage options. --- Usage Import this workflow into your n8n instance. Configure your API credentials. Trigger the workflow manually or schedule it as needed. Check the outputs in your preferred cloud storage or social media platform. --- Notes Extend this workflow further by automating social media posting or newsletter integration. For any questions, refer to the official documentation or reach out to the creator. --- About the Creator This workflow was built by AlexK1919, an AI-native workflow automation architect. Check out the overview video for a quick demo. --- Tools Used Leonardo.ai RunwayML Creatomate Hacker News API OpenAI GPT Feel free to adapt and extend this workflow to meet your specific needs! 🎉
Automate google analytics reporting
Automate Google Analytics Reporting with n8n This n8n workflow collects, processes, and formats Google Analytics data into a comprehensive HTML report. The report is segmented into three primary categories: Engagement Stats, Search Results, and Country Views. The formatted report can be emailed or saved as a document, and the workflow includes error handling and logging for better debugging. Overview Purpose To automate the extraction, processing, and presentation of Google Analytics data in a visually appealing and structured format for easier insights and decision-making. Features Data Parsing: Individual parsers process raw Google Analytics data for different time periods and categories. Data Aggregation: Combines parsed data into a single structured JSON object. HTML Report Generation: Formats the aggregated data into an HTML table with color-coded segments for better readability. Email or Document Output: The formatted report can be emailed or saved as a Google Doc (will need additional setup). Error Handling: Includes checks for missing data and detailed error messages for debugging. Workflow Steps Data Fetching: Six separate Google Analytics data pulls: Page Engagement Stats (This Week and Prior Week) Google Search Results (This Week and Prior Week) Country Views (This Week and Prior Week) Data Parsing: Each data pull is processed using a dedicated parser node to generate a URL-safe string. Example nodes: Parse - Get Page Engagement This Week Parse - Country Views Prior Week Data Aggregation: Aggregates parsed data into a structured JSON object using the Aggregate Data node. Ensures consistency and handles missing or malformed data. HTML Report Generation: Creates a formatted HTML report with color-coded tables for each segment: Engagement Stats: Green Search Results: Blue Country Views: Orange Includes headers and neatly formatted tables for each data set. Output: The report can be sent via email using the Gmail API or saved to Google Docs. Example nodes: Gmail node for email delivery. Google Docs node for saving the report as a document. Requirements Prerequisites Google Cloud Setup: Enable Google Analytics API. Enable Gmail API (if using email output). Generate OAuth credentials for API access. n8n Installation: Self-hosted n8n instance with required nodes (Gmail, Google Docs, etc.). Free Cloud-based n8n account. Environment Variables Ensure API credentials and tokens are set up in the n8n environment. Update the respective nodes with client ID, client secret, and access tokens. Configuration Google Analytics Configure the Get Report nodes with the appropriate property ID and metrics. Ensure correct date ranges are selected for each node. Formatting Node The Format Data node processes aggregated data and generates the HTML content. Customize the HTML styling and segment colors as needed. Email Node Configure the Gmail node with OAuth credentials. Set the recipient email address and subject line dynamically. Error Handling Common Issues Authentication Errors: Ensure OAuth credentials are correct. Verify that the APIs are enabled in the Google Cloud Console. Empty Data: Check the raw data from Google Analytics. Validate the property ID and query parameters in the Get Report nodes. Parsing Errors: Ensure the parser nodes are correctly configured and match the expected input format. Debugging Use debug logs in each node to identify data flow issues. Add error-handling nodes to capture and log issues during execution. Example Usage Run the Workflow Trigger the workflow to fetch, process, and format Google Analytics data. Verify Output Check the formatted HTML output in the debug logs. Ensure the email or Google Doc contains the correctly formatted report. Future Enhancements Add support for additional metrics or dimensions. Integrate with Slack for notifications. Enable scheduling for automated reports. Add a visual dashboard for real-time analytics. ---
📥 Transform Google Drive documents into vector embeddings
Automatically convert documents from Google Drive into vector embeddings using OpenAI, LangChain, and PGVector — fully automated through n8n. --- ⚙️ What It Does This workflow monitors a Google Drive folder for new files, supports multiple file types (PDF, TXT, JSON), and processes them into vector embeddings using OpenAI’s text-embedding-3-small model. These embeddings are stored in a Postgres database using the PGVector extension, making them query-ready for semantic search or RAG-based AI agents. After successful processing, files are moved to a separate “vectorized” folder to avoid duplication. --- 💡 Use Cases Powering Retrieval-Augmented Generation (RAG) AI agents Semantic search across private documents AI assistant knowledge ingestion Automated document pipelines for indexing or classification --- 🧠 Workflow Highlights Trigger Options: Manual or Scheduled (3 AM daily by default) Supported File Types: PDF, TXT, JSON Embedding Stack: LangChain Text Splitter, OpenAI Embeddings, PGVector Deduplication: Files are moved after processing License: CC BY-SA 4.0 Author: AlexK1919 --- 🛠 What You’ll Need Google Drive OAuth2 credentials (connected to Search Folder, Download File, and Move File nodes) OpenAI API Key (used in the Embeddings OpenAI node) Postgres + PGVector database (connected in the Postgres PGVector Store node) --- 🔧 Step-by-Step Setup Instructions Create Google OAuth2 credentials in n8n and connect them to all Google Drive nodes. Set your source folder ID in the Search Folder node — this is where incoming files are placed. Set your processed folder ID in the Move File node — files will be moved here after vectorization. Ensure you have a PGVector-enabled Postgres instance and input the table name and collection in the Postgres PGVector Store node. Add your OpenAI credentials to the Embeddings OpenAI node and select text-embedding-3-small. Optional: Activate the Schedule Trigger node to run daily or configure your own schedule. Run manually by triggering When clicking ‘Test workflow’ for on-demand ingestion. --- 🧩 Customization Tips Want to support more file types or enhance the pipeline? Add new extractors: Use Extract from File with other formats like DOCX, Markdown, or HTML. Refine logic by file type: The Switch node routes files to the correct extraction method based on MIME type (application/pdf, text/plain, application/json). Pre-process with OCR: Add an OCR step before extraction to handle scanned PDFs or images. Add filters: Enhance the Search Folder or Switch node logic to skip specific files or folders. --- 📄 License This workflow is available under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license. You are free to use, adapt, and share this workflow for non-commercial purposes under the terms of this license. Full license details: https://creativecommons.org/licenses/by-nc-sa/4.0/
Automatically promote your YouTube video on X
YouTube to X Post Overview This n8n workflow automates the process of promoting your latest YouTube videos on X (formerly Twitter). It ensures that posts are engaging, concise, and follow platform-specific requirements. Additionally, the workflow logs social posts into a Google Sheet for record-keeping. Features Fetch Latest YouTube Videos: Pulls recently uploaded videos from a specified channel. Generate Engaging X Posts: Uses OpenAI's GPT-4 to create tailored, witty posts about your videos. Character Limit Validation: Ensures posts comply with X's character limit by rewriting if necessary. Post Scheduling: Automates post publishing to X. Google Sheets Integration: Logs posts and their status for tracking and management. Optional Notifications: Sends updates via Discord, Slack, or Gmail (disabled by default). --- How It Works Trigger: Manually trigger the workflow or set a scheduled check for new videos (disabled by default). Fetch YouTube Videos: Retrieves the latest videos from your YouTube channel, filtering duplicates. Content Creation: OpenAI generates a witty and humanized post under 220 characters, using video title and description. If the post exceeds the character limit, it is rewritten automatically. Google Sheets Logging: Logs the generated post to a Google Sheet with details like time, date, and post status. Post to X: Publishes the generated post on X. Updates the Google Sheet with the post URL. Optional Notifications: Sends notifications about the published post via Discord, Slack, or Gmail. --- Setup Instructions Credentials: Add credentials for: YouTube API OpenAI API Google Sheets API X (formerly Twitter) API Use the accounts associated with "AlexK1919." YouTube Node: Specify your YouTube Channel ID in the Fetch Latest Videos node. Find your Channel ID here. Google Sheets Node: Configure the node with your Google Sheet for logging posts. Use the linked sheet: AlexK1919 Social Posts. OpenAI Node: Set up your OpenAI API key for generating posts. X Post Node: Connect your X account to the Post to X node. Optional Notifications: Configure Discord, Slack, or Gmail nodes for custom notifications. --- Customization Schedule: Enable and modify the Check Every 2 Hours node to automatically check for new videos. Post Format: Edit the OpenAI prompt in the Generate X Post node to tweak the tone or style of the generated posts. Additional Platforms: Expand this workflow to post on other social platforms by adding respective nodes (e.g., Facebook, LinkedIn). --- Notes Posts are validated for character limits but are restricted to 220 characters to ensure compliance with X's guidelines and leave space for links. Posts are logged in the Google Sheet with details, including post status and timestamps. Current integrations are focused on promoting YouTube content; additional types can be supported with minor adjustments. --- Contact For support or inquiries: Alex Kim About Me
Ultimate content generator for WordPress
Overview This workflow automates the end-to-end process of creating, optimizing, and publishing content on WordPress. It integrates AI-powered tools, Airtable, and WordPress plugins to generate high-quality, on-brand posts effortlessly. Perfect for content creators, marketers, and business owners looking to save time and scale their content strategy. --- Features Content Creation: AI-Powered Content: Generates SEO-friendly blog posts with structured headings, relevant keywords, and meta descriptions. Custom Prompts: Tailor the AI-generated content to match your brand’s tone and voice. SEO Optimization: RankMath Plugin Integration: Updates RankMath SEO with focus keywords and meta descriptions, ensuring your content is search-engine optimized. Content Management: Airtable Integration: Organizes content ideas, drafts, and publishing schedules in one place. Easily scalable for teams or solo creators. Visuals: Branded Featured Images: Automatically generates on-brand images for every post. Publishing: Effortless Formatting: Adapts content to fit your WordPress theme and schedules it for publication. --- Workflow Steps Trigger: Initiated manually or on a schedule. Content Management: Retrieves and organizes ideas from Airtable. Content Generation: Generates AI-driven blog content tailored to your audience. SEO Optimization: Automatically updates RankMath with SEO details. Featured Image Creation: Produces on-brand images for the post. Publishing: Formats and schedules the post on WordPress. --- Prerequisites API Keys: OpenAI Airtable WordPress REST API RankMath SEO Plugin Custom Code: Add a small update to your WordPress theme’s functions.php file to enable seamless automation. --- Customization Replace Airtable with another content management system if preferred. Adjust AI prompts to reflect different tones, styles, or industries. Add integrations for additional plugins, analytics, or storage services. --- Usage Import the workflow into your n8n instance. Configure API credentials for WordPress, Airtable, OpenAI, and RankMath. Update your functions.php file with the provided code snippet. Customize prompts and Airtable structure for your content needs. Trigger the workflow manually or set it on a schedule. --- Notes Experiment with Airtable views or add filters for more granular control over your content pipeline. Extend the workflow to include social media posting or analytics tracking. For questions, refer to n8n documentation or reach out to the creator. --- Tools Used Airtable OpenAI GPT WordPress REST API RankMath SEO Plugin Feel free to adapt and extend this workflow to meet your specific needs! 🎉
Content generator for WordPress v3
UPDATE This is an updated version of the previous Ultimate Content Generator for WordPress v2. https://n8n.io/workflows/2737-ultimate-content-generator-for-wordpress/ It includes an additional workflow to generate content using Anthropic Claude in addition to OpenAI 4o. I also mofidied it to use the AI Agent Tool node with structured output for more consistent outputs. Lastly, the workflow updates a new table in AirTable with the published blog post url and featured image url. Overview- This workflow automates the end-to-end process of creating, optimizing, and publishing content on WordPress. It integrates AI-powered tools, Airtable, and WordPress plugins to generate high-quality, on-brand posts effortlessly. Perfect for content creators, marketers, and business owners looking to save time and scale their content strategy. Features Content Creation: AI-Powered Content: Generates SEO-friendly blog posts with structured headings, relevant keywords, and meta descriptions. Custom Prompts: Tailor the AI-generated content to match your brand’s tone and voice. SEO Optimization: RankMath Plugin Integration: Updates RankMath SEO with focus keywords and meta descriptions, ensuring your content is search-engine optimized. Content Management: Airtable Integration: Organizes content ideas, drafts, and publishing schedules in one place. Easily scalable for teams or solo creators. Visuals: Branded Featured Images: Automatically generates on-brand images for every post. Publishing: Effortless Formatting: Adapts content to fit your WordPress theme and schedules it for publication. Workflow Steps Trigger: Initiated manually or on a schedule. Content Management: Retrieves and organizes ideas from Airtable. Content Generation: Generates AI-driven blog content tailored to your audience. SEO Optimization: Automatically updates RankMath with SEO details. Featured Image Creation: Produces on-brand images for the post. Publishing: Formats and schedules the post on WordPress. Prerequisites API Keys: OpenAI Claude Airtable WordPress REST API Custom Code: Add a small update to your WordPress theme’s functions.php file to enable seamless automation. Customization Replace Airtable with another content management system if preferred. Adjust AI prompts to reflect different tones, styles, or industries. Add integrations for additional plugins, analytics, or storage services. Usage Import the workflow into your n8n instance. Configure API credentials for WordPress, Airtable, OpenAI, Claude and Slack. Update your functions.php file with the provided code snippet. Customize prompts and Airtable structure for your content needs. Trigger the workflow manually or set it on a schedule. Notes Experiment with Airtable views or add filters for more granular control over your content pipeline. Extend the workflow to include social media posting or analytics tracking. Feel free to adapt and extend this workflow to meet your specific needs! 🎉
Optimize & update Printify title and description workflow
Printify Automation - Update Title and Description Workflow This n8n workflow automates the process of retrieving products from Printify, generating optimized product titles and descriptions, and updating them back to the platform. It leverages OpenAI for content generation and integrates with Google Sheets for tracking and managing updates. --- Features Integration with Printify: Fetch shops and products through Printify's API. AI-Powered Optimization: Generate engaging product titles and descriptions using OpenAI's GPT model. Google Sheets Tracking: Log and manage updates in Google Sheets. Custom Brand Guidelines: Ensure consistent tone by incorporating brand-specific instructions. Loop Processing: Iteratively process each product in batches. --- Workflow Structure Nodes Overview Manual Trigger: Manually start the workflow for testing purposes. Printify - Get Shops: Retrieves the list of shops from Printify. Printify - Get Products: Fetches product details for each shop. Split Out: Breaks down the product list into individual items for processing. Loop Over Items: Iteratively processes products in manageable batches. Generate Title and Desc: Uses OpenAI GPT to create optimized product titles and descriptions. Google Sheets Integration: Trigger: Monitors Google Sheets for changes. Log Updates: Records product updates, including old and new titles/descriptions. Conditional Logic: If Nodes: Ensure products are ready for updates and stop processing once completed. Printify - Update Product: Sends updated titles and descriptions back to Printify. Brand Guidelines + Custom Instructions: Sets brand tone and seasonal instructions. --- Setup Instructions Prerequisites n8n Instance: Ensure n8n is installed and configured. Printify API Key: Obtain an API key from your Printify account. Add it to n8n under HTTP Header Auth. OpenAI API Key: Obtain an API key from OpenAI. Add it to n8n under OpenAI API. Google Sheets Integration: Share your Google Sheets with the Google API service account. Configure Google Sheets credentials in n8n. --- Workflow Configuration Set Brand Guidelines: Update the Brand Guidelines + Custom Instructions node with your brand name, tone, and seasonal instructions. Batch Size: Configure the Loop Over Items node for optimal batch sizes. Google Sheets Configuration: Set the correct Google Sheets document and sheet names in the integration nodes. Run the Workflow: Start manually or configure the workflow to trigger automatically. --- Key Notes Customization: Modify API calls to support other platforms like Printful or Vistaprint. Scalability: Use batch processing for efficient handling of large product catalogs. Error Handling: Configure retries or logging for any failed nodes. --- Output Examples Optimized Content Example Input Title: "Classic White T-Shirt" Generated Title: "Stylish Classic White Tee for Everyday Wear" Input Description: "Plain white T-shirt made of cotton." Generated Description: "Discover comfort and style with our classic white tee, crafted from premium cotton for all-day wear. Perfect for casual outings or layering." --- Next Steps Monitor Updates: Use Google Sheets to review logs of updated products. Expand Integration: Add support for more Printify shops or integrate with other platforms. Enhance AI Prompts: Customize prompts for different product categories or seasonal needs. --- Feel free to reach out for additional guidance or troubleshooting!
Transform text into AI videos with Google Veo3, Leonardo.ai and Claude 4
🎬 Google Veo 3 Prompt and Video Generator via Leonardo.ai + Claude 4 Transform text descriptions into cinematic videos using Google's Veo 3 model through Leonardo.ai's platform! 🚀 What This Workflow Does This advanced automation pipeline takes your creative ideas and turns them into professional-quality videos using Google's powerful Veo 3 model (accessed via Leonardo.ai), enhanced by Claude 4's sophisticated prompt engineering. ✨ Key Features 🤖 AI-Powered Prompt Enhancement: Uses Claude 4 Sonnet with Wikipedia integration to craft optimal Google Veo 3 prompts 🎥 Professional Video Generation: Leverages Google's Veo 3 model through Leonardo.ai for high-quality text-to-video conversion ☁️ Automatic Cloud Storage: Videos are automatically saved to your Google Drive 📋 Structured Prompting: Follows Google Veo3 best practices with 8 essential elements (Subject, Context, Action, Style, Camera Motion, Composition, Ambiance, Audio) ⚡ Hands-Off Processing: Set it and forget it - the workflow handles the entire pipeline 🔧 How It Works Input Your Concept - Describe your video idea in the "Video Context" node AI Enhancement - Claude 4 transforms your description into a cinematic Google Veo 3 prompt using advanced techniques Video Generation - Google's Veo 3 model (via Leonardo.ai) creates your video (720p resolution, ~8 seconds) Smart Waiting - 4-minute processing buffer ensures completion Auto-Download - Retrieves the finished video from Leonardo's servers Cloud Storage - Uploads directly to your Google Drive folder 💡 Perfect For Content Creators looking to automate video production Marketing Teams needing quick promotional videos Educators creating engaging visual content Social Media Managers generating scroll-stopping content Creative Professionals exploring AI-assisted filmmaking 📋 Requirements Leonardo AI account with API access Anthropic API key (Claude 4 Sonnet) Google Drive integration N8N instance (cloud or self-hosted) 👨💻 About the Creator Created by: AlexK1919 - AI-Native Workflow Automation Architect, n8n Ambassador and Verified Partner, Founder @ WotAI If you'd like to review more Google Veo 3 Prompts organized by business category, check out over 9,000+ free, pre-made prompts at: Google Veo 3 Prompts 📄 License This workflow is available under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license. You are free to use, adapt, and share this workflow for non-commercial purposes under the terms of this license. Full license details: https://creativecommons.org/licenses/by-nc-sa/4.0/ 🎯 Example Output Input: "Star Wars stormtrooper digging for uranium in desert, saying something funny" The AI generates a structured prompt with: Subject: Detailed character description Context: Desert environment specifics Action: Dynamic digging movements Style: Cinematic vlog aesthetic Camera: Appropriate angles and movement Audio: Dialogue, sound effects, and music ⚙️ Setup Notes Character Limit: Prompts are optimized for Leonardo's 1,500 character API limit Processing Time: Allow 4+ minutes for Google Veo3 video generation Quality: 720p resolution with native audio generation Consistency: Uses advanced Google Veo3 prompting for reliable results 🔄 Customization Options Modify the prompt engineering system message for different styles Adjust video resolution and model parameters Change storage destination (Google Drive folder) Add post-processing steps or notifications 📈 Why This Workflow Rocks Unlike simple text-to-video tools, this workflow: Intelligently enhances your prompts using AI for Google Veo 3 Follows industry best practices for Google Veo3 prompting Automates the entire pipeline from idea to stored video Leverages multiple AI models for superior results Handles technical details like API limits and timing 🚨 Pro Tips Be specific in your initial context - detail creates better videos The workflow includes comprehensive Google Veo3 prompting guidelines Videos are typically 5-8 seconds - plan accordingly for longer content Experiment with different styles and camera movements optimized for Veo 3 The AI can access Wikipedia for factual enhancement --- Ready to revolutionize your video creation process? Import this workflow and start generating professional videos with just a text description! Perfect for anyone looking to harness the power of AI for content creation. Tags: veo3 GoogleVeo3 AI VideoGeneration Leonardo Claude Automation ContentCreation GoogleAI
Exponential backoff for Google APIs
n8n Workflow: Exponential Backoff for Google APIs Overview This n8n workflow implements an Exponential Backoff mechanism to handle retries when interacting with Google APIs. It ensures that failed API requests are retried with increasing delays, up to a specified maximum retry count. This approach helps mitigate transient errors (e.g., rate limits or temporary network issues) while maintaining workflow efficiency. Key Features: Exponential Backoff Logic: Dynamically increases wait time between retries based on the retry count. Error Handling: Stops the workflow and raises an error after a specified number of retries. Dynamic Waiting: Waits for a calculated duration before each retry. Scalable Design: Modular nodes for easy debugging and customization. --- Workflow Details Nodes in the Workflow: Trigger (When clicking "Test Workflow"): Manually starts the workflow for testing. Loop Over Items: Iterates over multiple input items to process Google API requests row by row. Google API Node (Example: Update Sheet): Sends a request to a Google API endpoint (e.g., updating a row in Google Sheets). On success: Moves to the next item in the loop. On error: Passes the error to the Exponential Backoff node. Exponential Backoff: Calculates the delay for the next retry based on the retry count. Logic: javascript const retryCount = $json["retryCount"] || 0; const maxRetries = 5; const initialDelay = 1; // in seconds if (retryCount < maxRetries) { const currentDelayInSeconds = initialDelay * Math.pow(2, retryCount); return { json: { retryCount: retryCount + 1, waitTimeInSeconds: currentDelayInSeconds, status: 'retrying', } }; } else { return { json: { error: 'Max retries exceeded', retryCount: retryCount, status: 'failed' } }; } Wait: Dynamically waits for the waitTimeInSeconds value calculated in the Exponential Backoff node. Configuration: Resume: After Time Interval Wait Amount: {{ $json["waitTimeInSeconds"] }} Unit: Seconds Check Max Retries: Evaluates whether the retry count has exceeded the maximum limit. Routes the workflow: True: Passes to the Stop and Error node. False: Loops back to the Google API node for retry. Stop and Error: Stops the workflow and logs the error when the maximum retry count is reached. --- Parameters Configurable Settings: Max Retries: Defined in the Exponential Backoff node (const maxRetries = 5). Adjust this value based on your requirements. Initial Delay: The starting wait time for retries, defined as 1 second. Google API Configuration: Ensure your Google API node is properly authenticated and configured with the desired endpoint and parameters. --- How to Use Import the Workflow: Copy the workflow JSON and import it into your n8n instance. Configure Google API Node: Set up the Google API node with your credentials and target API endpoint (e.g., Google Sheets, Gmail, etc.). Test the Workflow: Manually trigger the workflow and observe the retry behavior in case of errors. Monitor Logs: Use the console logs in the Exponential Backoff node to debug retry timings and status. --- Example Scenarios Scenario 1: Successful Execution The Google API processes all requests without errors. Workflow completes without triggering the retry logic. Scenario 2: Transient API Errors The Google API returns an error (e.g., 429 Too Many Requests). The workflow retries the request with increasing wait times. Scenario 3: Maximum Retries Exceeded The workflow reaches the maximum retry count (e.g., 5 retries). An error is raised, and the workflow stops. --- Considerations Jitter: This workflow does not implement jitter (randomized delay) since it's not required for low-volume use cases. If needed, jitter can be added to the exponential backoff calculation. Retry Storms: If multiple workflows run simultaneously, ensure your API quotas can handle potential retries. Error Handling Beyond Max Retries: Customize the Stop and Error node to notify stakeholders or log errors in a centralized system. --- Customization Options Adjust the maximum retry limit and delay calculation to suit your use case. Add additional logic to handle specific error codes differently. Extend the workflow to notify stakeholders when an error occurs (e.g., via Slack or email). --- Troubleshooting Retry Not Triggering: Ensure the retryCount variable is passed correctly between nodes. Confirm that the error output from the Google API node flows to the Exponential Backoff node. Incorrect Wait Time: Verify the Wait node is referencing the correct field for waitTimeInSeconds. --- Request for Feedback We are always looking to improve this workflow. If you have suggestions, improvements, or ideas for additional features, please feel free to share them. Your feedback helps us refine and enhance this solution!