Skip to main content

Capture and log trade instructions from Gmail with Gemini and Google Sheets

Workflow preview

Workflow preview
100%
Capture and log trade instructions from Gmail with Gemini and Google Sheets preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow watches Gmail for emails with the subject “Trade Instruction”, uses Google Gemini to extract structured trade fields, validates the result, logs valid trades to Google ...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.gmailtrigger, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.if, n8n-nodes-base.googlesheets, n8n-nodes-base.gmail

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
Capture and log trade instructions from Gmail with Gemini and Google Sheets
Workflow name
Capture and log trade instructions from Gmail with Gemini and Google Sheets

Quick Overview

This workflow watches Gmail for emails with the subject “Trade Instruction”, uses Google Gemini to extract structured trade fields, validates the result, logs valid trades to Google Sheets, replies to the sender with a confirmation, and alerts an ops user in Slack on success or failure.

How it works

  1. Triggers every minute when a new Gmail message arrives matching the search filter subject:"Trade Instruction".
  2. Captures the email snippet and sender information and sends the email text to Google Gemini to extract asset, quantity, price, and client as JSON.
  3. Enforces a structured JSON schema for the extracted trade details.
  4. Validates that the extracted asset is present and the quantity is greater than zero.
  5. Appends valid trades to a Google Sheets master ledger with a timestamp, replies to the original Gmail thread with a confirmation, and sends a Slack success notification.
  6. Sends a critical Slack alert to the ops user when extraction or validation fails so the trade can be handled manually.

Setup

  1. Connect credentials for Gmail, Google Sheets, Slack, and Google Gemini (PaLM/Gemini API).
  2. Update the Gmail trigger query (or align your inbound email subject/filters) so trade instruction emails match subject:"Trade Instruction".
  3. Select the target Google Sheets document and sheet, and ensure it has columns for Asset, Quantity, Price, Client, and Timestamp.
  4. Configure the Slack connection and set the target user/channel for both success and failure notifications.
  5. Confirm the Gmail reply action is permitted for the mailbox and that replies should go back to the original sender/thread.

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 - Google Gemini Chat Model

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

Block 2 - Watch for New Trade Instructions

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.3

Block 3 - Map Email Body & Sender

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

Block 4 - Extract Trade Details (Gemini AI)

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

Block 5 - Enforce Trade Data Schema

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 6 - Verify Trade Data Validity

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

Block 7 - Log Trade to Master Ledger (Google Sheets)

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

Block 8 - Send Confirmation to Client

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

Block 9 - Notify Ops Team (Success)

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 10 - Alert Ops Team (Extraction Failed)

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.4

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

Block 13 - Sticky Note2

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

Block 14 - Sticky Note3

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

3. Summary Table

Workflow Capture and log trade instructions from Gmail with Gemini and Google Sheets
Complexity intermediate
Nodes 14
Categories Document Extraction, AI Summarization
Author WeblineIndia
Published 11 Jun 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16261/16261.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 Capture and log trade instructions from Gmail with Gemini and Google Sheets do?

Quick Overview This workflow watches Gmail for emails with the subject “Trade Instruction”, uses Google Gemini to extract structured trade fields, validates the result, logs valid trades to Google ...

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.