OpenSea AI-Powered Insights via Telegram
工作流概述
这是一个包含13个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "wi2ZWKN9XPR0jkvn",
"meta": {
"instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
"templateCredsSetupCompleted": true
},
"name": "OpenSea AI-Powered Insights via Telegram",
"tags": [],
"nodes": [
{
"id": "0b6ec133-7023-4c6a-ae53-78168211545c",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
840,
140
],
"webhookId": "befa3e52-7b57-4832-9f88-b2c430244595",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "787a9e8d-e67d-4947-90d1-8e3284de7b39",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
840,
-160
],
"webhookId": "f9267d32-3860-4f02-99b3-493c4cac36ed",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"credentials": {
"telegramApi": {
"id": "R3vpGq0SURbvEw2Z",
"name": "Telegram account"
}
},
"typeVersion": 1.1
},
{
"id": "2e10802a-48d7-4b82-afe0-b9e5f93498bf",
"name": "Adds SessionId",
"type": "n8n-nodes-base.set",
"position": [
1160,
-160
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b5c25cd4-226b-4778-863f-79b13b4a5202",
"name": "sessionId",
"type": "string",
"value": "={{ $json.message.chat.id }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "8dd2dcdd-7cd5-4381-b1a5-66a2b6a69111",
"name": "Opensea Supervisor Brain",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1380,
160
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "yUizd8t0sD5wMYVG",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "b2b59481-afbb-4cb6-98b7-c26bf51ead76",
"name": "Opensea Supervisor Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1580,
160
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "52dde53b-cb42-4ae2-b573-d9356d7ec3f3",
"name": "OpenSea Analytics Agent Tool",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
1760,
160
],
"parameters": {
"name": "OpenSea_Analytics_Agent_Tool",
"workflowId": {
"__rl": true,
"mode": "list",
"value": "yRMCUm6oJEMknhbw",
"cachedResultName": "JayaFamily Assistant — OpenSea Analytics Agent Tool"
},
"workflowInputs": {
"value": {
"message": "={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}",
"sessionId": "={{ $json.sessionId }}"
},
"schema": [
{
"id": "message",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "message",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "sessionId",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "sessionId",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2
},
{
"id": "596517b1-4f1e-4285-b8ee-cdf8108c4138",
"name": "OpenSea NFT Agent Tool",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
1940,
160
],
"parameters": {
"name": "OpenSea_NFT_Agent_Tool",
"workflowId": {
"__rl": true,
"mode": "list",
"value": "ZBH1ExE58wsoodkZ",
"cachedResultName": "JayaFamily Assistant — OpenSea NFT Agent Tool"
},
"workflowInputs": {
"value": {
"message": "={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}",
"sessionId": "={{ $json.sessionId }}"
},
"schema": [
{
"id": "message",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "message",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "sessionId",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "sessionId",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2
},
{
"id": "643c5c81-ba21-4afa-9c78-70cd6cde08f7",
"name": "OpenSea Marketplace Agent Tool",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
2120,
160
],
"parameters": {
"name": "OpenSea_Marketplace_Agent_Tool",
"workflowId": {
"__rl": true,
"mode": "list",
"value": "brRSLvIkYp3mLq0K",
"cachedResultName": "JayaFamily Assistant — OpenSea Marketplace Agent Tool"
},
"workflowInputs": {
"value": {
"message": "={{ $fromAI(\"message\",\"Populate this with a relevant message to this subagent\")}}",
"sessionId": "={{ $json.sessionId }}"
},
"schema": [
{
"id": "message",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "message",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "sessionId",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "sessionId",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
}
},
"typeVersion": 2
},
{
"id": "069cb9bc-96a4-4539-b7c5-b06d29968ec6",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
2080,
-120
],
"webhookId": "9841771a-821a-4a40-a9e8-fb8a29eaa9f3",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {
"appendAttribution": false
}
},
"credentials": {
"telegramApi": {
"id": "R3vpGq0SURbvEw2Z",
"name": "Telegram account"
}
},
"typeVersion": 1.2
},
{
"id": "cc852b55-0214-4276-9c2f-755d9cb3fc28",
"name": "OpenSea AI-Powered Insights Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1600,
-120
],
"parameters": {
"text": "={{ $json.message.text }}",
"options": {
"systemMessage": "**🌍 Role & Capabilities**
The **OpenSea AI-Powered Insights Agent** is an advanced **AI data analyst** with **full access to OpenSea’s API**, capable of executing **multi-step queries, data aggregation, and deep research** into NFT market trends, asset tracking, and real-time trading insights.
It leverages **three powerful agent tools** to provide **actionable insights and decision-making intelligence**:
1. **Marketplace Agent** – Fetches **listings, orders, offers, and trait-based pricing data**.
2. **Analytics Agent** – Retrieves **NFT collection statistics, transaction histories, and market analytics**.
3. **NFT Agent** – Gathers **detailed metadata, ownership details, and payment token data**.
🧠 **This AI system can process multiple tools together, conduct research between datasets, and synthesize powerful responses to user queries.**
---
## **🛠 Actionable Insights & Multi-Step Queries**
The agent can **combine** multiple tools, process collected data, and execute deep research for **smarter responses**.
🔹 **How this works**:
- 🏛 **Compare multiple collections** _(e.g., floor price, sales volume)_
- 🎯 **Track NFT flipping trends** _(e.g., which wallets buy/sell the most)_
- 🔥 **Identify undervalued NFTs** _(e.g., listings below average trait value)_
- 📊 **Aggregate sales data over time** _(e.g., 7-day vs. 30-day collection trends)_
- 👥 **Analyze whale movements** _(e.g., track large NFT purchases)_
- 💡 **Predict market shifts** _(e.g., sudden spikes in buy offers)_
📢 **Example Action Queries:**
- _“Find me the top 5 most undervalued Azuki NFTs based on recent sales.”_
- _“Compare the last 3 months of trading volume between Moonbirds and CloneX.”_
- _“Track all wallets that recently sold a Bored Ape Yacht Club NFT.”_
- _“List the top 10 wallets making the most NFT purchases this week.”_
---
## **🚀 Available Tools & Proper Usage**
### **1️⃣ Marketplace Agent Tools (Orders, Listings, and Offers)**
Provides **real-time marketplace data** for **NFTs, collections, and traits**.
🔹 **How to use these tools correctly**:
- Always input **a valid OpenSea collection slug** (found in OpenSea URLs).
- Ensure **blockchain names** match OpenSea’s supported chains.
- Use **pagination (`next` cursor)** for large datasets.
| **Tool** | **Description** |
|----------------------------------|----------------|
| 🛒 **Get All Listings (by Collection)** | Fetches all active listings for a collection. |
| 💰 **Get All Offers (by Collection)** | Retrieves all valid offers for a collection. |
| 🔎 **Get Best Listing (by NFT)** | Finds the **cheapest** active listing for a specific NFT. |
| 🏆 **Get Best Listings (by Collection)** | Retrieves the **cheapest** active listings for an entire collection. |
| 💲 **Get Best Offer (by NFT)** | Finds the **highest** offer for a specific NFT. |
| 🏷 **Get Collection Offers** | Retrieves all active **collection-wide** offers. |
| 🎯 **Get Item Offers** | Fetches **individual** offers, excluding criteria-based offers. |
| 📋 **Get Listings (by Chain & Protocol)** | Lists all active orders filtered by blockchain and protocol. |
| 🔗 **Get Order (by Hash)** | Retrieves details for a **specific order** using its hash. |
| 🎨 **Get Trait Offers** | Retrieves **all trait-based offers** in a collection. |
✅ **Critical Notes for Marketplace Queries**:
1. **Only use OpenSea’s supported chains** _(see the full list below)_.
2. `\"polygon\"` is **not allowed** – use `\"matic\"` instead.
3. **Seaport is the only supported protocol** for order-related queries.
4. **Fixed protocol address** for Get Order:
- `0x0000000000000068f116a894984e2db1123eb395`
5. **Pagination**: Use `next` parameter for large datasets.
---
### **2️⃣ Analytics Agent Tools (Market Insights & Transactions)**
Delivers **historical and real-time analysis** on NFT collections, user transactions, and blockchain events.
🔹 **How to use these tools correctly**:
- Always specify **a valid collection slug** or **wallet address**.
- Filter transactions by **blockchain, event type, and timeframe**.
- Use **pagination** when fetching large datasets.
| **Tool** | **Description** |
|------------------------------------|----------------|
| 📊 **Get Collection Stats** | Fetches **market cap, floor price, total volume, and sales** of an NFT collection. |
| 🏷 **Get Events (All Market Activity)** | Retrieves **all NFT events** including sales, transfers, listings, bids, and redemptions. |
| 👤 **Get Events (by Account)** | Lists **all NFT-related transactions** for a specific **wallet address**. |
| 🏛 **Get Events (by Collection)** | Fetches all transactions for **an entire NFT collection**. |
| 🎟 **Get Events (by NFT)** | Retrieves the **full transaction history** of a single NFT. |
✅ **Critical Notes for Analytics Queries**:
1. Use **valid blockchain names** _(see list below)_ to filter results.
2. Set **event types**: _sale, transfer, listing, bid, redemption_.
3. Use `before` and `after` timestamps _(Unix format)_ to filter historical data.
4. **Pagination**: Use `next` for large datasets.
---
### **3️⃣ NFT Agent Tools (Metadata, Ownership, and Smart Contracts)**
Provides **in-depth details** about individual NFTs, collections, and payment tokens.
🔹 **How to use these tools correctly**:
- Ensure **wallet addresses and contract addresses** are **valid**.
- For **NFT metadata**, provide **blockchain name + contract address + token ID**.
| **Tool** | **Description** |
|----------------------------------|----------------|
| 🔍 **Get Account** | Fetches **profile details** of an OpenSea user. |
| 🏛 **Get Collection** | Retrieves **metadata, fees, and social links** of an NFT collection. |
| 📜 **Get Collections** | Lists **all NFT collections** with optional filters (creator, blockchain, etc.). |
| 🏗 **Get Contract** | Retrieves **smart contract details** for an NFT collection. |
| 🎭 **Get NFT** | Fetches **metadata, traits, rarity, and ownership** of a single NFT. |
| 👥 **Get NFTs (by Account)** | Lists **all NFTs owned** by a given wallet address. |
| 📦 **Get NFTs (by Collection)** | Retrieves **multiple NFTs** from a specific collection. |
| 🔗 **Get NFTs (by Contract)** | Lists all NFTs for a **given smart contract**. |
| 💵 **Get Payment Token** | Retrieves **details about an ERC-20 payment token**. |
| 🎨 **Get Traits** | Lists **all available traits** in a collection. |
✅ **Critical Notes for NFT Queries**:
1. **Use correct blockchain names** _(see full list below)_.
2. **Contract addresses** must be **valid** and exist on OpenSea.
3. **NFT Token ID is required** for fetching metadata.
4. **For payment tokens, ensure the correct blockchain name is used.**
---
## **🚀 Supported Blockchains**
To avoid errors, **only use the following blockchain names**:
✅ **Valid Chains for OpenSea Queries**:
- `amoy`
- `ape_chain`
- `ape_curtis`
- `arbitrum`
- `arbitrum_nova`
- `arbitrum_sepolia`
- `avalanche`
- `avalanche_fuji`
- `b3`
- `b3_sepolia`
- `baobab`
- `base`
- `base_sepolia`
- `bera_chain`
- `blast`
- `blast_sepolia`
- `ethereum`
- `flow`
- `flow_testnet`
- `klaytn`
- `matic` _(use instead of \"polygon\")_
- `monad_testnet`
- `mumbai`
- `optimism`
- `optimism_sepolia`
- `sei_testnet`
- `sepolia`
- `shape`
- `solana`
- `soldev`
- `soneium`
- `soneium_minato`
- `unichain`
- `zora`
- `zora_sepolia`
❌ **Do NOT use unsupported chain names!**
---
## **🛠 How the AI Agent Works**
1. **Understands your query** and determines the correct API tool.
2. **Executes the API request** with valid parameters.
3. **Processes and structures results** into **readable insights**.
4. **Combines multiple data sources** for research-driven responses.
5. **Allows follow-up questions** for deeper market insights.
🎯 **Use this AI for market intelligence, trend analysis, and NFT investment strategies!** 🚀"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "087fad83-0a96-42f6-92b1-06685bfc13f4",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-940,
-1380
],
"parameters": {
"color": 2,
"width": 1320,
"height": 1780,
"content": "# OpenSea AI-Powered Insights System (n8n) - Full Integration Guide
## 🚀 System Overview
The **OpenSea AI-Powered Insights System** is a fully automated n8n workflow that connects multiple agent tools to deliver **real-time NFT market insights via Telegram**. This system consists of **four interconnected workflows**:
1. **OpenSea AI-Powered Insights via Telegram** (Main Supervisor)
2. **OpenSea Analytics Agent Tool** (Market Trends & Collection Stats)
3. **OpenSea Marketplace Agent Tool** (Live Listings, Offers, and Orders)
4. **OpenSea NFT Agent Tool** (Metadata, Ownership & Payment Tokens)
These agents work **in sync** under the **Supervisor AI**, which determines the appropriate agent(s) to use based on user queries. Responses are structured and sent back via **Telegram** for real-time insights.
---
## 🔗 **System Architecture**
### **🔹 Core Workflow: OpenSea AI-Powered Insights via Telegram**
- Acts as the **brain and command center**.
- Receives queries from **Telegram Chat**.
- Determines which **agent(s)** should process the request.
- Aggregates and formats results.
- Sends structured responses back to the Telegram user.
### **🔹 Supporting Agent Tools**
Each **agent tool** is a separate n8n workflow with a specific function:
1️⃣ **OpenSea Analytics Agent** → Retrieves **market trends, sales history, transaction data**.
2️⃣ **OpenSea Marketplace Agent** → Fetches **NFT listings, offers, best prices, and order details**.
3️⃣ **OpenSea NFT Agent** → Retrieves **NFT metadata, ownership records, traits, and payment token data**.
The **Supervisor AI (Telegram Workflow)** calls these agent workflows as needed.
---
## 🛠 **Setup Instructions**
### **1️⃣ Setting Up the Main Supervisor (Telegram Workflow)**
1. **Create a Telegram Bot** using [BotFather](https://t.me/botfather).
2. **Copy the API Key** and connect it to n8n’s **Telegram Trigger Node**.
3. Set up the **Chat Message Received Node** to capture user queries.
4. Configure the **Session ID Node** to track conversation history.
5. Link the **AI Supervisor Brain (GPT-4o Mini)** to process messages.
6. Connect it to the **three agent tools** using **Tool Workflow Nodes**.
7. Send output back to Telegram using the **Telegram Node**.
✅ **This setup enables Telegram interaction with all OpenSea agents.**
### **2️⃣ Configuring the OpenSea Agent Tools**
Each agent tool must be linked to the main workflow:
**A. OpenSea Analytics Agent**
- Retrieves NFT market trends & transaction history.
- Requires **collection slug, wallet address, or transaction filters**.
**B. OpenSea Marketplace Agent**
- Fetches NFT listings, offers, and orders.
- Requires **collection slug, token ID, or order hash**.
**C. OpenSea NFT Agent**
- Retrieves NFT metadata, traits, and ownership data.
- Requires **wallet address, contract address, or token ID**.
### **3️⃣ Connecting the Agents to the Main Workflow**
Each **Tool Workflow Node** inside the **Telegram Supervisor Workflow** must be configured to pass the query **to the correct agent tool**.
Example:
- User asks: **“Find the cheapest listing for Bored Ape #1234”** → **Marketplace Agent is activated**.
- User asks: **“Retrieve all NFTs owned by 0xABC...”** → **NFT Agent is activated**.
- User asks: **“Compare last 3 months’ sales volume of Azuki and Moonbirds”** → **Analytics Agent is activated**.
---
"
},
"typeVersion": 1
},
{
"id": "c9dd93eb-44bc-4825-a092-8a8b8e3b07bb",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
660,
-1380
],
"parameters": {
"color": 5,
"width": 840,
"height": 1060,
"content": "## 🔄 **Data Flow & Execution Process**
### **📩 Step 1: Receiving a Query**
1. User sends a request via Telegram.
2. The **Telegram Trigger** captures the message.
3. The **Session ID Node** assigns a conversation ID.
### **📊 Step 2: Processing the Query**
4. The **AI Supervisor Brain** (GPT-4o Mini) interprets the request.
5. It decides which **agent tool** should process the query.
### **🔗 Step 3: Activating the Correct Agent Tool**
6. The appropriate **Tool Workflow Node** is triggered (Analytics, Marketplace, or NFT Agent).
7. The **selected agent processes the query** and fetches data from OpenSea’s API.
### **📤 Step 4: Sending the Response**
8. The response is structured by the AI Supervisor.
9. The **Telegram Node** sends the formatted answer to the user.
✅ **This ensures that all agents work together seamlessly.**
---
## 🔥 **Example Queries & Expected Outputs**
### **🛒 OpenSea Marketplace Queries**
| **User Query** | **Agent Used** | **Expected Response** |
|--------------|--------------|----------------|
| _“Show me the 5 cheapest listings for Azuki.”_ | Marketplace Agent | List of Azuki NFTs with prices & links. |
| _“What’s the highest offer on Bored Ape #4567?”_ | Marketplace Agent | Highest active bid with buyer info. |
| _“Fetch the details of order 0x123abc...”_ | Marketplace Agent | Order breakdown (price, seller, expiration). |
### **📊 OpenSea Analytics Queries**
| **User Query** | **Agent Used** | **Expected Response** |
|--------------|--------------|----------------|
| _“Compare 7-day sales volume of BAYC & MAYC.”_ | Analytics Agent | Chart showing sales data. |
| _“List all transactions for CloneX in the last 24 hours.”_ | Analytics Agent | Table of sales & transfers. |
| _“Track all wallets that sold a Doodle in the last week.”_ | Analytics Agent | List of wallets & sold NFTs. |
### **🎭 OpenSea NFT Metadata Queries**
| **User Query** | **Agent Used** | **Expected Response** |
|--------------|--------------|----------------|
| _“Retrieve metadata for Cool Cat #7890.”_ | NFT Agent | NFT description, image, and attributes. |
| _“Which NFTs does 0x123... own on Ethereum?”_ | NFT Agent | List of NFTs held by the wallet. |
| _“Show me all NFTs from contract 0xABC...”_ | NFT Agent | All tokens linked to the contract. |
✅ **This demonstrates how each agent provides unique insights.**
---
"
},
"typeVersion": 1
},
{
"id": "5f8504a0-283a-408e-9768-b4b90088e687",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1800,
-1380
],
"parameters": {
"color": 3,
"width": 800,
"height": 720,
"content": "## ⚠️ **Critical Setup Notes & Troubleshooting**
🔹 **1. Ensure Correct API Credentials**
- Each agent must be connected to OpenSea’s API.
- Use **HTTP Header Authentication** with an **API Key**.
🔹 **2. Check for Invalid Chain Names**
- ❌ `\"polygon\"` is **not valid** → Use `\"matic\"` instead.
- ✅ **Only supported blockchains should be used**.
🔹 **3. Maintain Session Tracking**
- Ensure **sessionId** is passed correctly between workflows.
- This prevents **context loss** in multi-step queries.
🔹 **4. Use Pagination for Large Datasets**
- For queries returning **100+ results**, use the `next` parameter.
---
## 🚀 **Final Thoughts**
The **OpenSea AI-Powered Insights System** is designed for **NFT investors, collectors, and analysts** seeking **real-time, structured market data** through Telegram. By integrating multiple agent tools, it provides a **powerful, automated way to analyze NFTs, transactions, and market trends**.
**Need Help?**
🌐 Connect on LinkedIn:
🔗 [http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)
"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "184b0a31-6aee-4b9b-adc5-ef06e6a3f3f0",
"connections": {
"Adds SessionId": {
"main": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "main",
"index": 0
}
]
]
},
"Telegram Trigger": {
"main": [
[
{
"node": "Adds SessionId",
"type": "main",
"index": 0
}
]
]
},
"OpenSea NFT Agent Tool": {
"ai_tool": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Opensea Supervisor Brain": {
"ai_languageModel": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Opensea Supervisor Memory": {
"ai_memory": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenSea Analytics Agent Tool": {
"ai_tool": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Marketplace Agent Tool": {
"ai_tool": [
[
{
"node": "OpenSea AI-Powered Insights Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea AI-Powered Insights Agent": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- @N8N/N8N Nodes Langchain.Chattrigger
- Telegramtrigger
- Set
- @N8N/N8N Nodes Langchain.Lmchatopenai
- @N8N/N8N Nodes Langchain.Memorybufferwindow
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的Gmail账户
- n8n平台访问权限
- Google API凭证
- AI分类服务订阅
配置步骤
- 在n8n中导入工作流JSON文件
- 配置Gmail节点的认证信息
- 设置AI分类器的API密钥
- 自定义分类规则和标签映射
- 测试工作流执行
- 配置定时触发器(可选)
关键参数
| 参数名称 | 默认值 | 说明 |
|---|---|---|
| maxEmails | 50 | 单次处理的最大邮件数量 |
| confidenceThreshold | 0.8 | 分类置信度阈值 |
| autoLabel | true | 是否自动添加标签 |
最佳实践
优化建议
- 定期更新AI分类模型以提高准确性
- 根据邮件量调整处理批次大小
- 设置合理的分类置信度阈值
- 定期清理过期的分类规则
安全注意事项
- 妥善保管API密钥和认证信息
- 限制工作流的访问权限
- 定期审查处理日志
- 启用双因素认证保护Gmail账户
性能优化
- 使用增量处理减少重复工作
- 缓存频繁访问的数据
- 并行处理多个邮件分类任务
- 监控系统资源使用情况
故障排除
常见问题
邮件未被正确分类
检查AI分类器的置信度阈值设置,适当降低阈值或更新训练数据。
Gmail认证失败
确认Google API凭证有效且具有正确的权限范围,重新进行OAuth授权。
调试技巧
- 启用详细日志记录查看每个步骤的执行情况
- 使用测试邮件验证分类逻辑
- 检查网络连接和API服务状态
- 逐步执行工作流定位问题节点
错误处理
工作流包含以下错误处理机制:
- 网络超时自动重试(最多3次)
- API错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作