OpenSea NFT Agent Tool
工作流概述
这是一个包含17个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "ZBH1ExE58wsoodkZ",
"meta": {
"instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6"
},
"name": "OpenSea NFT Agent Tool",
"tags": [],
"nodes": [
{
"id": "33cb5db2-a023-4a6c-a4ad-3f4b3c35ce42",
"name": "NFT Agent Brain",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
1340,
240
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "yUizd8t0sD5wMYVG",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "9d1fa8e4-3acf-4ace-965c-ea5cdfcdc366",
"name": "NFT Agent Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
1520,
240
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "d396bb90-00a6-41da-898d-7815d8d25fe3",
"name": "OpenSea NFT Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2140,
-20
],
"parameters": {
"text": "={{ $json.message }}",
"options": {
"systemMessage": "# **🛠 OpenSea NFT Agent – System Message**
## **🔹 Role & Purpose**
The **OpenSea NFT Agent** is a powerful AI-driven assistant specialized in retrieving, analyzing, and processing NFT-related data from **OpenSea's API**. It provides insights into:
- User profiles
- NFT collections and contracts
- Individual NFTs, their metadata, traits, and ownership
- Payment tokens used in NFT transactions
- Bulk NFT retrievals (by account, collection, or contract)
This agent is designed to interact **directly** with OpenSea’s API and follows strict formatting rules to ensure valid requests and accurate responses.
---
# **⚡ Available Tools & How to Use Them**
The **NFT Agent** has access to **multiple OpenSea API endpoints**, each serving a specific purpose.
## **1️⃣ Get Account**
📍 **Endpoint**: `/api/v2/accounts/{address_or_username}`
🔹 **Description**: Retrieves an OpenSea user profile, including:
- Bio
- Social media usernames
- Profile image
🔹 **Required Parameter**:
- `address_or_username` → Public blockchain address or OpenSea username
🔹 **Example Query**:
_\"Retrieve OpenSea profile for user `0xA5f49655E6814d9262fb656d92f17D7874d5Ac7E`.\"_
---
## **2️⃣ Get Collection**
📍 **Endpoint**: `/api/v2/collections/{collection_slug}`
🔹 **Description**: Fetches details about a specific NFT collection, including:
- Collection metadata
- Fees
- Traits
- Social media links
🔹 **Required Parameter**:
- `collection_slug` → Unique identifier for the collection (found in OpenSea URL)
🔹 **Example Query**:
_\"Retrieve details for the 'Bored Ape Yacht Club' collection.\"_
---
## **3️⃣ Get Collections**
📍 **Endpoint**: `/api/v2/collections`
🔹 **Description**: Fetches a **list of NFT collections** with optional filters.
🔹 **Optional Parameters**:
- `chain` → Filter by blockchain (**must be a valid chain** from the list below).
- `creator_username` → Return collections from a specific OpenSea username.
- `include_hidden` → Boolean (`true`/`false`) to include hidden collections.
- `limit` → Number of results (1-100, default: 100).
- `next` → Cursor for pagination.
- `order_by` → Sorting option (`created_date`, `market_cap`, `num_owners`, `one_day_change`, `seven_day_change`, `seven_day_volume`).
🔹 **Example Query**:
_\"List the top 10 NFT collections on Ethereum sorted by market cap.\"_
---
## **4️⃣ Get Contract**
📍 **Endpoint**: `/api/v2/chain/{chain}/contract/{address}`
🔹 **Description**: Retrieves **smart contract details** for an NFT collection.
🔹 **Required Parameters**:
- `chain` → Blockchain network (**must be valid, see list below**).
- `address` → Smart contract address of the NFT collection.
🔹 **Example Query**:
_\"Retrieve contract details for `0xABCDEF...` on Ethereum.\"_
---
## **5️⃣ Get NFT**
📍 **Endpoint**: `/api/v2/chain/{chain}/contract/{address}/nfts/{identifier}`
🔹 **Description**: Retrieves **metadata, traits, ownership, and rarity** of a specific NFT.
🔹 **Required Parameters**:
- `chain` → Blockchain network (**must be valid, see list below**).
- `address` → Smart contract address of the NFT collection.
- `identifier` → The **NFT Token ID**.
🔹 **Example Query**:
_\"Retrieve metadata for NFT #1234 from Ethereum contract `0xABCDEF...`.\"_
---
## **6️⃣ Get NFTs (by Account)**
📍 **Endpoint**: `/api/v2/chain/{chain}/account/{address}/nfts`
🔹 **Description**: Retrieves **all NFTs owned** by a given account address.
🔹 **Required Parameters**:
- `chain` → Blockchain network (**must be valid, see list below**).
- `address` → Public blockchain address of the owner.
🔹 **Optional Parameters**:
- `collection` → Filter by specific NFT collection.
- `limit` → Number of NFTs to return (1-200, default: 50).
- `next` → Cursor for pagination.
🔹 **Example Query**:
_\"Retrieve all NFTs owned by `0x123...` on Ethereum.\"_
---
## **⚠️ Important Rules & Restrictions**
### **🚨 1. Only Allowed Blockchain Inputs**
✅ **Valid Blockchains for 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 this instead of \"polygon\")_
- `monad_testnet`
- `mumbai`
- `optimism`
- `optimism_sepolia`
- `sei_testnet`
- `sepolia`
- `shape`
- `solana`
- `soldev`
- `soneium`
- `soneium_minato`
- `unichain`
- `zora`
- `zora_sepolia`
🚨 **Critical Rule:**
- ❌ `\"polygon\"` **is NOT a valid chain input** and **must be replaced with** `\"matic\"`.
- ❌ Using an unsupported blockchain **will cause an error**.
- ✅ Always verify blockchain names before executing a query.
---
## **📌 Example Queries**
✅ _\"Find the OpenSea profile for `0x123...`.\"_
✅ _\"List all NFT collections created by `CryptoArtistX`.\"_
✅ _\"Retrieve contract details for `0xABC...` on Ethereum.\"_
✅ _\"Fetch metadata for NFT #5678 in 'Azuki' collection.\"_
✅ _\"List the top 5 NFT collections on Solana, ordered by market cap.\"_
---
## **⚠️ Error Handling**
If an OpenSea API request fails, **check for errors**:
- ✅ `200` → Success
- ❌ `400` → Bad Request (Invalid input format)
- ❌ `404` → Not Found (Incorrect `collection_slug`, `address`, or `identifier`)
- ❌ `500` → Server Error (OpenSea API issue)
---
# **🚀 Conclusion**
The **OpenSea NFT Agent** is a **specialized AI-powered assistant** designed to retrieve and analyze NFT-related data on OpenSea. Whether you are a **collector, investor, or analyst**, this agent helps you stay **ahead of the market** by providing **real-time, structured, and in-depth insights**.
**🔥 Follow all rules to ensure successful API queries! 🔥**"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "c055762a-8fe7-4141-a639-df2372f30060",
"name": "Workflow Input Trigger",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
1420,
-20
],
"parameters": {
"workflowInputs": {
"values": [
{
"name": "message"
},
{
"name": "sessionId"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "e2b0e848-ae9a-4fce-bf74-11cdebca512e",
"name": "OpenSea Get Account",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1720,
240
],
"parameters": {
"url": "https://api.opensea.io/api/v2/accounts/{address_or_username}",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "This tool retrieves an OpenSea account profile, including bio, social media usernames, and profile image.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "a343aba5-6a1c-4a19-8054-d80a92b30db0",
"name": "OpenSea Get Collection",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1920,
240
],
"parameters": {
"url": "https://api.opensea.io/api/v2/collections/{collection_slug}",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "This tool retrieves details of a specific NFT collection from OpenSea, including fees, traits, and links.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "c21482cd-bc29-47ee-9913-b200abdfd5bd",
"name": "OpenSea Get Collections",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
2120,
240
],
"parameters": {
"url": "https://api.opensea.io/api/v2/collections",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "chain",
"valueProvider": "modelOptional"
},
{
"name": "creator_username",
"valueProvider": "modelOptional"
},
{
"name": "include_hidden",
"valueProvider": "modelOptional"
},
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "next",
"valueProvider": "modelOptional"
},
{
"name": "order_by",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool retrieves a list of OpenSea collections with filtering options for blockchain, creator, visibility, sorting, and pagination.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "ab41e2bc-8c99-41ae-bfa5-5a94c8068f33",
"name": "OpenSea Get Contract",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
2340,
240
],
"parameters": {
"url": "https://api.opensea.io/api/v2/chain/{chain}/contract/{address}",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "This tool retrieves details of a smart contract from OpenSea based on a given blockchain and contract address.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "f938ea94-59f7-4e9b-a75f-02b8e606e8ed",
"name": "OpenSea Get NFT",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
2580,
260
],
"parameters": {
"url": "https://api.opensea.io/api/v2/chain/{chain}/contract/{address}/nfts/{identifier}",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "This tool retrieves metadata, traits, ownership information, and rarity for a single NFT on OpenSea.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "c62f092e-353e-4038-a875-d3c86b9e2a3d",
"name": "OpenSea Get NFTs by Account",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
2820,
260
],
"parameters": {
"url": "https://api.opensea.io/api/v2/chain/{chain}/account/{address}/nfts",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "collection",
"valueProvider": "modelOptional"
},
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "next",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool retrieves NFTs owned by a given account address on OpenSea, allowing filtering by collection, blockchain, and pagination options.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "4603a4f0-a46b-4ea9-b226-726f9763d823",
"name": "OpenSea Get NFTs by Collection",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
3080,
260
],
"parameters": {
"url": "https://api.opensea.io/api/v2/collection/{collection_slug}/nfts",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "next",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool retrieves multiple NFTs for a given collection on OpenSea, allowing pagination and limit options.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "f27c8a55-230e-41a2-ba92-f8facb323e8d",
"name": "OpenSea Get NFTs by Contract",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
3320,
260
],
"parameters": {
"url": "https://api.opensea.io/api/v2/chain/{chain}/contract/{address}/nfts",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "limit",
"valueProvider": "modelOptional"
},
{
"name": "next",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "This tool retrieves multiple NFTs for a given smart contract on OpenSea, allowing pagination and limit options.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "6043b056-339b-4bdd-898e-91e3b5915afd",
"name": "OpenSea Get Payment Token",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
3540,
260
],
"parameters": {
"url": "https://api.opensea.io/api/v2/chain/{chain}/payment_token/{address}",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "This tool retrieves details of a payment token from OpenSea based on a given blockchain and token address.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "5601cd2a-45f8-4cb6-acd8-02e44b033dcb",
"name": "OpenSea Get Traits",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
3760,
260
],
"parameters": {
"url": "https://api.opensea.io/api/v2/traits/{collection_slug}",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "This tool retrieves the traits in a given NFT collection from OpenSea.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
},
{
"name": "x-api-key",
"value": "YOUR_OPENSEA_API_KEY",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "3v99GVMGF4tKP5nM",
"name": "OpenSea"
}
},
"typeVersion": 1.1
},
{
"id": "86a6c757-bbda-41a9-90d1-1e8af808ae66",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
160,
-1240
],
"parameters": {
"color": 2,
"width": 920,
"height": 1880,
"content": "# OpenSea NFT Agent Tool (n8n Workflow) Guide
## 🚀 Workflow Overview
The **OpenSea NFT Agent Tool** is a specialized **AI-powered assistant** designed to interact with **OpenSea's API** to fetch, analyze, and process NFT-related data. It helps users access **NFT ownership, metadata, traits, collections, contracts, and payment tokens** efficiently.
### 🎯 **Key Features**:
- Retrieve **OpenSea user profiles** by wallet address or username.
- Fetch **NFT collections**, metadata, contracts, and smart contract details.
- Access **individual NFT details**, including rarity and ownership.
- Track **NFTs owned by an account**, collections, and smart contracts.
- Retrieve **payment tokens** and NFT traits.
- Ensure **API request validity** and structured responses.
---
## 🔗 **Nodes & Functions**
### **1️⃣ NFT Agent Brain**
- **Type**: AI Language Model (GPT-4o Mini)
- **Purpose**: Processes NFT-related API requests and interprets OpenSea data queries.
### **2️⃣ NFT Agent Memory**
- **Type**: AI Memory Buffer
- **Purpose**: Stores session data to maintain context across multiple queries.
### **3️⃣ OpenSea Get Account**
- **Type**: API Request
- **Endpoint**: `/api/v2/accounts/{address_or_username}`
- **Function**: Fetches an OpenSea **user profile**, including bio, social links, and profile image.
### **4️⃣ OpenSea Get Collection**
- **Type**: API Request
- **Endpoint**: `/api/v2/collections/{collection_slug}`
- **Function**: Retrieves **collection metadata**, fees, and traits.
### **5️⃣ OpenSea Get Collections**
- **Type**: API Request
- **Endpoint**: `/api/v2/collections`
- **Function**: Fetches **a list of NFT collections**, filtered by chain, creator, visibility, or ranking.
### **6️⃣ OpenSea Get Contract**
- **Type**: API Request
- **Endpoint**: `/api/v2/chain/{chain}/contract/{address}`
- **Function**: Retrieves **NFT collection smart contract details**.
### **7️⃣ OpenSea Get NFT**
- **Type**: API Request
- **Endpoint**: `/api/v2/chain/{chain}/contract/{address}/nfts/{identifier}`
- **Function**: Fetches **metadata, traits, rarity, and ownership** of a single NFT.
### **8️⃣ OpenSea Get NFTs by Account**
- **Type**: API Request
- **Endpoint**: `/api/v2/chain/{chain}/account/{address}/nfts`
- **Function**: Retrieves **all NFTs owned** by a wallet address.
### **9️⃣ OpenSea Get NFTs by Collection**
- **Type**: API Request
- **Endpoint**: `/api/v2/collection/{collection_slug}/nfts`
- **Function**: Fetches **all NFTs in a collection**.
### **🔟 OpenSea Get NFTs by Contract**
- **Type**: API Request
- **Endpoint**: `/api/v2/chain/{chain}/contract/{address}/nfts`
- **Function**: Retrieves **NFTs linked to a smart contract**.
### **11️⃣ OpenSea Get Payment Token**
- **Type**: API Request
- **Endpoint**: `/api/v2/chain/{chain}/payment_token/{address}`
- **Function**: Fetches details of a **cryptocurrency/token** used for NFT transactions.
### **12️⃣ OpenSea Get Traits**
- **Type**: API Request
- **Endpoint**: `/api/v2/traits/{collection_slug}`
- **Function**: Retrieves **trait categories and attributes** for a given collection.
---
"
},
"typeVersion": 1
},
{
"id": "c35f3855-5167-4230-8017-f60297d1dcec",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
1540,
-1240
],
"parameters": {
"color": 5,
"width": 1000,
"height": 1060,
"content": "## 📌 **How to Use the Workflow**
### ✅ **Step 1: Input Data**
- Provide the necessary parameters like `collection_slug`, `chain`, `address`, or `identifier`.
### ✅ **Step 2: Execute API Calls**
- The workflow retrieves and structures **NFT ownership, metadata, and analytics**.
### ✅ **Step 3: Analyze & Output Results**
- Results can be integrated into dashboards, alerts, or Telegram notifications.
---
## ⚠️ **Common API Queries & Examples**
### **1️⃣ Get OpenSea User Profile**
```plaintext
GET https://api.opensea.io/api/v2/accounts/0xA5f49655E6814d9262fb656d92f17D7874d5Ac7E
```
### **2️⃣ Get Collection Details**
```plaintext
GET https://api.opensea.io/api/v2/collections/boredapeyachtclub
```
### **3️⃣ Get NFT Metadata**
```plaintext
GET https://api.opensea.io/api/v2/chain/ethereum/contract/0xABCDEF.../nfts/1234
```
### **4️⃣ Get All NFTs Owned by a Wallet**
```plaintext
GET https://api.opensea.io/api/v2/chain/ethereum/account/0x123.../nfts
```
### **5️⃣ Get Payment Token Details**
```plaintext
GET https://api.opensea.io/api/v2/chain/ethereum/payment_token/0xABC...DEF
```
---
"
},
"typeVersion": 1
},
{
"id": "c96fc837-37b2-4351-9175-7b52fba1e38b",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
2940,
-1240
],
"parameters": {
"color": 3,
"width": 840,
"height": 480,
"content": "## ⚡ **Error Handling & Troubleshooting**
| **Error Code** | **Description** |
|--------------|----------------|
| `200` | Success |
| `400` | Bad Request (Invalid input) |
| `404` | Not Found (Incorrect slug, address, or identifier) |
| `500` | Server Error (OpenSea API issue) |
### 🔹 **Fixing Common Errors**
- Ensure correct **wallet address**, **NFT identifier**, or **collection slug**.
- Always use `\"matic\"` instead of `\"polygon\"` for chain input.
- If OpenSea API is **down**, retry after some time.
---
## 🚀 **Connect with Me for Support**
If you need assistance, custom OpenSea NFT insights, or automation support, feel free to connect with me on LinkedIn:
🌐 **Don Jayamaha – LinkedIn**
🔗 [http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "1bdf4330-2c81-47dc-8729-1737eb19cd40",
"connections": {
"NFT Agent Brain": {
"ai_languageModel": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"OpenSea Get NFT": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"NFT Agent Memory": {
"ai_memory": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"OpenSea Get Traits": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get Account": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get Contract": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get Collection": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Workflow Input Trigger": {
"main": [
[
{
"node": "OpenSea NFT Agent",
"type": "main",
"index": 0
}
]
]
},
"OpenSea Get Collections": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get Payment Token": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get NFTs by Account": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get NFTs by Contract": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenSea Get NFTs by Collection": {
"ai_tool": [
[
{
"node": "OpenSea NFT Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- @N8N/N8N Nodes Langchain.Lmchatopenai
- @N8N/N8N Nodes Langchain.Memorybufferwindow
- @N8N/N8N Nodes Langchain.Agent
- Executeworkflowtrigger
- @N8N/N8N Nodes Langchain.Toolhttprequest
复杂度评估
配置难度:
维护难度:
扩展性:
实施指南
前置条件
- 有效的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错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作