by ainabler
Overall Description & Potential << What Does This Flow Do? >> Overall, this workflow is an intelligent sales outreach automation engine that transforms raw leads from a form or a list into highly personalized, ready-to-send introductory email drafts. The process is: it starts by fetching data, enriches it with in-depth AI research to uncover "pain points," and then uses those research findings to craft an email that is relevant to the solutions you offer. This system solves a key problem in sales: the lack of time to conduct in-depth research on every single lead. By automating the research and drafting stages, the sales team can focus on higher-value activities, like engaging with "warm" prospects and handling negotiations. Using Google Sheets as the main dashboard allows the team to monitor the entire process—from lead entry, research status, and email drafts, all the way to the send link—all within a single, familiar interface. << Potential Future Enhancements >> This workflow has a very strong foundation and can be further developed into an even more sophisticated system: Full Automation (Zero-Touch): Instead of generating a manual-click link, the output from the AI Agent can be directly piped into a Gmail or Microsoft 365 Email node to send emails automatically. A Wait node could be added to create a delay of a few minutes or hours after the draft is created, preventing instant sending. Automated Follow-up Sequences: The workflow can be extended to manage follow-up emails. By using a webhook to track email opens or replies, you could build logic like: "If the intro email is not replied to within 3 days, trigger the AI Agent again to generate follow-up email #1 based on a different template, and then send it." AI-Powered Lead Scoring: After the research stage, the AI could be given the additional task of scoring leads (e.g., 1-10 or High/Medium/Low Priority) based on how well the target company's profile matches your ideal customer profile (ICP). This helps the sales team prioritize the most promising leads. Full CRM Integration: Instead of Google Sheets, the workflow could connect directly to HubSpot, Salesforce, or Pipedrive. It would pull new leads from the CRM, perform the research, draft the email, and log all activities (research results, sent emails) back to the contact's timeline in the CRM automatically. Multi-Channel Outreach: Beyond email, the AI could be instructed to draft personalized LinkedIn Connection Request messages or WhatsApp messages. The workflow could then use the appropriate APIs to send these messages, expanding your outreach beyond just email.
by Ranjan Dailata
This workflow automates competitor keyword research using OpenAI LLM and Decodo for intelligent web scraping. Who this is for SEO specialists, content strategists, and growth marketers who want to automate keyword research and competitive intelligence. Marketing analysts managing multiple clients or websites who need consistent SEO tracking without manual data pulls. Agencies or automation engineers using Google Sheets as an SEO data dashboard for keyword monitoring and reporting. What problem this workflow solves Tracking competitor keywords manually is slow and inconsistent. Most SEO tools provide limited API access or lack contextual keyword analysis. This workflow solves that by: Automatically scraping any competitor’s webpage with Decodo. Using OpenAI GPT-4.1-mini to interpret keyword intent, density, and semantic focus. Storing structured keyword insights directly in Google Sheets for ongoing tracking and trend analysis. What this workflow does Trigger — Manually start the workflow or schedule it to run periodically. Input Setup — Define the website URL and target country (e.g., https://dev.to, france). Data Scraping (Decodo) — Fetch competitor web content and metadata. Keyword Analysis (OpenAI GPT-4.1-mini) Extract primary and secondary keywords. Identify focus topics and semantic entities. Generate a keyword density summary and SEO strength score. Recommend optimization and internal linking opportunities. Data Structuring — Clean and convert GPT output into JSON format. Data Storage (Google Sheets) — Append structured keyword data to a Google Sheet for long-term tracking. Setup Prerequisites n8n account with workflow editor access Decodo API credentials OpenAI API key Google Sheets account connected via OAuth2 Make sure to install the Decodo Community node. Create a Google Sheet Add columns for: primary_keywords, seo_strength_score, keyword_density_summary, etc. Share with your n8n Google account. Connect Credentials Add credentials for: Decodo API credentials - You need to register, login and obtain the Basic Authentication Token via Decodo Dashboard OpenAI API (for GPT-4o-mini) Google Sheets OAuth2 Configure Input Fields Edit the “Set Input Fields” node to set your target site and region. Run the Workflow Click Execute Workflow in n8n. View structured results in your connected Google Sheet. How to customize this workflow Track Multiple Competitors** → Use a Google Sheet or CSV list of URLs; loop through them using the Split In Batches node. Add Language Detection** → Add a Gemini or GPT node before keyword analysis to detect content language and adjust prompts. Enhance the SEO Report** → Expand the GPT prompt to include backlink insights, metadata optimization, or readability checks. Integrate Visualization** → Connect your Google Sheet to Looker Studio for SEO performance dashboards. Schedule Auto-Runs** → Use the Cron Node to run weekly or monthly for competitor keyword refreshes. Summary This workflow automates competitor keyword research using: Decodo** for intelligent web scraping OpenAI GPT-4.1-mini** for keyword and SEO analysis Google Sheets** for live tracking and reporting It’s a complete AI-powered SEO intelligence pipeline ideal for teams that want actionable insights on keyword gaps, optimization opportunities, and content focus trends, without relying on expensive SEO SaaS tools.
by Sankalp Dev
Automated Marketing Analytics Report with AI Agent How it works Transform your marketing data into actionable insights with this intelligent automation workflow. The system combines scheduled triggers with AI-powered analysis to deliver comprehensive marketing reports directly to your inbox. Key Features: Scheduled automated reporting (daily, weekly, or monthly) AI-powered data analysis using advanced language models Multi-platform marketing data integration via GoMarble MCP Intelligent report generation with actionable recommendations Direct email delivery of formatted reports Set up steps Prerequisites: GoMarble MCP account and API access Gmail account for report delivery n8n instance (cloud or self-hosted) Configuration Time: ~15-20 minutes Step-by-step setup: Connect GoMarble MCP to n8n Follow the integration guide: GoMarble n8n Setup Configure your marketing platform credentials (Google Ads, Facebook Ads, Analytics) Configure the Schedule Trigger Set your preferred reporting frequency Choose optimal timing for data availability Customize the Report Prompt Define specific metrics and KPIs to track Set analysis parameters and report format preferences Set up AI Agent Configuration Choose between Anthropic Claude or OpenAI models Configure the GoMarble MCP tools for your marketing platforms Configure Gmail Integration Set recipient email addresses Customize email template and subject line Advanced Configuration: Add conditional logic for performance thresholds Include custom data visualization requests Set up alert triggers for significant metric changes What you'll get Automated Intelligence:** Regular marketing performance analysis without manual effort Cross-Platform Insights:** Unified view of Google Ads, Facebook Ads, and Analytics data AI-Powered Recommendations:** Strategic insights and optimization suggestions Professional Reports:** Well-formatted, executive-ready marketing summaries Scalable Solution:** Easy to extend with additional marketing platforms or custom metrics Perfect for marketing teams, agencies, and business owners who want to stay on top of their marketing performance with minimal manual work.
by takuma
Who is this for This template is perfect for: Market Researchers** tracking industry trends. Tech Teams** wanting to stay updated on specific technologies (e.g., "AI", "Cybersecurity"). Content Creators** looking for curated news topics. Busy Professionals** who need a high-signal, low-noise news digest. What it does Fetches News: Pulls daily articles via NewsAPI based on your chosen keyword (default: "technology"). AI Filtering: Uses an AI Agent (via OpenRouter) to filter out low-quality or irrelevant clickbait. Daily Digest (Slack): Summarizes the top 3 articles in English. Translates the summaries to Japanese using DeepL (optional). Posts both versions to a Slack channel. Data Archiving (Sheets): Extracts structured data (Title, Author, Summary, URL) and saves it to Google Sheets. Weekly Trend Report: Every Monday, it reads the past week's data from Google Sheets and uses AI to generate a high-level trend report and strategic insights. How to set up Configure Credentials: You will need API keys/auth for NewsAPI, OpenRouter (or OpenAI), DeepL, Google Sheets, and Slack. Setup Google Sheet: Create a sheet with the following headers in the first row: title, author, summary, url. Map the Sheet: In the "Append row in sheet" and "Read sheet (weekly)" nodes, select your file and map the columns. Define Keyword: Open the "Set Keyword" node and change chatInput to the topic you want to track (e.g., "Crypto", "SaaS", "Climate Change"). Slack Setup: Select your desired channel in the Slack nodes. Requirements n8n** (Self-hosted or Cloud) NewsAPI** Key (Free tier available) OpenRouter** (or any LangChain compatible Chat Model like OpenAI) DeepL** API Key (for translation) Google Sheets** account Slack** Workspace How to customize Change the Language:** Remove the DeepL node if you only want English, or change the target language code. Adjust the Prompt:** Modify the "AI Agent (Filter)" system message to change how strict the news filtering is. Change Schedule:** Adjust the Cron nodes to run at your preferred time (currently set to Daily 8 AM and Weekly Monday 9 AM).
by 寳田 武
This workflow automates the entire process of running a Print-on-Demand (POD) business by combining market trend analysis with autonomous AI design and quality control. It acts as a virtual product team that researches, designs, vets, and publishes new products to your store every week. Who is it for? This template is ideal for e-commerce entrepreneurs, content creators, and print-on-demand store owners who want to scale their merchandise inventory without spending hours on design and market research. What it does Market Research: Fetches real-time search data from Google Trends and customer preference data from Typeform. AI Design: Uses OpenAI (GPT-4o) to brainstorm t-shirt concepts based on the gathered trends, then generates high-quality vector-style images using Replicate (Flux/Stable Diffusion). Quality Control: A "Vision AI" agent analyzes the generated image, rates it on a scale of 1-10, and filters out any design scoring below 7. Dynamic Pricing & Publishing: Automatically calculates a premium price for higher-rated designs and publishes the product directly to your Printify store. Logging: Saves the product details to Airtable for your records. How to set up Configure Credentials: Open the "Workflow Configuration" node. Replace the placeholder values with your API keys for OpenAI, Replicate, Printify, and Typeform. Set Printify Details: In the "Workflow Configuration" node, add your Shop ID. In the "Publish to Printify" node, update the blueprint_id (the specific t-shirt model, e.g., Bella+Canvas 3001) and print_provider_id. Airtable Setup: Create a table with columns for Title, Description, Price, Quality Score, and Image URL, then map the IDs in the Airtable node. Requirements n8n: Cloud or Self-hosted instance. API Keys: OpenAI (with GPT-4o access), Replicate, Printify, Typeform, and Airtable. Printify Account: A connected store (e.g., Shopify, Etsy, or Pop-up). How to customize Prompt Engineering: Modify the "Chief Designer AI" system prompt to change the artistic style (e.g., from "vector" to "pixel art" or "vintage"). Pricing Logic: Adjust the JavaScript in the "Dynamic Pricing Calculator" to change your base margins or markup rules. Schedule: Change the "Weekly Schedule Trigger" to run daily or monthly depending on your volume needs.
by Rahul Joshi
Description Automatically generate multi-jurisdiction tax summaries from Stripe invoices and sync them into Google Sheets with daily reporting. This workflow ensures compliance-ready tax data, detailed breakdowns by country/state/tax rate, and real-time Slack notifications for both success and error handling. 💳📈📢 What This Template Does Triggers daily at 2:00 AM using a scheduled cron. ⏰ Fetches paid invoices from Stripe (last 30 days). 💳 Validates data integrity before processing. ✅ Summarizes taxes by period, country, state, and rate. 🧮 Formats and logs results in Google Sheets for reporting. 📊 Sends Slack notifications for both success and failure. 📢 Key Benefits Automated tax compliance reporting. 🧾 Accurate multi-jurisdiction tracking. 🌍 Eliminates manual spreadsheet work. ⏱️ Maintains a historical audit trail. 📋 Real-time notifications keep your team informed. 🔔 Built-in error handling ensures reliability. 🛡️ Features Daily cron schedule (0 2 * * *). Stripe invoices fetched with expanded tax amounts. Intelligent grouping by period, country, state, and tax rate. Google Sheets integration with append/update logic. Success Slack message: summary totals, record count, period. Error Slack message: troubleshooting guidance and failure logs. Uses environment variables for secure configuration (GOOGLE_SHEETS_DOCUMENT_ID, SLACK_CHANNEL_ID). Requirements n8n instance (cloud or self-hosted). Stripe API credentials with invoice read access. Google Sheets OAuth2 credentials with write access. Slack API credentials with chat:write permissions. Proper tax configuration in Stripe for accurate reporting. Target Audience Finance teams handling recurring billing and tax filings. 💼 Accountants needing automated jurisdiction tax breakdowns. 📊 SaaS businesses managing global customers. 🌐 Agencies and SMEs streamlining monthly tax reporting. 🏢 Remote teams requiring real-time workflow notifications. 📲 Step-by-Step Setup Instructions Configure Stripe API credentials in n8n. Set up Google Sheets with a “Tax Summary” sheet (columns: period, country, state, tax rate, taxable amount, tax collected, processing date). Configure Slack API credentials and channel ID (e.g., tax-reports). Replace hardcoded values with environment variables for security. Import this workflow JSON into n8n. Run once manually with test invoices to validate. Enable the workflow for daily automated reporting. ✅
by Cheng Siong Chin
How It Works The workflow starts with a scheduled trigger that activates at set intervals. Behavioral data from multiple sources is parsed and sent to the MCDN routing engine, which intelligently assigns leads to the right teams based on predefined rules. AI-powered scoring evaluates each prospect’s potential, ensuring high-quality leads are prioritized. The results are synced to the CRM, and updates are reflected on an analytics dashboard for real-time visibility. Setup Steps Trigger: Define schedule frequency. Data Fetch: Configure APIs for all behavioral data sources. MCDN Router: Set routing rules, thresholds, and team assignments. AI Models: Connect OpenAI/NVIDIA APIs and configure scoring prompts. CRM Integration: Enter credentials for Salesforce, HubSpot, or other CRMs. Dashboard: Link to analytics tools like Tableau or Google Sheets for reporting. Prerequisites API credentials: NVIDIA AI, OpenAI, CRM platform; data sources; spreadsheet/analytics access Use Cases Lead prioritization for sales teams; customer segmentation; automated routing; Customization Adjust routing rules, add custom scoring models, modify team assignments, expand data sources, integrate additional AI providers Benefits Reduces manual lead routing 90%; improves scoring accuracy; accelerates sales cycle; enables data-driven team assignments;
by Olivier
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. This template generates structured synthetic company content using live web data from the Bedrijfsdata.nl API combined with an LLM. Provide a company domain (directly or via a Bedrijfsdata.nl ID) and the workflow retrieves relevant website and search engine content, then produces ready-to-use descriptions of the company, its offerings, and its target audience. ✨ Features Create high-quality Dutch-language company descriptions on demand Automatically pull live web content via Bedrijfsdata.nl RAG Domain & RAG Search Structured JSON output for consistent downstream use (e.g., CRM updates, lead qualification) Flexible trigger: run from ProspectPro ID, domain input, or another workflow Secure, modular, and extendable structure (error handling included) 🏢 Example Output The workflow produces structured content fields you can directly use in your sales, marketing, or enrichment flows: company_description** – 1-2 paragraph summary of the company products_and_services** – detailed overview of offerings target_audience** – specific characteristics of ideal customers (e.g., industry, location, company size, software usage) Example: { "company_description": "Bedrijfsdata.nl B.V. is een Nederlands bedrijf dat uitgebreide data levert over meer dan 3,7 miljoen bedrijven in Nederland...", "products_and_services": "Het bedrijf biedt API-toegang tot bedrijfsprofielen, sectoranalyses, en SEO-gegevens...", "target_audience": "Nederlandse MKB's die behoefte hebben aan actuele bedrijfsinformatie voor marketing- of salesdoeleinden..." } ⚙ Requirements n8n instance or cloud workspace Install the Bedrijfsdata.nl n8n Verified Community Node OpenAI API credentials (tested with gpt-4.1-mini and gpt-3.5-turbo) Bedrijfsdata.nl developer account (14-day free trial, 500 credits) 🔧 Setup Instructions 1. Trigger configuration Use Bedrijfsdata.nl ID (default) or provide a domain directly Can be called from another workflow using “Execute Workflow” 2. Configure API credentials Bedrijfsdata.nl API key OpenAI API key 3. Customize Output (Optional) Adjust prompt in the LLM node to create other types of synthetic content Extend structured output schema for your use case 4. Integrate with Your Stack Example node included to update HubSpot descriptions Replace or extend to match your CRM, database, or messaging tools 🔐 Security Notes Input validation for required domain Dedicated error branches for invalid input, API errors, LLM errors, and downstream integration errors RAG content checks before running the LLM 🧪 Testing Run workflow with a Bedrijfsdata.nl ID linked to a company with a known website Review generated JSON output Verify content accuracy before production use 📌 About Bedrijfsdata.nl Bedrijfsdata.nl operates the most comprehensive company database in the Netherlands. With real-time data on 3.7M+ businesses and AI-ready APIs, we help Dutch SMEs enrich their CRM, workflows, and marketing automation. Built on 25+ years of experience in data collection and enrichment, our technology brings corporate-grade data quality to every organisation. Website: https://www.bedrijfsdata.nl Developers: https://developers.bedrijfsdata.nl API docs: https://docs.bedrijfsdata.nl 📞 Support Email: klantenservice@bedrijfsdata.nl Phone: +31 20 789 50 50 Support hours: Monday–Friday, 09:00–17:00 CET
by Abdul Matheen
Automated Invoice-Processing AI Agent for n8n Overview The Automated Invoice-Processing AI Agent in n8n is designed to streamline and optimize invoice management for finance teams and accounts payable (AP) professionals. This solution addresses the common challenge of verifying invoice data manually, cross-checking it against purchase orders (POs), and ensuring compliance before releasing payments. By intelligently fetching invoices from Google Drive, extracting key details, validating them against PO records from Google Sheets, and automating the next actions, this system reduces human intervention, minimizes errors, and accelerates the payment process. Target Audience This automation primarily serves finance and AP teams responsible for managing large volumes of vendor invoices. It also supports finance managers, procurement departments, and auditors who require accuracy in payment reconciliation, ensuring that invoices align with approved POs before processing. Business Problem Addressed Organizations frequently struggle with time-consuming manual invoice verification and data entry. Discrepancies between invoices and purchase orders can lead to payment delays, compliance risks, or duplicate payments. This n8n-based AI agent automates that process—ensuring that every invoice is validated, exceptions are flagged to the finance team promptly, and payments of smaller value (under defined thresholds) are processed automatically. Prerequisites Active n8n account or self-hosted instance Google Drive and Google Sheets connected via n8n credentials LLM (AI node) configured for document extraction (optional but recommended) A Google Sheet set up with existing PO data (including PO Number, Amount, and Date fields) Setup Instructions Connect Google Drive and Google Sheets integrations within n8n. Configure the workflow trigger to monitor a designated "Invoices" folder. Add a document-parsing node to extract invoice details such as PO Number, Invoice Date, and Amount. Implement conditional logic: If the invoice amount > 5000, the agent cross-references PO details from the Google Sheet. If it matches, it updates the PO sheet status to “Process Payment.” If not, an automated email notifies the finance team. If the amount ≤ 5000, the workflow marks it for direct payment. Test the workflow with sample invoices before full deployment. Customization Options Adjust the payment threshold value (e.g., 10,000 instead of 5,000). Customize the email notification template and recipient list. Integrate with accounting systems such as QuickBooks or SAP for end-to-end automation. Add audit logging nodes to create traceability for every action taken. This AI-driven automation brings speed, accuracy, and scalability to invoice verification—empowering finance professionals to focus on analytical and strategic tasks rather than repetitive manual work.
by n8n Team
This workflow turns a light red when an update is made to a GitHub repository. By default, updates include pull requests, issues, pushes just to name a few. Prerequisites GitHub credentials. Home Assistant credentials. How it works Triggers off on the On any update in repository node. Uses Home Assistant to turn on a light and then configure the light to turn red.
by Rahi
🛠️ Workflow: Jotform → HubSpot Company + Task Automation Automatically create or update HubSpot companies and generate follow-up tasks whenever a Jotform is submitted. All logs are stored to Google Sheets for traceability, transparency, and debugging. ✅ Use Cases Capture marketing queries from your website’s Jotform form and immediately create tasks for your sales or SDR team. Enrich HubSpot companies with submitted domains, company names, and contact data. Automatically assign tasks to owners and keep all form submissions logged and auditable. Avoid manual handoffs — full automation from form submission → CRM. 🔍 How It Works (Step-by-Step) 1. Jotform Trigger The workflow starts when a new submission is received via the Jotform webhook. Captured fields include: name, email, LinkedIn profile, company name, marketing budget, domain, and any specific query. 2. Create or Update Company in HubSpot + Format Data The “Create Company” node ensures the submitted company is either created in HubSpot or updated if it already exists. A Formatter (Function) node standardizes the data — names, email, LinkedIn URL, domain, marketing budget, and query text. It composes a task title, generates a follow-up timestamp, and dynamically assigns an owner. 3. Loop & HTTP Request – Create HubSpot Task The workflow loops through each formatted item. A Wait node prevents rate limit issues. It then sends an HTTP POST request to HubSpot’s Tasks API, creating a task with: Subject and body including the submission details Task status, priority, and type Assigned owner and associated company 4. Loop & HTTP Request – Set Company Domain After tasks are created, another loop updates each HubSpot company record with the submitted domain. This ensures all HubSpot companies have proper website data for future enrichment. 5. Storing Logs (Google Sheets) All processed submissions, responses, errors, and metadata are appended or updated in a Google Sheets document. This provides a complete audit trail — ideal for debugging, reporting, and performance monitoring. 🧩 Node Structure Overview | Step | Node | Description | |------|------|--------------| | 1️⃣ | Jotform Trigger | Receives form submission data | | 2️⃣ | HubSpot Create Company | Ensures company record exists | | 3️⃣ | Formatter / Function Node | Cleans & structures data, assigns owner, generates task fields | | 4️⃣ | Wait / Delay Node | Controls API call frequency | | 5️⃣ | HTTP Request (Create Task) | Pushes task to HubSpot | | 6️⃣ | HTTP Request (Update Domain) | Updates company domain in HubSpot | | 7️⃣ | Google Sheets Node | Logs inputs, outputs, and status | 📋 Requirements & Setup 🔑 HubSpot Private App Token with permissions to create companies, tasks, and update records 🌐 Jotform Webhook URL pointing to this workflow 📗 Google Sheets Credentials (OAuth or service account) with write access ✅ HubSpot app must have crm.objects.companies.write and crm.objects.tasks.write scopes ⚠️ Add retry or error-handling branches for failed API calls ⚙️ Customization Tips & Variations Add contact association:** Modify the payload to also link the task with a HubSpot Contact (via email) so it appears in both company and contact timelines. Use fallback values:** In the Formatter node, provide defaults like “Unknown Company” or “No query provided.” Dynamic owner assignment:** Replace hash-based assignment with round-robin or territory logic. Conditional task creation:** Add logic to only create tasks when certain conditions are met (e.g., budget > 0). Error branches:** Capture failed HTTP responses and send Slack/Email alerts. Extended logs:** Add response codes, errors, and retry counts to your Google Sheet for more transparency. 🎯 Benefits & Why You’d Use This ⚡ Speed & Automation — eliminate manual data entry into HubSpot 📊 Data Consistency — submissions are clean, enriched, and traceable 👀 Transparency — every action logged for full visibility 🌍 Scalability — handle hundreds of submissions effortlessly 🔄 Flexibility — adaptable for other use cases (support tickets, surveys, partnerships, etc.) ✨ Example Use Case A marketing form on your website captures partnership or franchise inquiries. This workflow instantly creates a HubSpot company, logs the inquiry as a task, assigns it to a regional manager, and saves a record in Google Sheets — all within seconds. Tags: HubSpot Jotform CRM GoogleSheets Automation LeadManagement
by Rahi
Workflow: Track Email Campaign Engagement Analytics with Smartlead and Google Sheets Automatically fetch lead-level email engagement analytics (opens, clicks, replies, unsubscribes, bounces) from Smartlead and update them in Google Sheets. Use this to keep a single, always-fresh source of truth for campaign performance and sequence effectiveness. Summary Pull Smartlead campaign analytics on a schedule and write them to a Google Sheet (append or update). Works with pagination, avoids duplicates via a stable key, and is ready for dashboards, pivots, or BI tools. What This Workflow Does Collects campaign stats from Smartlead (per-lead, per-sequence). Handles pagination safely (offset/limit). Writes to Google Sheets using appendOrUpdate with a matching column to prevent duplicates. Can run on a schedule for near real-time analytics. Node Structure Overview | Step | Node | Purpose | |---|---|---| | 1️⃣ | Schedule Trigger | Starts the workflow on a cadence (e.g., hourly) | | 2️⃣ | Code (Pagination Generator) | Emits {offset, limit} pairs (e.g., 0..9900, step 100) | | 3️⃣ | Split in Batches | Sends each pagination pair to the API sequentially | | 4️⃣ | HTTP Request (Smartlead) | GET /campaigns/{campaign_id}/statistics with offset/limit | | 5️⃣ | Split Out | Turns the API data[] array into one item per lead record | | 6️⃣ | Google Sheets (appendOrUpdate) | Upserts rows by stats_id into EngagedLeads tab | | 7️⃣ | Loop Back | Continues until all batches have been processed | Step-by-Step Setup Prerequisites Smartlead account + API key with access to campaign statistics. Google account + Google Sheets OAuth connected in n8n. Create the Google Sheet Spreadsheet name: Email Analytics (can be anything). Tab name: EngagedLeads. Add these exact headers (first row): lead_name, lead_email, lead_category, sequence_number, stats_id, email_subject, sent_time, open_time, click_time, reply_time, open_count, click_count, is_unsubscribed, is_bounced Configure the Schedule Trigger Choose a frequency (e.g., every 2 hours). If you’re testing, set a single run or a short cadence. Configure the Code Node (Pagination) Emit N items like: { "offset": 0, "limit": 100 } { "offset": 100, "limit": 100 } ... 100 is a good default limit. For up to 10,000 records, generate 100 offsets. Configure the Smartlead API Node Method: GET URL: https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/statistics Query parameters: api_key = <YOUR_SMARTLEAD_API_KEY> offset = {{ $json.offset }} limit = {{ $json.limit }} Map response to JSON. Split Out the Response Use a Split Out (or similar) to iterate over data[] so each lead record is one item. Google Sheets Node (Append or Update) Operation: appendOrUpdate. Document: Your Email Analytics sheet. Sheet/Tab: EngagedLeads. Matching Column: stats_id. Map fields from Smartlead response to sheet columns: lead_name ← lead name (or composed from first/last if provided) lead_email ← email lead_category ← category/type if available sequence_number ← sequence step number stats_id ← stable identifier (e.g., Smartlead stats_id or message id) email_subject ← subject sent_time, open_time, click_time, reply_time ← timestamps open_count, click_count ← integers is_unsubscribed, is_bounced ← booleans If the same stats_id arrives again, the row is updated, not appended. Test and Activate Run once manually to verify API and sheet mapping. Check the sheet for new/updated rows. Activate the workflow to run automatically. Smartlead API Reference (Used by This Workflow) Endpoint** GET https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/statistics Required query parameters** api_key (string) offset (number) limit (number) Typical response (trimmed example)** { "data": [ { "lead_name": "Jane Doe", "lead_email": "jane@example.com", "sequence_number": 2, "stats_id": "15b6ff3a-...-b2b9f343c2e1", "email_subject": "Quick intro", "sent_time": "2025-10-08T10:18:55.496Z", "open_time": "2025-10-08T10:20:10.000Z", "click_time": null, "reply_time": null, "open_count": 1, "click_count": 0, "is_unsubscribed": false, "is_bounced": false } ], "total": 1234 } Google Sheets Structure (Recommended) Spreadsheet: Email Analytics Tab: EngagedLeads Columns:lead_name, lead_email, lead_category, sequence_number, stats_id, email_subject, sent_time, open_time, click_time, reply_time, open_count, click_count, is_unsubscribed, is_bounced Matching Column: stats_id (prevents duplicates and allows updates) Customization Tips Multiple Campaigns** Duplicate the workflow and set a different {campaign_id} and/or write results to a separate tab in your Google Sheet. Batch Size** Increase or decrease the limit value (e.g., 200) in your Code node if you want fewer or more API calls. Filtering** Add a Code or IF node to skip rows where is_bounced = true or is_unsubscribed = true. Dashboards** Create a new tab named Dashboard in Google Sheets and visualize your data using built-in charts or connect it to Looker Studio for advanced visualization. Enrichment** Join this dataset with your CRM data (e.g., HubSpot or Salesforce) using lead_email as a key to gain deeper customer insights. Security and Publishing Notes Do not hardcode** your Smartlead API key in the workflow export. Use n8n credentials or environment variables instead. When sharing the template publicly, replace sensitive values with placeholders like: <YOUR_SMARTLEAD_API_KEY> and <YOUR_GOOGLE_SHEET_ID>. Keep your Google Sheet private unless you intentionally want to share it publicly. Troubleshooting No rows in Sheets** Verify that the API response includes data[], confirm that the Split Out node is configured correctly, and check field mappings. Duplicates** Ensure the Google Sheets node has its matching column set to stats_id. Rate Limits** Increase the schedule interval, add a short Wait node between batches, or reduce the limit size. Mapping Errors** Ensure that column names in Sheets exactly match your field mappings — they are case-sensitive. Timezone Differences** Smartlead timestamps are in UTC. Convert them downstream if your local timezone is different. Example Use Case Run this workflow hourly to maintain a live, company-wide Email Engagement Sheet. Sales teams** can monitor replies and active leads. Marketing teams** can track open and click rates by sequence. Operations** can export monthly summaries — no Smartlead login required. Tags Smartlead EmailMarketing Automation GoogleSheets Analytics CRM MarketingOps