Skip to main content

Reconcile trade mismatches in Google Sheets with Groq/OpenAI and Gmail alerts

Workflow preview

Workflow preview
100%
Reconcile trade mismatches in Google Sheets with Groq/OpenAI and Gmail alerts preview
Open on n8n.io

1. Workflow Overview

Trade Break Reconciliation Assistant This workflow automates trade reconciliation between internal and external systems using Google Sheets. It detects mismatches (price, quantity, amount, etc.), u...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.lmchatgroq, n8n-nodes-base.manualtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.merge, n8n-nodes-base.code, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.if

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Reconcile trade mismatches in Google Sheets with Groq/OpenAI and Gmail alerts
Workflow name
Reconcile trade mismatches in Google Sheets with Groq/OpenAI and Gmail alerts

Trade Break Reconciliation Assistant

This workflow automates trade reconciliation between internal and external systems using Google Sheets. It detects mismatches (price, quantity, amount, etc.), uses AI to generate insights, updates records and sends email alerts. This eliminates manual effort and improves accuracy.

Quick Implementation Steps

  1. Connect your Google Sheets (Internal & External Trades)
  2. Ensure both sheets contain a common trade_id
  3. Connect Groq/OpenAI model in n8n
  4. Configure Gmail for alerts
  5. Run the workflow manually or schedule it
  6. Monitor updates and alerts in real-time

What It Does

This workflow automates the reconciliation of trade data between two systems — internal and external — stored in Google Sheets. It compares records using trade_id and identifies mismatches such as differences in price, quantity, amount, side, currency or status.

Once mismatches are detected, the workflow classifies their severity and uses AI to generate meaningful insights, including the likely reason, explanation and recommended action. This transforms raw data into actionable intelligence.

Additionally, it updates both sheets with reconciliation results, handles missing trades by inserting records and sends detailed email alerts to ensure quick resolution of issues.

Who It's For

  • Finance & Operations teams
  • Trade reconciliation analysts
  • Back-office teams in trading firms
  • FinTech automation engineers
  • Anyone managing dual-system trade data

Requirements

  • n8n account (self-hosted or cloud)
  • Google Sheets account (with Internal & External trade data)
  • Groq/OpenAI API credentials
  • Gmail account (for alerts)
  • Proper sheet structure with fields like:
  • trade_id
  • price, quantity, amount
  • currency, status

How It Works & Setup Guide

1. Trigger

  • Workflow starts using Manual Trigger

2. Fetch Data

  • Fetch Internal Trades (Google Sheets)
  • Fetch External Trades (Google Sheets)

3. Merge Data

  • Uses SQL-based FULL OUTER JOIN on trade_id

4. Detect Mismatches

  • Compares:
  • Price
  • Quantity
  • Amount
  • Side
  • Currency
  • Status
  • Flags missing records

5. Classify Severity

  • High → Price/Amount issues
  • Medium → Quantity issues
  • Low → Other mismatches

6. AI Insight Generation

  • Sends trade data to AI model
  • Returns:
  • Reason
  • Explanation
  • Action

7. Data Update

  • Updates Internal & External Sheets
  • Fields updated:
  • mismatch
  • reason
  • severity
  • action

8. Handle Missing Trades

  • Inserts missing records if trade exists only in one system

9. Notifications

  • Sends email alerts:
  • Trade mismatch alerts
  • Missing trade alerts

How To Customize Nodes

  • Merge Node: Modify SQL logic for additional fields
  • Code Node (Detect Trade Breaks): Add/remove comparison conditions
  • AI Node: Customize prompt for deeper analysis
  • Severity Logic: Adjust classification rules
  • Google Sheets Nodes: Change column mappings
  • Email Node: Customize message format and recipients

Add-ons

  • Add Slack/Teams notifications
  • Schedule workflow (cron trigger)
  • Dashboard using Google Data Studio
  • Store logs in database (MySQL/PostgreSQL)
  • Add approval workflow before updating sheets

Use Case Examples

  1. Daily trade reconciliation between broker and internal system
  2. Detecting missing trades in financial systems
  3. Identifying pricing discrepancies in trading operations
  4. Automating audit-ready reconciliation reports
  5. Real-time monitoring of trade data consistency

Troubleshooting Guide

Issue Possible Cause Solution
No data fetched Wrong Sheet ID Verify Google Sheets connection
Merge not working Missing trade_id Ensure both sheets have trade_id
AI output error Invalid JSON response Check AI prompt format
Emails not sent Gmail not configured Reconnect Gmail credentials
Wrong severity Logic mismatch Update severity code logic

Need Help?

If you need help setting up this workflow, customizing nodes or building advanced automation, feel free to reach out our n8n automation experts.

We can help you:

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 - Groq Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatGroq - lmChatGroq
Config choices
Version 1

Block 2 - Starting Trigger

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

Block 3 - Fetch Internal Trades

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 4 - Fetch External Trades

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 5 - Merge Internal & External Trades

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

Block 6 - Detect Trade Breaks

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

Block 7 - Classify Severity

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

Block 8 - Prepare Trade Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Generate AI Reconciliation Insight

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3.1

Block 10 - Extract AI Output

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - Check Valid Row

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

Block 12 - Check Trade Mismatch

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

Block 13 - Update Internal Trades Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 14 - Update External Trades Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 15 - Insert Missing Internal Trade

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 16 - Insert External Trade Record

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 17 - Send Trade Break Alert Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 18 - Send Missing Trade Alert Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 19 - Sticky Note

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

Block 20 - Sticky Note1

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

Block 21 - Sticky Note2

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

Block 22 - Sticky Note3

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

Block 23 - Sticky Note4

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

Block 24 - Sticky Note5

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

3. Summary Table

Workflow Reconcile trade mismatches in Google Sheets with Groq/OpenAI and Gmail alerts
Complexity advanced
Nodes 24
Categories Document Extraction, AI Summarization
Author WeblineIndia
Published 20 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/15856/15856.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 Reconcile trade mismatches in Google Sheets with Groq/OpenAI and Gmail alerts do?

Trade Break Reconciliation Assistant This workflow automates trade reconciliation between internal and external systems using Google Sheets. It detects mismatches (price, quantity, amount, etc.), u...

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.