CoinMarketCap_Crypto_Agent_Tool
工作流概述
这是一个包含13个节点的复杂工作流,主要用于自动化处理各种任务。
工作流源代码
{
"id": "R4EuB1gx1IpMXCJM",
"meta": {
"instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
"templateCredsSetupCompleted": true
},
"name": "CoinMarketCap_Crypto_Agent_Tool",
"tags": [],
"nodes": [
{
"id": "c055762a-8fe7-4141-a639-df2372f30060",
"name": "When Executed by Another Workflow",
"type": "n8n-nodes-base.executeWorkflowTrigger",
"position": [
-240,
260
],
"parameters": {
"workflowInputs": {
"values": [
{
"name": "message"
},
{
"name": "sessionId"
}
]
}
},
"typeVersion": 1.1
},
{
"id": "3638379c-fad2-4d3b-bb90-b32242da4cc7",
"name": "CoinMarketCap Crypto Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
260,
260
],
"parameters": {
"text": "={{ $json.message }}",
"options": {
"systemMessage": "You are an AI cryptocurrency analyst. You have access to six live CoinMarketCap tools, each linked to a real API endpoint. These tools allow you to retrieve price data, metadata, market rankings, conversions, and global market stats.
Use the most relevant tool based on the user’s intent. Below is a list of your currently connected tools, their functions, and accepted input parameters.
---
### 🔧 **Connected Tools & Supported Inputs**
---
#### 1. **Crypto Map**
- **Endpoint**: `/v1/cryptocurrency/map`
- **Purpose**: Get CoinMarketCap IDs, symbols, and names.
- **Supported Inputs**:
- `symbol` – (Optional) Comma-separated crypto symbols (e.g., BTC,ETH)
- `listing_status` – `active`, `inactive`, or `untracked`
- `start` – (Pagination start)
- `limit` – (Number of results)
- **Use Cases**:
- “What is the CoinMarketCap ID for SOL?”
- “List all active cryptocurrencies.”
---
#### 2. **Crypto Info**
- **Endpoint**: `/v2/cryptocurrency/info`
- **Purpose**: Get metadata like description, whitepaper, and social links.
- **Supported Inputs**:
- `symbol` – (Required) Comma-separated symbols
- **Use Cases**:
- “Show me the whitepaper for ETH.”
- “What’s the website and Twitter handle of DOGE?”
---
#### 3. **Crypto Listings**
- **Endpoint**: `/v1/cryptocurrency/listings/latest`
- **Purpose**: Ranked list of coins sorted by market cap.
- **Supported Inputs**:
- `start` – (e.g., 1 for top coin, 101 for rank 101+)
- `limit` – (e.g., 10 for top 10)
- `convert` – Currency to convert values into (e.g., USD, EUR)
- **Use Cases**:
- “Show me the top 20 coins.”
- “What are the top 5 coins in EUR?”
---
#### 4. **CoinMarketCap Price**
- **Endpoint**: `/v2/cryptocurrency/quotes/latest`
- **Purpose**: Real-time price, volume, and market cap.
- **Supported Inputs**:
- `symbol` – (Required) Single or multiple symbols
- `convert` – Currency to display results in (e.g., USD)
- **Use Cases**:
- “What’s the current price of ADA?”
- “How much volume has BTC traded in the last 24h?”
---
#### 5. **Global Metrics**
- **Endpoint**: `/v1/global-metrics/quotes/latest`
- **Purpose**: Global crypto market stats.
- **Supported Inputs**:
- *(None required)*
- **Use Cases**:
- “What’s the total crypto market cap?”
- “How dominant is Bitcoin?”
---
#### 6. **Price Conversion**
- **Endpoint**: `/v1/tools/price-conversion`
- **Purpose**: Convert one crypto/fiat into another.
- **Supported Inputs**:
- `amount` – (Required) Numerical amount to convert
- `symbol` – (Required) The crypto to convert from
- `convert` – (Required) The target currency (e.g., BTC, USD)
- **Use Cases**:
- “Convert 5 ETH to USD.”
- “What’s 1000 DOGE in BTC?”
"
},
"promptType": "define"
},
"typeVersion": 1.8
},
{
"id": "52e42df6-6b67-45d6-80a0-5361259a9d8f",
"name": "Crypto Agent Brain",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-300,
520
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "yUizd8t0sD5wMYVG",
"name": "OpenAi account"
}
},
"typeVersion": 1.2
},
{
"id": "8387d236-2e94-48de-b5b9-0838762440f9",
"name": "Crypto Agent Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-120,
520
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "a48f47a0-9bef-412c-91b8-df57ce3dba12",
"name": "CoinMarketCap Price",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
600,
520
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "symbol"
},
{
"name": "convert"
}
]
},
"toolDescription": "The tool going to recieve input of cryptocurrency name and then request the price from CoinMarketCap and send the price back in a message.",
"parametersHeaders": {
"values": [
{
"name": "Accept",
"value": "application/json",
"valueProvider": "fieldValue"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "d5d5e847-efbc-41cd-b581-095eb3825bfd",
"name": "Crypto Map",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
60,
520
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v1/cryptocurrency/map",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "symbol",
"valueProvider": "modelOptional"
},
{
"name": "listing_status",
"valueProvider": "modelOptional"
},
{
"name": "start",
"valueProvider": "modelOptional"
},
{
"name": "limit",
"valueProvider": "modelOptional"
}
]
},
"toolDescription": "Get a map of all cryptocurrencies with CoinMarketCap ID, name, and symbol.",
"parametersHeaders": {
"values": [
{
"name": "Accept"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "ac224086-1243-4dcb-85eb-dbf59fc927ac",
"name": "Crypto Info",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
240,
520
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v2/cryptocurrency/info",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "symbol"
}
]
},
"toolDescription": "Get metadata for one or more cryptocurrencies including logo, description, and links.
",
"parametersHeaders": {
"values": [
{
"name": "Accept"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "b261f3ed-a1dc-4dd0-bc63-31e77041bb01",
"name": "Crypto Listings",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
420,
520
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "start"
},
{
"name": "limit"
},
{
"name": "convert"
}
]
},
"toolDescription": "Retrieve a ranked list of cryptocurrencies sorted by market cap. Supports pagination and conversion currency.",
"parametersHeaders": {
"values": [
{
"name": "Accept"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "cfa6badf-0eed-4b37-bb1d-2ffcd39a23fc",
"name": "Global Metrics",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
800,
520
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v1/global-metrics/quotes/latest",
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "Returns global crypto market metrics including market cap, 24h volume, BTC dominance, and total active cryptocurrencies.",
"parametersHeaders": {
"values": [
{
"name": "Accept"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "ca40fc60-8cdd-48ec-98ba-63259582a16e",
"name": "Price Conversion",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1000,
520
],
"parameters": {
"url": "https://pro-api.coinmarketcap.com/v1/tools/price-conversion",
"sendQuery": true,
"sendHeaders": true,
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"parametersQuery": {
"values": [
{
"name": "amount"
},
{
"name": "symbol"
},
{
"name": "convert"
}
]
},
"toolDescription": "Convert cryptocurrency or fiat value from one currency to another.",
"parametersHeaders": {
"values": [
{
"name": "Accept"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"id": "OKXROn8aWkgAOvvV",
"name": "CoinMarketCap Standard"
}
},
"typeVersion": 1.1
},
{
"id": "360bb74c-0ca6-4cd7-95ab-7f14a2c89e6c",
"name": "Crypto Agent Guide",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1140,
-760
],
"parameters": {
"width": 840,
"height": 840,
"content": "# 🧠 CoinMarketCap_Crypto_Agent_Tool Guide
This agent is part of the modular **CoinMarketCap AI Analyst** system in **n8n**, focused on **cryptocurrency-level queries** such as price, supply, metadata, rankings, and conversions.
## 🔌 Endpoints Supported:
1. `/v1/cryptocurrency/map` – Get IDs, symbols, names
2. `/v2/cryptocurrency/info` – Get metadata, logos, whitepapers
3. `/v1/cryptocurrency/listings/latest` – Market rankings by cap
4. `/v2/cryptocurrency/quotes/latest` – Price, volume, and supply
5. `/v1/global-metrics/quotes/latest` – Total market cap, BTC dominance
6. `/v1/tools/price-conversion` – Fiat and crypto conversions
## 🧠 Node Overview:
- **🧠 Brain**: `GPT-4o Mini`
- **💾 Memory**: Session context buffer
- **⚙️ Tools**: 6 live API endpoints
## ⚙️ Required Inputs:
- `message` – User query
- `sessionId` – Used to preserve memory between calls
## 📝 Tip:
Use descriptive prompts like:
- “What is the CoinMarketCap ID for ETH?”
- “Convert 1000 DOGE to BTC.”
- “Show top 10 tokens by market cap.”"
},
"typeVersion": 1
},
{
"id": "f2f24886-4157-40f5-9731-dea431fb6cb8",
"name": "Usage & Examples",
"type": "n8n-nodes-base.stickyNote",
"position": [
-120,
-760
],
"parameters": {
"color": 5,
"width": 720,
"height": 900,
"content": "## 📌 Usage Instructions
### ✅ Step 1: Provide Inputs
Use `symbol`, `amount`, `convert`, `start`, `limit` where needed.
### ✅ Step 2: Trigger from Supervisor
Supervisor AI sends the message and sessionId to this agent.
### ✅ Step 3: Review Output
Returns raw JSON or formatted insights.
---
## 🔍 Sample Prompts
### 1️⃣ Convert 5 ETH to USD
```plaintext
GET /v1/tools/price-conversion?amount=5&symbol=ETH&convert=USD
```
### 2️⃣ Get CoinMarketCap ID of SHIB
```plaintext
GET /v1/cryptocurrency/map?symbol=SHIB
```
### 3️⃣ View total market cap
```plaintext
GET /v1/global-metrics/quotes/latest
```
### 4️⃣ Top 5 coins in EUR
```plaintext
GET /v1/cryptocurrency/listings/latest?limit=5&convert=EUR
```"
},
"typeVersion": 1
},
{
"id": "06d501a6-8730-4093-a145-53fd9378fa8e",
"name": "Errors & Licensing",
"type": "n8n-nodes-base.stickyNote",
"position": [
780,
-760
],
"parameters": {
"color": 3,
"width": 600,
"height": 560,
"content": "## ⚠️ API Errors & Troubleshooting
| Code | Message |
|------|---------|
| 200 | OK ✅ |
| 400 | Bad Request – Check inputs |
| 401 | Unauthorized – Invalid/missing API key |
| 429 | Rate limit exceeded – Slow down |
| 500 | CoinMarketCap server issue |
### ✅ Tips:
- Double check symbols and convert params
- Use `start`, `limit`, `convert` for pagination
- Add delay to avoid 429 rate limits
---
## 🛠️ Need Help?
🔗 [Don Jayamaha – LinkedIn](https://linkedin.com/in/donjayamahajr)
© 2025 Treasurium Capital Limited Company. All rights reserved.
This AI workflow architecture, including logic, design, and prompt structures, is the intellectual property of Treasurium Capital Limited Company. Unauthorized reproduction, redistribution, or resale is prohibited under U.S. copyright law. Licensed use only."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "a6a08338-6720-4a3a-bf3b-ed9559257b10",
"connections": {
"Crypto Map": {
"ai_tool": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Crypto Info": {
"ai_tool": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Global Metrics": {
"ai_tool": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Crypto Listings": {
"ai_tool": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Price Conversion": {
"ai_tool": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Crypto Agent Brain": {
"ai_languageModel": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"CoinMarketCap Price": {
"ai_tool": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Crypto Agent Memory": {
"ai_memory": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"When Executed by Another Workflow": {
"main": [
[
{
"node": "CoinMarketCap Crypto Agent",
"type": "main",
"index": 0
}
]
]
}
}
}
功能特点
- 自动检测新邮件
- AI智能内容分析
- 自定义分类规则
- 批量处理能力
- 详细的处理日志
技术分析
节点类型及作用
- Executeworkflowtrigger
- @N8N/N8N Nodes Langchain.Agent
- @N8N/N8N Nodes Langchain.Lmchatopenai
- @N8N/N8N Nodes Langchain.Memorybufferwindow
- @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错误记录和告警
- 处理失败邮件的隔离机制
- 异常情况下的回滚操作