Skip to main content

Answer BigQuery questions in Microsoft Teams with Claude 3.5 dual agents

Workflow preview

Workflow preview
100%
Answer BigQuery questions in Microsoft Teams with Claude 3.5 dual agents preview
Open on n8n.io

1. Workflow Overview

Quick overview Turn Microsoft Teams into a natural language BI tool. This dual agent Claude workflow intelligently classifies user questions, generates safe BigQuery SQL, executes the query, and re...

Best for

  • Market Research automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.microsoftteamstrigger, n8n-nodes-base.code, n8n-nodes-base.if, n8n-nodes-base.googlebigquery, @n8n/n8n-nodes-langchain.anthropic, n8n-nodes-base.microsoftteams, n8n-nodes-base.errortrigger

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
Answer BigQuery questions in Microsoft Teams with Claude 3.5 dual agents
Workflow name
Answer BigQuery questions in Microsoft Teams with Claude 3.5 dual agents

Quick overview

Turn Microsoft Teams into a natural language BI tool. This dual-agent Claude workflow intelligently classifies user questions, generates safe BigQuery SQL, executes the query, and returns a plain-English summary alongside a data preview directly to your Teams channel.

How it works

  1. The workflow listens for new messages in a designated Microsoft Teams channel or chat.
  2. It checks a 24-hour static data cache for your BigQuery schema. If the cache is missing or expired, it automatically fetches the latest INFORMATION_SCHEMA metadata.
  3. A main Claude 3.5 Sonnet agent classifies the user's intent (analytical, conversational, or unsafe) and identifies the relevant database tables.
  4. If the intent is analytical, a specialized Claude SQL sub-agent generates a read-only SELECT query tailored exactly to your schema.
  5. The workflow executes the query against BigQuery (safely constrained to a maximum of 100 rows).
  6. A final Claude agent translates the raw query results into a concise, plain-English summary.
  7. The answer is posted back to Teams as an Adaptive Card, complete with a formatted data preview and the generated SQL code.
  8. Non-analytical questions or pipeline errors are intelligently routed to receive standard conversational replies in Teams.

Setup

  1. CRITICAL SECURITY: Restrict your Google Cloud Service Account IAM roles to BigQuery Data Viewer and BigQuery Job User ONLY. Do not use a highly privileged account.
  2. Configure your Microsoft Teams trigger and posting credentials, specifying the target team and channel for the bot to operate in.
  3. Configure your Google BigQuery credentials to allow reading metadata and executing queries.
  4. Configure your Anthropic credentials for the three Claude LangChain nodes.
  5. Update the "Configure Variables" node with your specific GCP Project ID and BigQuery Dataset ID.

Requirements

  • A Google Cloud project with BigQuery enabled and existing structured datasets.
  • An Anthropic API key with access to the Claude 3.5 Sonnet model.
  • Microsoft Teams administrator access to authorize the n8n integration.

Customization

  • Distributed Environments: If you are running n8n with multiple worker nodes (Queue Mode), you must swap the $getWorkflowStaticData() schema cache logic to read/write from a dedicated Key-Value store (like Redis or Supabase) to ensure state synchronization.
  • UI Layout: Modify the Create Teams Adaptive Card node to add corporate branding, custom colors, or alter the FactSet data preview structure.

Additional info

This architecture features built-in pipeline protections, including strict 40,000-character payload limits to prevent LLM context window blowouts, and fallback handling for "zero-row" query results to ensure users are never left without a response.

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 Note13

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

Block 3 - Sticky Note1

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

Block 4 - Sticky Note2

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

Block 5 - Sticky Note3

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

Block 6 - Sticky Note4

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

Block 7 - Sticky Note5

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

Block 8 - Sticky Note6

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

Block 9 - Sticky Note7

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

Block 10 - Sticky Note8

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

Block 11 - Sticky Note9

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

Block 12 - Sticky Note10

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

Block 13 - Sticky Note11

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

Block 14 - Sticky Note12

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

Block 15 - When Teams Message Received

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

Block 16 - Validate Teams Message

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

Block 17 - Configure Variables

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

Block 18 - Check Schema Cache Validity

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

Block 19 - If Cache Hit

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

Block 20 - Create Schema Query Statement

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

Block 21 - Fetch Schema from BigQuery

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

Block 22 - Compile Schema Data for LLM

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

Block 23 - Ensure Schema Availability

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

Block 24 - Build Main Agent Query Prompt

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

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

3. Summary Table

Workflow Answer BigQuery questions in Microsoft Teams with Claude 3.5 dual agents
Complexity advanced
Nodes 41
Categories Market Research, AI RAG
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/16537/16537.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 Answer BigQuery questions in Microsoft Teams with Claude 3.5 dual agents do?

Quick overview Turn Microsoft Teams into a natural language BI tool. This dual agent Claude workflow intelligently classifies user questions, generates safe BigQuery SQL, executes the query, and re...

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 Market Research, AI RAG use case.