描述問題/錯誤/問題
在向 n8n 網站發送訂單時,我收到以下錯誤。我檢查了空格、計算等,但找不到錯誤源。當我的所有節點單獨執行時都能完美執行
錯誤訊息是什麼(如果有的話)?您的請求無效或服務無法處理。 您的訂單總額不正確。請確保您正確計算了總額。
請分享您的工作流程
{
"nodes": [
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "6e58682d-4337-46a8-a36f-a6047502bfe7",
"name": "order_id",
"value": "={{ $json.order_id }}",
"type": "string"
},
{
"id": "2a009df0-7d77-43e6-9e91-a70e004bb17f",
"name": "customer_name",
"value": "={{ $json.customer_name }}",
"type": "string"
},
{
"id": "c36c31fc-c9a7-4dcb-8002-c7434369ea78",
"name": "region",
"value": "={{ $json.region }}",
"type": "string"
},
{
"id": "a6ad9769-cf53-4e2d-b27f-8869ec1506d3",
"name": "status",
"value": "={{ $json.status }}",
"type": "string"
},
{
"id": "ea21f188-1793-4fbc-80b4-14d080492695",
"name": "order_total",
"value": "={{Math.round($json.quantity * $json.unit_price)}}",
"type": "number"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
16,
-112
],
"id": "e5206f2a-e49f-4f97-a253-f42bbdee3f20",
"name": "SetOrderTotals"
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"destinationFieldName": "orders",
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
608,
-320
],
"id": "f4a9b2b7-cbb5-4092-adae-82a31b6faadf",
"name": "AggregateOrders"
},
{
"parameters": {
"select": "channel",
"channelId": {
"__rl": true,
"value": "C0BEZ3AKS9E",
"mode": "list",
"cachedResultName": "test"
},
"text": "=\"銷售管道完成。已處理 50 筆訂單,38 筆已交付。\"\n\"北部訂單總額:\" {{ $json.region[0].average_order_total }}\n\"南部訂單總額:\" {{ $json.region[2].average_order_total }}\n\"西部訂單總額:\" {{ $json.region[1].average_order_total }}\n\"東部訂單總額:\" {{ $json.region[3].average_order_total }}",
"otherOptions": {}
},
"type": "n8n-nodes-base.slack",
"typeVersion": 2.5,
"position": [
816,
-416
],
"id": "27fbb4f2-ab2a-4977-bef1-5350b8a52c03",
"name": "SendToSlack",
"webhookId": "5a4cba28-edf6-40b0-b14f-d68952cccf47",
"credentials": {
"slackApi": {
"id": "JsMFdrKSTabhvlb7",
"name": "Slack 帳戶"
}
}
},
{
"parameters": {
"method": "POST",
"url": "https://learn.app.n8n.cloud/webhook/course/n8n101/process-orders",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [
{
"name": "x-assessment-id",
"value": "dcaececa5196aa91d2a41fc5b5b53ec8"
}
]
},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "orders",
"value": "={{ $json.orders }}"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
816,
-224
],
"id": "2a053049-1a4b-46f0-abf1-3787c72a1297",
"name": "SendOrders",
"credentials": {
"httpHeaderAuth": {
"id": "Ga9QOladMz18EL6I",
"name": "n8n 學院 API 金鑰"
}
}
},
{
"parameters": {
"fieldsToSummarize": {
"values": [
{
"aggregation": "sum",
"field": "order_total"
},
{
"field": "order_total"
},
{
"aggregation": "average",
"field": "order_total"
}
]
},
"fieldsToSplitBy": "region",
"options": {}
},
"type": "n8n-nodes-base.summarize",
"typeVersion": 1.1,
"position": [
208,
-320
],
"id": "91cd6ef5-16d0-4ea0-89a6-b5d2499b1681",
"name": "SummarizebyRegion"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "c271aab4-45e9-4cd8-bc1e-5fee1682718a",
"name": "sum_order_total",
"value": "={{ Math.round($json.sum_order_total *100)/100}}",
"type": "number"
},
{
"id": "8a43ca44-257c-4d5e-9240-396005282a88",
"name": "count_order_total",
"value": "={{ $json.count_order_total }}",
"type": "number"
},
{
"id": "4e9f85c6-ec6e-4a80-bd09-024fadd61c5f",
"name": "average_order_total",
"value": "={{ Math.round($json.average_order_total*100)/100 }}",
"type": "number"
}
]
},
"includeOtherFields": true,
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
416,
-320
],
"id": "ea9206a9-c0e7-4836-9194-9a07c0826961",
"name": "編輯欄位"
}
],
"connections": {
"SetOrderTotals": {
"main": [
[
{
"node": "SummarizebyRegion",
"type": "main",
"index": 0
}
]
]
},
"AggregateOrders": {
"main": [
[
{
"node": "SendToSlack",
"type": "main",
"index": 0
},
{
"node": "SendOrders",
"type": "main",
"index": 0
}
]
]
},
"SummarizebyRegion": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "AggregateOrders",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"templateCredsSetupCompleted": true,
"instanceId": "7134812ff1766ac00dec6d0b790eac6d9b713a9539f0e1c05a87cf2a2442a32d"
}
}
您的請求無效或服務無法處理
您的訂單總額不正確。請確保您正確計算了總額。
有關您的 n8n 設置的資訊
- n8n 版本:Community
- 資料庫(預設值:SQLite):
- n8n EXECUTIONS_PROCESS 設置(預設值:own, main):
- 運行 n8n 方式(Docker、npm、n8n cloud、桌面應用程式):
- 作業系統:Windows


