Skip to main content

Generate monthly BigQuery KPI PDF reports with Claude, Google Docs, Outlook and Teams

Workflow preview

Workflow preview
100%
Generate monthly BigQuery KPI PDF reports with Claude, Google Docs, Outlook and Teams preview
Open on n8n.io

1. Workflow Overview

Quick overview This workflow runs monthly to query KPI data from Google BigQuery, generates a narrative with Anthropic Claude, fills a Google Docs report template, exports it as a PDF, archives it ...

Best for

  • Document Extraction automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.scheduletrigger, n8n-nodes-base.code, n8n-nodes-base.googlebigquery, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatanthropic, n8n-nodes-base.googledrive

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mychel Garzon.

Original n8n.io source

1.1 Workflow description

Title
Generate monthly BigQuery KPI PDF reports with Claude, Google Docs, Outlook and Teams
Workflow name
Generate monthly BigQuery KPI PDF reports with Claude, Google Docs, Outlook and Teams

Quick overview

This workflow runs monthly to query KPI data from Google BigQuery, generates a narrative with Anthropic Claude, fills a Google Docs report template, exports it as a PDF, archives it to OneDrive, emails it via Microsoft Outlook, and posts a summary to Microsoft Teams.

How it works

  1. A schedule trigger fires on the 1st of every month at 07:00 and calculates the start and end dates of the previous full calendar month.
  2. Four parallel BigQuery queries fetch revenue KPIs, top product categories, weekly sales trend, and top customers for that period. Each result set is tagged with a source label before merging.
  3. All tagged rows are combined and aggregated into a single structured report payload containing KPI summaries, ranked tables, and company metadata.
  4. The payload is split across two concurrent branches: one sends it to a Claude Sonnet LLM chain to generate an executive narrative with five sections (summary, revenue analysis, category insights, customer insights, and recommendation), and the other creates a named copy of a Google Docs template in your reports folder.
  5. Once both branches complete, the narrative is merged into the report payload and the replacement requests for all template placeholders are constructed.
  6. The Google Docs node applies all replacements in a single batchUpdate call, then the file is exported as a PDF via Google Drive.
  7. The finished PDF is archived to OneDrive, emailed via Outlook with the report attached, and a formatted KPI summary card is posted to a Microsoft Teams channel.

Setup

  1. Set the following n8n environment variables before activating: GCP_PROJECT_ID, BQ_DATASET, GDOCS_TEMPLATE_FILE_ID, GDRIVE_REPORTS_FOLDER_ID, ONEDRIVE_REPORTS_FOLDER_ID, REPORT_RECIPIENTS, TEAMS_TEAM_ID, and TEAMS_CHANNEL_ID.
  2. Connect a Google BigQuery credential and update the four SQL queries to match your dataset, table name, and column names.
  3. Connect an Anthropic API credential to the Claude Chat Model sub-node, then manually wire its output to the ai_languageModel input (bottom connector) of the Create AI Narrative with Claude node on the canvas.
  4. Connect Google Drive and Google Docs OAuth2 credentials. In Google Drive, create a master report template Doc containing the placeholder strings listed in the Customization section, note its file ID from the URL, and set GDOCS_TEMPLATE_FILE_ID accordingly.
  5. Connect Microsoft OneDrive, Outlook, and Teams OAuth2 credentials. Retrieve your Teams team ID and channel ID using the Microsoft Graph Explorer and set the corresponding environment variables.

Requirements

  • Google Cloud project with BigQuery enabled and an orders table matching the SQL schema in the workflow
  • Google Workspace account (Drive and Docs OAuth2 access)
  • Anthropic API key
  • Microsoft 365 account with OneDrive, Outlook, and Teams access

Customization

  • To change the reporting cadence, update the cron expression in the schedule trigger: 0 7 * * 1 for weekly or 0 7 * * * for daily.
  • To adapt the SQL queries to your schema, replace orders, order_total, customer_id, is_new_customer, created_at, and product_category with your actual column names.
  • To change the AI model, update the model field in the Claude Chat Model sub-node.
  • To add more KPI sections, extend the SQL queries, the aggregation code in Consolidate BigQuery Data, and the replacements array in Construct Replacement Requests.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note10

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note11

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - When First of Month at 07:00

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 14 - Calculate Previous Month

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - Fetch Revenue KPIs

Type / Role
n8n-nodes-base.googleBigQuery - googleBigQuery
Config choices
Version 2

Block 16 - Fetch Top Sales Categories

Type / Role
n8n-nodes-base.googleBigQuery - googleBigQuery
Config choices
Version 2

Block 17 - Fetch Weekly Sales Trend

Type / Role
n8n-nodes-base.googleBigQuery - googleBigQuery
Config choices
Version 2

Block 18 - Fetch Top Customers

Type / Role
n8n-nodes-base.googleBigQuery - googleBigQuery
Config choices
Version 2

Block 19 - Label Revenue Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 20 - Label Category Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Label Weekly Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 22 - Label Customer Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Merge BigQuery Results

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 24 - Consolidate BigQuery Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 36 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Generate monthly BigQuery KPI PDF reports with Claude, Google Docs, Outlook and Teams
Complexity advanced
Nodes 36
Categories Document Extraction, AI Summarization
Author Mychel Garzon
Published 21 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16538/16538.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Generate monthly BigQuery KPI PDF reports with Claude, Google Docs, Outlook and Teams do?

Quick overview This workflow runs monthly to query KPI data from Google BigQuery, generates a narrative with Anthropic Claude, fills a Google Docs report template, exports it as a PDF, archives it ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction, AI Summarization use case.