n8n-free-templates/Misc/api_stats_chart.json
2025-05-19 00:56:45 -05:00

365 lines
7.6 KiB
JSON

{
"name": "API Stats Chart",
"nodes": [
{
"parameters": {
"content": "Automated workflow: API Stats Chart",
"height": 530,
"width": 1100,
"color": 5
},
"id": "d6936124-41be-4586-a3b6-003216c47610",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-480,
-240
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "api-stats-chart"
},
"id": "03fca675-6256-4e85-928b-785d0b0ae848",
"name": "Webhook Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
-300,
0
]
},
{
"parameters": {
"chunkSize": 400,
"chunkOverlap": 40
},
"id": "47ef8ce5-0a2e-4eb9-a127-ce55a886cf1f",
"name": "Text Splitter",
"type": "@n8n/n8n-nodes-langchain.textSplitterCharacterTextSplitter",
"typeVersion": 1,
"position": [
-130,
0
]
},
{
"parameters": {
"model": "text-embedding-3-small",
"options": {}
},
"id": "2f994a01-b92a-45be-8d60-38c6f82e8ffd",
"name": "Embeddings",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"typeVersion": 1,
"position": [
70,
0
],
"credentials": {
"openAiApi": {
"id": "OPENAI_API",
"name": "OpenAI"
}
}
},
{
"parameters": {
"mode": "insert",
"options": {},
"pineconeIndex": {
"__rl": true,
"value": "api_stats_chart",
"mode": "list",
"cachedResultName": "api_stats_chart"
}
},
"id": "1c46d9b8-8847-460f-8bc5-fb4e4072a2f1",
"name": "Pinecone Insert",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"typeVersion": 1,
"position": [
270,
0
],
"credentials": {
"pineconeApi": {
"id": "PINECONE_API",
"name": "Pinecone account"
}
}
},
{
"parameters": {
"pineconeIndex": {
"__rl": true,
"value": "api_stats_chart",
"mode": "list",
"cachedResultName": "api_stats_chart"
}
},
"id": "4eeb7d21-d2aa-4e25-973c-5ae7e3ae8860",
"name": "Pinecone Query",
"type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
"typeVersion": 1,
"position": [
270,
-180
],
"credentials": {
"pineconeApi": {
"id": "PINECONE_API",
"name": "Pinecone account"
}
}
},
{
"parameters": {
"name": "Pinecone",
"description": "Vector context"
},
"id": "d3f2b2e4-729e-44df-ad1c-d7481e4a23af",
"name": "Vector Tool",
"type": "@n8n/n8n-nodes-langchain.toolVectorStore",
"typeVersion": 1,
"position": [
450,
-180
]
},
{
"parameters": {},
"id": "433f4d6b-23a5-44e6-8c5d-1d7f1ed6b8d3",
"name": "Window Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
450,
-40
]
},
{
"parameters": {
"options": {}
},
"id": "b531b066-c595-4ccd-9ba7-a228082bf9cc",
"name": "Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"typeVersion": 1,
"position": [
450,
-340
],
"credentials": {
"anthropicApi": {
"id": "ANTHROPIC_API",
"name": "Anthropic"
}
}
},
{
"parameters": {
"promptType": "define",
"text": "Process the following data for task 'API Stats Chart':\n\n{{ $json }}",
"options": {
"systemMessage": "You are an assistant for API Stats Chart"
}
},
"id": "9ed764eb-612c-4802-9932-741f73c2b86c",
"name": "RAG Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1,
"position": [
720,
-40
]
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "SHEET_ID",
"mode": "list",
"cachedResultName": "API Stats Chart"
},
"sheetName": {
"__rl": true,
"value": "Log",
"mode": "list",
"cachedResultName": "Log"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"Status": "={{$json[\"RAG Agent\"].text}}"
},
"schema": []
}
},
"id": "70b3720c-76bb-42d4-a28e-016be84c295e",
"name": "Append Sheet",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4,
"position": [
930,
-40
],
"credentials": {
"googleSheetsOAuth2Api": {
"id": "SHEETS_API",
"name": "Google Sheets account"
}
}
},
{
"parameters": {
"channel": "#alerts",
"text": "API Stats Chart error: {$json.error.message}"
},
"id": "e7e520aa-6969-416e-a6f4-8f9a593bac72",
"name": "Slack Alert",
"type": "n8n-nodes-base.slack",
"typeVersion": 1,
"position": [
930,
120
],
"credentials": {
"slackApi": {
"id": "SLACK_API",
"name": "Slack"
}
}
}
],
"connections": {
"Webhook Trigger": {
"main": [
[
{
"node": "Text Splitter",
"type": "main",
"index": 0
},
{
"node": "Window Memory",
"type": "main",
"index": 0
}
]
]
},
"Text Splitter": {
"main": [
[
{
"node": "Embeddings",
"type": "main",
"index": 0
}
]
],
"ai_textSplitter": [
[
{
"node": "Pinecone Insert",
"type": "ai_textSplitter",
"index": 0
}
]
]
},
"Embeddings": {
"ai_embedding": [
[
{
"node": "Pinecone Insert",
"type": "ai_embedding",
"index": 0
},
{
"node": "Pinecone Query",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Pinecone Insert": {
"ai_document": [
[]
]
},
"Pinecone Query": {
"ai_vectorStore": [
[
{
"node": "Vector Tool",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Vector Tool": {
"ai_tool": [
[
{
"node": "RAG Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Window Memory": {
"ai_memory": [
[
{
"node": "RAG Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"Chat Model": {
"ai_languageModel": [
[
{
"node": "RAG Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"RAG Agent": {
"main": [
[
{
"node": "Append Sheet",
"type": "main",
"index": 0
}
]
],
"onError": [
[
{
"node": "Slack Alert",
"type": "main",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"triggerCount": 1
}