N8N 102 課程卡關大問題

{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
-512,
208
],
“id”: “c94cabc3-98bb-414a-9f7a-57d043c3a748”,
“name”: “TriggerManual”
},
{
“parameters”: {
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n102/orders”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “4bc05b1b9cc576b8cd6cd3cccc29a8da”
}
]
},
“options”: {
“pagination”: {
“pagination”: {
“parameters”: {
“parameters”: [
{
“name”: “page”,
“value”: “={{ $pageCount + 1 }}”
}
]
}
}
}
}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.4,
“position”: [
-288,
112
],
“id”: “40e35e92-29c4-4b0b-b670-79d3ede50dd5”,
“name”: “GetOrders”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “vMHAPkPKaravjcEZ”,
“name”: “n8n Academy API Key”
}
}
},
{
“parameters”: {
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n102/customers”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “4bc05b1b9cc576b8cd6cd3cccc29a8da”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.4,
“position”: [
-288,
304
],
“id”: “3fad8be8-4433-49ec-8bad-bfc781e676ba”,
“name”: “GetCustomers”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “vMHAPkPKaravjcEZ”,
“name”: “n8n Academy API Key”
}
}
},
{
“parameters”: {
“mode”: “combine”,
“fieldsToMatchString”: “customer_id”,
“joinMode”: “enrichInput1”,
“options”: {}
},
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 3.2,
“position”: [
-64,
208
],
“id”: “fc2ed990-2d94-4a4b-aed3-79ed3688e53c”,
“name”: “MergeOrdersCustomers”
},
{
“parameters”: {
“aggregate”: “aggregateAllItemData”,
“destinationFieldName”: “enriched_orders”,
“options”: {}
},
“type”: “n8n-nodes-base.aggregate”,
“typeVersion”: 1,
“position”: [
160,
-16
],
“id”: “a1934843-0eaa-4990-8a3f-12fa0f60c4bd”,
“name”: “AggregateOrders”
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n102/orders-queue”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “4bc05b1b9cc576b8cd6cd3cccc29a8da”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “enriched_orders”,
“value”: “={{ $json.enriched_orders }}”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.4,
“position”: [
384,
-16
],
“id”: “0cf07ce8-68ad-4fec-bdd5-9e3e593795d6”,
“name”: “SendToOrdersQueue”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “vMHAPkPKaravjcEZ”,
“name”: “n8n Academy API Key”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “92dde10e-a0ac-4901-985e-6a0e8a1963e4”,
“leftValue”: “={{ $json.subscription }}”,
“rightValue”: “Enterprise”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
160,
304
],
“id”: “cec1001d-a5b4-4e84-9470-06d40d4f90b4”,
“name”: “CheckSubscriptionTier”
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“leftValue”: “={{ $json.region }}”,
“rightValue”: “north”,
“operator”: {
“type”: “string”,
“operation”: “equals”
},
“id”: “9585e06c-4bf6-4422-b8d9-c65c8aa315ad”
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “North”
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “4002a616-dbfd-4991-a1e0-72c888ac3bd9”,
“leftValue”: “={{ $json.region }}”,
“rightValue”: “south”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “South”
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “9f1f69c9-19bc-4738-a1e2-7cc2be1ba95f”,
“leftValue”: “={{ $json.region }}”,
“rightValue”: “e”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “East”
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “6a7b5b7f-1a45-4b11-9efb-5b3b7cbe7e76”,
“leftValue”: “={{ $json.region }}”,
“rightValue”: “west”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “West”
}
]
},
“options”: {
“fallbackOutput”: “extra”
}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.4,
“position”: [
384,
368
],
“id”: “4cca393c-d01e-4552-a4c4-60f20c5d9a76”,
“name”: “RouteByRegion”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “6f605cb6-29ce-47ad-adc2-ae26af637db2”,
“leftValue”: “={{ $json.status }}”,
“rightValue”: “delivered”,
“operator”: {
“type”: “string”,
“operation”: “notEquals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.filter”,
“typeVersion”: 2.3,
“position”: [
384,
176
],
“id”: “cbeb6ae5-04d7-42bb-b562-a7dc31997144”,
“name”: “FilterDelivered”
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://learn.app.n8n.cloud/webhook/course/n8n102/priority-queue”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpHeaderAuth”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “X-Assessment-ID”,
“value”: “4bc05b1b9cc576b8cd6cd3cccc29a8da”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “order_id”,
“value”: “={{ $json.order_id }}”
},
{
“name”: “customer_id”,
“value”: “={{ $json.customer_id }}”
},
{
“name”: “company_name”,
“value”: “={{ $json.customer_name }}”
},
{
“name”: “subscription”,
“value”: “={{ $json.subscription }}”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.4,
“position”: [
704,
176
],
“id”: “648920ef-df9c-41ad-a978-70b082ce97d9”,
“name”: “SendToPriorityQueue”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “vMHAPkPKaravjcEZ”,
“name”: “n8n Academy API Key”
}
}
}
],
“connections”: {
“TriggerManual”: {
“main”: [
[
{
“node”: “GetOrders”,
“type”: “main”,
“index”: 0
},
{
“node”: “GetCustomers”,
“type”: “main”,
“index”: 0
}
]
]
},
“GetOrders”: {
“main”: [
[
{
“node”: “MergeOrdersCustomers”,
“type”: “main”,
“index”: 0
}
]
]
},
“GetCustomers”: {
“main”: [
[
{
“node”: “MergeOrdersCustomers”,
“type”: “main”,
“index”: 1
}
]
]
},
“MergeOrdersCustomers”: {
“main”: [
[
{
“node”: “AggregateOrders”,
“type”: “main”,
“index”: 0
},
{
“node”: “CheckSubscriptionTier”,
“type”: “main”,
“index”: 0
}
]
]
},
“AggregateOrders”: {
“main”: [
[
{
“node”: “SendToOrdersQueue”,
“type”: “main”,
“index”: 0
}
]
]
},
“SendToOrdersQueue”: {
“main”: [

]
},
“CheckSubscriptionTier”: {
“main”: [
[
{
“node”: “FilterDelivered”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “RouteByRegion”,
“type”: “main”,
“index”: 0
}
]
]
},
“FilterDelivered”: {
“main”: [
[
{
“node”: “SendToPriorityQueue”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“instanceId”: “1b202188b62737e64678f469a8e86b98e8d2c2147255e95f1e4af4dc019b5e9d”
}
}

@Usman_Waheed 工作流程在這裡匯入沒有問題,所以我需要知道具體是什麼在破壞,哪個節點會拋出錯誤以及它顯示的確切錯誤訊息。如果是其中一個佇列步驟(SendToOrdersQueue / SendToPriorityQueue),請貼上該節點返回的內容,我會將其釘住。

以下是有問題的節點輸出:SendToPriorityQueue

{
“errorMessage”: “您的請求無效或無法由服務處理”,
“errorDescription”: “無效的 order_id。請確保您傳送的是正確的 order_id”,
“errorDetails”: {
“rawErrorMessage”: [
“422 - “{\“error\”:\“無效的 order_id。請確保您傳送的是正確的 order_id\”}””
],
“httpCode”: “422”
},
“n8nDetails”: {
“nodeName”: “SendToPriorityQueue”,
“nodeType”: “n8n-nodes-base.httpRequest”,
“nodeVersion”: 4.4,
“itemIndex”: 0,
“time”: “6/26/2026, 5:47:45 PM”,
“n8nVersion”: “2.22.5 (Self Hosted)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“NodeApiError: 您的請求無效或無法由服務處理”,
" at ExecuteContext.execute (C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\HttpRequest\V3\HttpRequestV3.node.ts:849:16)“,
" at WorkflowExecute.executeNode (C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1053:9)”,
" at WorkflowExecute.runNode (C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1327:11)“,
" at C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1778:27”,
" at C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:2426:11"
]
}
}

@Usman_Waheed 好的,我看到你的 json 中有它,SendToPriorityQueue 將 order_id 映射到 {{ $json.order_id }},但在該節點處該欄位幾乎肯定會解析為空,這正是 422 的含義。打開該節點並檢查輸入面板,orders 端點可能會以不同名稱返回 id(通常只是 id,不是 order_id)或合併重命名了它。將 order_id 重新映射到它在那裡實際顯示的內容,就會通過。

No it is fine, see this image

@Usman_Waheed 是啊你說得沒錯,order_id 是沒問題的(ORD-005)。不過看一下上一行,status 是「pending」,但那筆項目是經過 FilterDelivered 過來的,所以過濾器根本沒在過濾,delivered-only 的佇列收到了 pending 訂單,然後 API 就因為無效而拒絕了。檢查一下 FilterDelivered 的條件,它應該只讓 status = delivered 通過。修好這個,ORD-005 這樣的 pending 訂單就不會被送出去了。

我正確地按照教程進行操作,它要求我遵循以下步驟,我甚至從頭開始重新開始,但教程似乎不正確

新增篩選節點

  1. 將其重新命名為 FilterDelivered
  2. 設定條件:
    • 值 1: {{ $json.status }}
    • 操作: is not equal to
    • 值 2: delivered
  3. 執行篩選節點,查看你有 12 個項目而不是 20 個輸入項目
  4. 新增一個HTTP 要求節點,連接到 FilterDelivered 節點
  5. 將其重新命名為 SendToPriorityQueue

@Usman_Waheed 你說得對,教程在這裡出錯了。「不等於已交付」保留了 12 筆未交付的訂單(待處理的訂單)並將其發送到隊列,所以它拒絕了它們作為無效。將條件翻轉到「等於已交付」,那麼只有 8 筆已交付的訂單會通過,422 錯誤就會清除。說明書只是把它反轉了。

顯示 8 個項目進入 Sendpriorityqueue 節點,但我似乎無法通過這個階段,因為在我執行整個工作流程後錯誤始終未被修復。我甚至詢問了 Gemini,但它無法提供適當的修復方案。我已經在今天浪費了整天時間來通過這個問題,這導致課程進度卡住了。

以下是現在的錯誤

來自 HTTP 請求

錯誤代碼

422

完整訊息

422 - "{\"error\":\"Invalid order_id. Please ensure you are sending the correct order_id\"}"

請求

{ "body": { "order_id": "ORD-018", "customer_id": "CUST-007", "company_name": "Summit Enterprises", "subscription": "Enterprise" }, "headers": { "x-assessment-id": "4bc05b1b9cc576b8cd6cd3cccc29a8da", "**hidden**": "**hidden**", "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" }, "method": "POST", "uri": "https://learn.app.n8n.cloud/webhook/course/n8n102/priority-queue", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "sendCredentialsOnCrossOriginRedirect": false, "followAllRedirects": true, "timeout": 300000, "encoding": null, "json": false, "useStream": true }
其他資訊

項目索引

0

節點類型

n8n-nodes-base.httpRequest

節點版本

4.4 (Latest)

n8n 版本

2.22.5 (Self Hosted)

時間

6/26/2026, 6:11:40 PM

堆疊追蹤

NodeApiError: Your request is invalid or could not be processed by the service at ExecuteContext.execute (C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\HttpRequest\V3\HttpRequestV3.node.ts:849:16) at WorkflowExecute.executeNode (C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1053:9) at WorkflowExecute.runNode (C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1327:11) at C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\execution-engine\workflow-execute.ts:1778:27 at C:\Users\Usman\AppData\Roaming\npm\node_modules\n8n\node_mod

@Usman_Waheed 好的,重要的是,既然已交付的訂單 (ORD-018) 也出現相同的 422 錯誤,那就不是狀態篩選器的問題,而是拒絕所有訂單,所以問題出在請求的發送方式,而不是哪些訂單。你的轉存顯示 json: false,所以請求本體可能不是以 application/json 格式發送,請檢查該節點上的「Body Content Type = JSON」,或者切換 Body 為 raw 並直接貼上 JSON。如果這樣還是無法解決,有好幾個人卡在這個確切的步驟,所以可能是已知的練習題錯誤,值得在學院更正討論串上反映。

Gemini 也提出過同樣的建議來解決,但結果只是將錯誤改成其他錯誤,或者回到原始錯誤。有沒有辦法繞過這個問題,好讓我能進行到下一步並完成課程?另外,請告訴我確切應該在哪裡回報此問題,並附上螢幕截圖/JSON 代碼?

@Usman_Waheed 深入研究了這個問題,你的設定實際上是正確的,URL 是正確的 n8n102 位址,order_id 也能正確解析(ORD-018),而且 422 錯誤同時出現在已交付和待處理的訂單上,所以不是你的篩選條件或資料對應出了問題,而是 priority-queue 端點本身在拒絕有效的 order_id。還有其他人也卡在這個確切的步驟上,沒有可行的修復方案,所以這是學院端的問題,不是你做錯了什麼。上手教學不應該硬卡關課程,你應該能夠繼續進行,值得在 n8n-academy 論壇上回報這個問題,團隊正在修復第 2 節的其他漏洞。