n8n + n8n: Data Analytics AI Agent: Automatic Business Insights from GA4, HubSpot, and Sheets
Your GA4 dashboard shows a traffic drop. Your HubSpot pipeline has three deals stuck for two weeks. Your revenue spreadsheet was last updated by someone who left the company. You find out about all of
Your GA4 dashboard shows a traffic drop. Your HubSpot pipeline has three deals stuck for two weeks. Your revenue spreadsheet was last updated by someone who left the company. You find out about all of this on Friday afternoon, manually, because someone asked a question in a meeting. That's not analytics — that's firefighting with a delay. The Data Analytics AI Agent n8n workflow eliminates that lag entirely: every Sunday it collects data from GA4, HubSpot, and Google Sheets, identifies what actually changed, and delivers a formatted executive report to your inbox and Slack before the week starts.
The Real Cost of Manual Reporting
Most early-stage and mid-size companies are running on fragmented data. GA4 lives in one tab, HubSpot in another, and the "source of truth" spreadsheet exists in three different versions across three different people's Google Drives. The result: no one has a clear, current picture of the business on Monday morning.
The problem isn't access to data — it's the cost of aggregating it. Someone has to open each tool, pull the numbers, paste them somewhere, format them, notice the anomalies, write the summary, and send it. That process takes 30–90 minutes per week if you do it right. Most teams don't do it right. They do it inconsistently, or skip it entirely when things get busy — exactly when you need visibility the most.
Automated reporting isn't just about saving time. It's about consistency. A report that runs every Sunday at 8 AM regardless of who's sick, traveling, or underwater with other work is categorically more reliable than one that depends on a human remembering to do it. Consistency is what turns a report into a decision-making habit.
What This n8n Workflow Actually Does
The Data Analytics AI Agent workflow runs on a weekly schedule and executes a full data pipeline in sequence: pull → analyze → report. Here's the architecture at a practical level:
Data collection layer: The workflow hits three sources in parallel. The Google Analytics node pulls sessions, conversions, traffic sources, and goal completions for the past 7 days. The HubSpot node retrieves deal pipeline data — new deals, stage changes, closed won/lost, and any contacts created in the period. The Google Sheets node reads your configured spreadsheet (revenue tracker, KPI board, ops metrics — whatever you've defined as your source of truth).
AI analysis layer: Raw numbers mean nothing without context. An OpenAI node (or Claude, depending on your configuration) receives the aggregated data and is prompted to identify significant changes — not just report the numbers. It flags week-over-week anomalies, surfaces deals that have been sitting in the same stage too long, and highlights any metric that deviated more than a configured threshold from the previous period.
Delivery layer: The formatted report goes out via Gmail (or SMTP if you prefer) and a Slack node simultaneously. The Slack message is a concise summary with key highlights. The email contains the full structured report with sections by data source.
Step-by-Step Setup in n8n
Step 1 — Import the workflow. Download the JSON file from Gumroad and import it via Workflows → Import from File in your n8n instance. All nodes will load with their connections intact.
Step 2 — Configure the Schedule Trigger node. Open the Schedule Trigger node. Set it to run weekly on Sunday at your preferred time (08:00 local time is recommended — report lands before the team starts Monday planning). The cron expression for Sunday 8 AM is 0 8 * * 0.
Step 3 — Connect Google Analytics. The Google Analytics node requires OAuth2 credentials. In n8n, go to Credentials → New → Google Analytics OAuth2 API. You'll need your GA4 Property ID (format: properties/XXXXXXXXX — find it in GA4 under Admin → Property Settings). In the node configuration, set the date range to 7daysAgo to today and configure the metrics relevant to your business: sessions, conversions, engagementRate, newUsers.
Step 4 — Connect HubSpot. Create a HubSpot Private App token in your HubSpot account under Settings → Integrations → Private Apps. Grant it read access to CRM objects (Deals, Contacts, Companies). Add this as a Header Auth credential in n8n with the key authorization and value Bearer YOUR_TOKEN. The workflow uses the HubSpot Deals API to pull deals modified in the last 7 days, filtering by hs_lastmodifieddate.
Step 5 — Connect Google Sheets. The Google Sheets node uses Service Account credentials for reliability (avoids token expiration issues with OAuth2). Create a service account in Google Cloud Console, download the JSON key, and share your target spreadsheet with the service account email. In the node, specify your Spreadsheet ID and the sheet/range to read. This is typically your weekly KPI tracker or revenue dashboard.
Step 6 — Configure the AI node. Open the OpenAI node (or the Claude node if you've swapped it). The system prompt is pre-configured to act as a business analyst — it receives the three data payloads and returns a structured analysis. You can customize the prompt to change the tone, add company-specific context (e.g., "our target CAC is $150, flag if above"), or adjust what counts as a significant change. The default threshold for flagging anomalies is a 20% week-over-week change on any tracked metric.
Step 7 — Set up delivery. Configure the Gmail node with your OAuth2 credentials and set the recipient list. For the Slack node, create an incoming webhook in your Slack workspace (Apps → Incoming Webhooks) and paste the URL into the node. Set the target channel to whatever your team uses for ops or metrics updates.
Step 8 — Test with a manual run. Before scheduling, run the workflow manually using the Execute Workflow button. Verify that each data source returns data, the AI node produces a coherent analysis, and both delivery nodes show success. Check your email and Slack to confirm formatting looks correct.
What You Get Every Monday Morning
The output isn't a wall of numbers. The AI layer transforms raw data into a brief that a non-technical executive can act on in under two minutes. A typical report includes:
Traffic summary: Total sessions vs. prior week, top channels with percentage breakdowns, any channel showing unusual movement (e.g., "Organic search down 34% — likely related to the page title changes deployed Tuesday").
Pipeline health: New deals created, deals closed (won and lost), total pipeline value change, and a list of deals flagged for inactivity — specifically those that haven't moved stages in more than 14 days. This last item alone has saved teams from losing deals that fell through the cracks.
KPI snapshot: Whatever metrics live in your Google Sheet — MRR, churn, support ticket volume, NPS — pulled and compared to last week's values. Anything outside the normal range gets flagged explicitly.
Recommended actions: The AI node doesn't just describe — it suggests. If HubSpot shows three deals stuck in "Proposal Sent" for three weeks, the report says so and suggests a follow-up action. If GA4 shows a conversion rate drop with stable traffic, it suggests checking the checkout funnel. These aren't guaranteed to be right, but they're a starting point that saves 15 minutes of analysis on Monday morning.
Common Pitfalls and How to Avoid Them
GA4 permissions errors. The most common setup failure is insufficient OAuth scope. When creating your Google Analytics credentials in n8n, make sure you're granting the https://www.googleapis.com/auth/analytics.readonly scope. If you see a 403 Insufficient Permission error, this is the cause. Re-authenticate with the correct scope.
HubSpot rate limiting. HubSpot's API has rate limits (100 requests per 10 seconds for private apps). The workflow is designed to stay well under this, but if you've customized it to pull additional objects (tasks, calls, emails), you may hit limits. Add a Wait node between HubSpot calls if you're pulling more than three object types.
Google Sheets credential drift. OAuth2 tokens for Google Sheets expire and need re-authorization every few months. Service Account credentials don't expire — this is why the workflow uses them for Sheets. If you insist on OAuth2, set a calendar reminder to re-authorize every 60 days, or the workflow will fail silently on a Sunday when you're not watching.
AI hallucinations in the analysis. The AI node can occasionally invent trends that aren't in the data, especially when data is sparse (e.g., first two weeks of operation when there's no prior week to compare). Add a validation step: the IF node checks that the AI output contains specific section headers before sending. If the output format is wrong, route to an error notification instead of delivering a malformed report.
Slack message length. Slack has a 4,000-character limit for messages. If your report is detailed, the Slack node will fail silently or truncate. The workflow handles this by sending only the executive summary to Slack and the full report to email. Don't modify this unless you've verified your typical output length stays under the limit.
Time zone mismatches. n8n's schedule trigger uses the server's time zone by default. If your n8n instance is on UTC and your team is in Eastern time, a Sunday 8 AM schedule runs at 3 AM local time and the report sits in inboxes unread until Monday morning anyway. Configure the Schedule Trigger's time zone explicitly to match your team's location.
Who This Workflow Is Built For
This template is built for technical founders, ops leads, and growth teams who are tired of assembling reports manually or paying for a BI tool they only use for one dashboard. If you're already running n8n — either self-hosted or on n8n.cloud — this workflow adds zero infrastructure cost. You pay for API calls to your AI provider (typically under $0.10 per report with GPT-4o-mini) and nothing else.
The setup takes under an hour for someone comfortable with API credentials. The return is a consistent, intelligent weekly briefing that keeps the whole team aligned on what's actually happening in the business — without anyone having to build it, maintain it, or remember to run it.
Ja construimos isso pra voce
Nao comece do zero. O Data Analytics AI Agent: Automatic Business Insights from GA4, HubSpot, and Sheets e um workflow n8n pronto para instalar — conecta suas ferramentas em minutos, sem codigo.
Instalar por $39 →