AI活动与预算编排套件
这是一个Project Management, Multimodal AI领域的自动化工作流,包含 20 个节点。主要使用 Code, Merge, Slack, Webhook, EmailSend 等节点。 使用 Claude AI 和 Google Sheets 实现活动策划和预算优化自动化
- •Slack Bot Token 或 Webhook URL
- •HTTP Webhook 端点(n8n 会自动生成)
- •Google Sheets API 凭证
- •Anthropic API Key
{
"id": "KjnG4Wn0rWx8YM2N",
"meta": {
"instanceId": "dd69efaf8212c74ad206700d104739d3329588a6f3f8381a46a481f34c9cc281",
"templateCredsSetupCompleted": true
},
"name": "AI活动与预算编排套件",
"tags": [],
"nodes": [
{
"id": "a3da1a86-2036-4134-a947-6adc55068f04",
"name": "编排触发器",
"type": "n8n-nodes-base.webhook",
"position": [
-560,
584
],
"webhookId": "event-orchestrate-webhook",
"parameters": {
"path": "event-orchestrate",
"options": {},
"httpMethod": "POST"
},
"typeVersion": 2
},
{
"id": "65fa224a-7f5a-49d2-9ec6-5dd24dd86f50",
"name": "读取客户简报",
"type": "n8n-nodes-base.googleSheets",
"position": [
-336,
296
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "ClientBriefs"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.spreadsheetId || '1234567890abcdefghijklmnop' }}"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 4.5
},
{
"id": "3844dc0e-e84f-45ed-aa29-eb09ab4d7bcd",
"name": "读取预算估算",
"type": "n8n-nodes-base.googleSheets",
"position": [
-336,
488
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "BudgetEstimates"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.spreadsheetId || '1234567890abcdefghijklmnop' }}"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 4.5
},
{
"id": "6545f261-99a3-4ca1-90d8-f5d514dcd68d",
"name": "读取实际成本",
"type": "n8n-nodes-base.googleSheets",
"position": [
-336,
680
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "ActualCosts"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.spreadsheetId || '1234567890abcdefghijklmnop' }}"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 4.5
},
{
"id": "8c47bb9f-4969-4627-8888-bf64df202de8",
"name": "读取供应商数据库",
"type": "n8n-nodes-base.googleSheets",
"position": [
-336,
872
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "VendorDatabase"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.vendorSpreadsheetId || $json.spreadsheetId }}"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 4.5
},
{
"id": "23f81562-d7e7-45c7-8c52-d42750b1b68f",
"name": "融合所有数据",
"type": "n8n-nodes-base.merge",
"position": [
-112,
584
],
"parameters": {
"mode": "mergeByPosition"
},
"typeVersion": 3
},
{
"id": "c3ea1e44-1472-43e2-ac30-da2b19f17a6b",
"name": "数据融合引擎",
"type": "n8n-nodes-base.code",
"position": [
112,
584
],
"parameters": {
"jsCode": "const all = $input.all();\nconst brief = all.find(i => i.json.clientName)?.json || {};\nconst budgets = all.filter(i => i.json.budgetAmount !== undefined).map(i => i.json);\nconst actuals = all.filter(i => i.json.actualCost !== undefined).map(i => i.json);\nconst vendors = all.filter(i => i.json.vendorName).map(i => i.json);\n\n// Metadata\nconst meta = {\n eventId: brief.eventId || `EVT-${Date.now()}`,\n clientName: brief.clientName || 'Client',\n eventType: brief.eventType || 'Conference',\n attendees: parseInt(brief.attendees) || 150,\n targetBudget: parseFloat(brief.budget) || 75000,\n eventDate: brief.eventDate || 'TBD',\n plannerEmail: brief.plannerEmail || 'planner@company.com',\n spreadsheetId: brief.spreadsheetId || '1234567890abcdefghijklmnop',\n teamChannel: brief.teamChannel || '#event-orchestration',\n priority: brief.priority || 'Medium'\n};\n\n// Budget aggregation\nlet totalBudgeted = 0, totalEstimated = 0, totalActual = 0;\nconst categories = {};\n\nbudgets.forEach(b => {\n const cat = b.category || 'Other';\n const budgeted = parseFloat(b.budgetAmount || 0);\n const estimated = parseFloat(b.estimatedCost || 0);\n totalBudgeted += budgeted;\n totalEstimated += estimated;\n if (!categories[cat]) categories[cat] = { budgeted: 0, estimated: 0, actual: 0, items: [] };\n categories[cat].budgeted += budgeted;\n categories[cat].estimated += estimated;\n categories[cat].items.push(b);\n});\n\nactuals.forEach(a => {\n const cat = a.category || 'Other';\n const actual = parseFloat(a.actualCost || 0);\n totalActual += actual;\n if if (categories[cat]) categories[cat].actual += actual;\n});\n\nconst variance = totalBudgeted - totalEstimated;\nconst variancePct = totalBudgeted > 0 ? ((variance / totalBudgeted) * 100).toFixed(2) : 0;\n\nreturn {\n json: {\n ...meta,\n budgets, actuals, vendors,\n totalBudgeted: totalBudgeted.toFixed(2),\n totalEstimated: totalEstimated.toFixed(2),\n totalActual: totalActual.toFixed(2),\n variance: variance.toFixed(2),\n variancePct,\n overBudget: variance < 0,\n categories: Object.values(categories),\n validation: { errors: [], warnings: [] },\n timestamp: new Date().toISOString()\n }\n};"
},
"typeVersion": 2
},
{
"id": "033b6830-f7af-4a48-be42-02d4f568d5ab",
"name": "Claude AI核心",
"type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
"position": [
408,
808
],
"parameters": {
"model": "claude-3-5-sonnet-20241022",
"options": {
"temperature": 0.3
}
},
"credentials": {
"anthropicApi": {
"id": "fK55jZdb6CaYNukq",
"name": "Anthropic account - test"
}
},
"typeVersion": 1.1
},
{
"id": "874f36ce-4862-4f15-988c-a5eb08d21594",
"name": "AI编排引擎",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
336,
584
],
"parameters": {
"options": {
"systemMessage": "=You are an elite event orchestration strategist. Generate a complete event plan + budget optimization in JSON.\n\n**Client:** {{ $json.clientName }}\n**Event:** {{ $json.eventType }} | {{ $json.attendees }} guests | {{ $json.eventDate }}\n**Budget:** ${{ $json.totalBudgeted }} (Target: ${{ $json.targetBudget }}) | Variance: ${{ $json.variance }} ({{ $json.variancePct }}%)\n\n**Current Spend:** Estimated ${{ $json.totalEstimated }} | Actual ${{ $json.totalActual }}\n\n**Categories:** {{ $json.categories.map(c => `${c.category}: $${c.budgeted} → $${c.estimated}`).join(', ') }}\n\n**Vendors Available:** {{ $json.vendors.map(v => v.vendorName).join(', ') }}\n\n**Deliver JSON with:**\n- planSummary\n- optimizedTimeline (phases with dates)\n- optimizedBudgetBreakdown (category, current, recommended, savings)\n- taskList (task, owner, due, priority)\n- vendorRecommendations\n- riskAnalysis (risk, probability, impact, mitigation)\n- totalSavings, finalCost, roiImprovement\n- autoApproval: true/false"
}
},
"typeVersion": 2.2
},
{
"id": "5a91a3b7-02ac-49cf-9536-37dc72355e20",
"name": "解析与最终确定",
"type": "n8n-nodes-base.code",
"position": [
688,
584
],
"parameters": {
"jsCode": "const ai = $input.first().json.response || $input.first().json.text;\nconst base = $('Data Fusion Engine').first().json;\nlet plan; try { plan = JSON.parse(ai.match(/\\{[\\s\\S]*\\}/)[0]); } catch { plan = { planSummary: 'AI parse failed' }; }\n\nconst savings = (plan.optimizedBudgetBreakdown || []).reduce((s, c) => s + (c.savings || 0), 0);\nconst final = base.totalEstimated - savings;\nconst roi = ((savings / base.totalEstimated) * 100).toFixed(1);\nconst riskScore = (plan.riskAnalysis || []).reduce((s, r) => s + (r.probability === 'High' ? 3 : r.probability === 'Medium' ? 2 : 1) * (r.impact === 'High' ? 3 : 2 : 1), 0);\nconst riskLevel = riskScore > 12 ? 'High' : riskScore > 6 ? 'Medium' : 'Low';\nconst autoApprove = plan.autoApproval !== false && riskLevel !== 'High' && savings > 0;\n\nreturn { json: { ...base, ...plan, totalSavings: savings.toFixed(2), finalCost: final.toFixed(2), roiImprovement: roi, riskScore, riskLevel, autoApprove, orchestratedAt: new Date().toISOString() } };"
},
"typeVersion": 2
},
{
"id": "83fbc169-9531-4ba2-9abd-8bfb8367b9b2",
"name": "保存编排计划",
"type": "n8n-nodes-base.googleSheets",
"position": [
912,
392
],
"parameters": {
"columns": {
"value": {},
"schema": [],
"mappingMode": "autoMapInputData",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "name",
"value": "OrchestratedPlans"
},
"documentId": {
"__rl": true,
"mode": "id",
"value": "={{ $json.spreadsheetId }}"
},
"authentication": "serviceAccount"
},
"credentials": {
"googleApi": {
"id": "ScSS2KxGQULuPtdy",
"name": "Google Sheets- test"
}
},
"typeVersion": 4.5
},
{
"id": "3c2551b2-68ca-44c4-b60b-0c33b11c4f75",
"name": "团队同步",
"type": "n8n-nodes-base.slack",
"position": [
912,
584
],
"webhookId": "3e1216b9-e7dc-4123-87b9-6d5c20e2171d",
"parameters": {
"text": "=*{{ $json.eventId }}: {{ $json.clientName }} - {{ $json.eventType }}*\n\n*Status:* {{ $json.autoApprove ? 'AUTO-APPROVED' : 'REVIEW NEEDED' }}\n*Savings:* ${{ $json.totalSavings }} ({{ $json.roiImprovement }}% ROI)\n*Risk:* {{ $json.riskLevel }}\n\n{{ $json.autoApprove ? 'Proceeding to execution' : 'Team review required' }}\n\n[View Full Plan](https://docs.google.com/spreadsheets/d/{{ $json.spreadsheetId }})",
"select": "channel",
"channelId": "={{ $json.teamChannel }}",
"otherOptions": {}
},
"credentials": {
"slackApi": {
"id": "MQ0fgwuS8AzfwFvy",
"name": "Slack account - test "
}
},
"typeVersion": 2.2
},
{
"id": "0cb88543-7089-43e2-87d5-090da88bf447",
"name": "执行报告",
"type": "n8n-nodes-base.emailSend",
"position": [
912,
776
],
"webhookId": "49513419-b372-4ecc-88c0-c5c2612e429e",
"parameters": {
"options": {},
"subject": "={{ $json.autoApprove ? 'Approved' : 'Review' }}: {{ $json.eventId }} Plan & Budget",
"toEmail": "={{ $json.plannerEmail }}",
"fromEmail": "ai-orchestrator@company.com"
},
"credentials": {
"smtp": {
"id": "G1kyF8cSWTZ4vouN",
"name": "SMTP -test"
}
},
"typeVersion": 2.1
},
{
"id": "90e4cb72-7890-4f58-ab49-51702e273cc1",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-592,
352
],
"parameters": {
"width": 160,
"height": 480,
"content": "Webhook(POST /event-orchestrate)或每日早上7点计划"
},
"typeVersion": 1
},
{
"id": "f176b3a1-86c7-4d52-b928-3d64a7d7095d",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
80,
368
],
"parameters": {
"width": 160,
"height": 480,
"content": "汇总总计、计算差异、验证数据"
},
"typeVersion": 1
},
{
"id": "795cbb12-04b2-4540-a0b0-af0876ae2383",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
320,
368
],
"parameters": {
"width": 256,
"height": 480,
"content": "向Claude AI发送结构化提示"
},
"typeVersion": 1
},
{
"id": "523ede3a-588a-45f2-bff7-05fc4dd0e8d0",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-144,
384
],
"parameters": {
"width": 160,
"height": 480,
"content": "将所有源合并为统一数据集"
},
"typeVersion": 1
},
{
"id": "71f0b271-cb1e-4ead-92b9-76f86fffb7c2",
"name": "便签4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-368,
-48
],
"parameters": {
"width": 160,
"height": 1104,
"content": "从ClientBriefs表拉取活动元数据"
},
"typeVersion": 1
},
{
"id": "abad8a6f-7029-4d85-8015-e4f332dc61ac",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
656,
368
],
"parameters": {
"width": 160,
"height": 480,
"content": "提取JSON、计算节省、ROI、风险、设置自动批准"
},
"typeVersion": 1
},
{
"id": "d016d1ad-268d-4c5e-94c0-cba1694e883b",
"name": "便签6",
"type": "n8n-nodes-base.stickyNote",
"position": [
880,
80
],
"parameters": {
"width": 160,
"height": 848,
"content": "将完整计划+KPI写入OrchestratedPlans"
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "0ab79068-95e9-4212-ba5c-bd692eaf49dc",
"connections": {
"Fuse All Data": {
"main": [
[
{
"node": "Data Fusion Engine",
"type": "main",
"index": 0
}
]
]
},
"Claude AI Core": {
"ai_languageModel": [
[
{
"node": "AI Orchestration Engine",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Parse & Finalize": {
"main": [
[
{
"node": "Save Orchestrated Plan",
"type": "main",
"index": 0
},
{
"node": "Team Sync",
"type": "main",
"index": 0
},
{
"node": "Executive Report",
"type": "main",
"index": 0
}
]
]
},
"Read Actual Costs": {
"main": [
[
{
"node": "Fuse All Data",
"type": "main",
"index": 0
}
]
]
},
"Read Client Brief": {
"main": [
[
{
"node": "Fuse All Data",
"type": "main",
"index": 0
}
]
]
},
"Data Fusion Engine": {
"main": [
[
{
"node": "AI Orchestration Engine",
"type": "main",
"index": 0
}
]
]
},
"Orchestrate Trigger": {
"main": [
[
{
"node": "Read Client Brief",
"type": "main",
"index": 0
},
{
"node": "Read Budget Estimates",
"type": "main",
"index": 0
},
{
"node": "Read Actual Costs",
"type": "main",
"index": 0
},
{
"node": "Read Vendor Database",
"type": "main",
"index": 0
}
]
]
},
"Read Vendor Database": {
"main": [
[
{
"node": "Fuse All Data",
"type": "main",
"index": 1
}
]
]
},
"Read Budget Estimates": {
"main": [
[
{
"node": "Fuse All Data",
"type": "main",
"index": 1
}
]
]
},
"AI Orchestration Engine": {
"main": [
[
{
"node": "Parse & Finalize",
"type": "main",
"index": 0
}
]
]
}
}
}如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 项目管理, 多模态 AI
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
Oneclick AI Squad
@oneclick-aiThe AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.
分享此工作流