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 Triggers every minute when a new Gmail message arrives matching the search filter subject:"Trade Instruction". Captures the email snippet and sender information and sends the email text to Google Gemini to extract asset, quantity, price, and client as JSON. Enforces a structured JSON schema for the extracted trade details. Validates that the extracted asset is present and the quantity is greater than zero. 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. Sends a critical Slack alert to the ops user when extraction or validation fails so the trade can be handled manually.
Setup Connect credentials for Gmail, Google Sheets, Slack, and Google Gemini (PaLM/Gemini API). Update the Gmail trigger query (or align your inbound email subject/filters) so trade instruction emails match subject:"Trade Instruction". Select the target Google Sheets document and sheet, and ensure it has columns for Asset, Quantity, Price, Client, and Timestamp. Configure the Slack connection and set the target user/channel for both success and failure notifications. Confirm the Gmail reply action is permitted for the mailbox and that replies should go back to the original sender/thread.
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
⚡ AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments