Библиотека / Автоматизация эл. почты
Автоматизация эл. почты
Answer currency rate questions from Gmail and chat with Gemini and Frankfurter API
When a chat message arrives, it handles email with Google Gemini using Chat, Data Table, Gmail.
Что делает
## Answer currency rate questions from Gmail and chat with a cached AI agent Who's it for Anyone who wants a reusable pattern for an AI agent that serves several channels and avoids paying for the same model call twice. Exchange rates are only the example: swap the tool for any read-only API. How it works 1. Chat and Gmail messages are normalized to the same fields and processed one at a time. 2. The workflow detects two ISO currency codes (for example "USD to EUR") and looks for a fresh cached answer for that pair and date. 3. On a cache hit the model is not called. On a miss, a Gemini agent queries the free Frankfurter API and the answer is cached. 4. Every query is logged (channel, cache hit, latency) so you can measure the savings. The reply goes back through the channel it came from. How to set up - Create the Data Table Currency cache with columns cache_key (string), pair (string), response (string), cached_at (number). - Create the Data Table Query log with columns logged_at (string), source (string), pair (string), cache_hit (boolean), latency_ms (number). - Select the tables in the 3 Data Table nodes and add your Gemini and Gmail credentials. - Review the Set configurable variables node and the filter in Receive email from Gmail. Requirements Google Gemini API key, Gmail account, n8n with Data Tables. Frankfurter needs no API key. How to customize Replace the Get Exchange Rate tool and the agent prompt, and adapt Build cache key so that equivalent questions produce the same key.
Шаги
- Receive chat message
- Receive email from Gmail
- Normalize chat message
- Normalize email message
- Loop over messages
- Set configurable variables
- Build cache key
- Lookup cached answer
- Cached answer still fresh?
- Use cached answer
- Ask currency AI agent
- Gemini Chat Model
- Conversation memory
- Get Exchange Rate
Всего шагов: 24.
Похожие автоматизации
Финансы, счета и бухгалтерияПроверка списаний по зарубежным картам по дневным курсам валют с Google Sheets и SlackШагов: 16Финансы, счета и бухгалтерияМониторинг курсов валют с OpenAI RAG и WeaviateШагов: 11Оповещения и уведомленияОтправка плановых конвертаций валют в TelegramШагов: 5Оповещения и уведомленияЕжедневная рассылка курсов валют через GmailШагов: 6