أكاديمية N8N، مشكلة في الطلبات

Describe the problem/error/question

I reach this stage: Hands-on Exercise: Building an API Integration Pipeline Step 2.5: Send enterprise orders to priority queue. After execute the entire workflow, below error came out.

What is the error message (if any)?

Your request is invalid or could not be processed by the service [item 0]

Invalid order_id. Please ensure you are sending the correct order_id

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
{
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -32,
        112
      ],
      "id": "fee606ca-797e-47d8-af47-b655ffdc8fe1",
      "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": "1d6f2263fd81b44480a5486782c87be0"
            }
          ]
        },
        "options": {
          "pagination": {
            "pagination": {
              "parameters": {
                "parameters": [
                  {
                    "name": "page",
                    "value": "={{ $pageCount + 1 }}"
                  }
                ]
              }
            }
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        208,
        0
      ],
      "id": "f46e1a0c-072f-487b-ae64-de7188cb4bc4",
      "name": "GetOrders",
      "credentials": {
        "httpHeaderAuth": {
          "id": "IZ1z1MYLBwpoKx2J",
          "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": "1d6f2263fd81b44480a5486782c87be0"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        208,
        224
      ],
      "id": "7e000a51-f7f0-4e57-b93b-8f858f077833",
      "name": "GetCustomers",
      "credentials": {
        "httpHeaderAuth": {
          "id": "IZ1z1MYLBwpoKx2J",
          "name": "n8n Academy API Key"
        }
      }
    },
    {
      "parameters": {
        "mode": "combine",
        "fieldsToMatchString": "customer_id",
        "joinMode": "enrichInput1",
        "options": {}
      },
      "type": "n8n-nodes-base.merge",
      "typeVersion": 3.2,
      "position": [
        432,
        112
      ],
      "id": "c09f91fd-fd86-414e-a24f-5e56aa38d9c2",
      "name": "MergeOrdersCustomers"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "destinationFieldName": "enriched_orders",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        640,
        112
      ],
      "id": "47ffb582-3bbc-40af-97af-d8c4546c2d6e",
      "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": "1d6f2263fd81b44480a5486782c87be0"
            }
          ]
        },
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "enriched_orders",
              "value": "={{ $json.enriched_orders }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        880,
        112
      ],
      "id": "d80c1831-d69a-42da-bc3a-7e646393475d",
      "name": "SendToOrdersQueue",
      "credentials": {
        "httpHeaderAuth": {
          "id": "IZ1z1MYLBwpoKx2J",
          "name": "n8n Academy API Key"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "d9ae70e7-274b-47c6-a87d-5469702d4b8a",
              "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": [
        624,
        336
      ],
      "id": "1c1e831c-ebb1-45d9-b560-acfea9bc2cbf",
      "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": "13963a78-1120-4e9e-bcc2-6485b63107ab"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "North"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 3
                },
                "conditions": [
                  {
                    "id": "ff9f6d08-d005-416f-8e0f-8460d894a709",
                    "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": "cfa065fc-5a61-40b9-a7b9-6a348dcdbd75",
                    "leftValue": "={{ $json.region }}",
                    "rightValue": "east",
                    "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": "b1a239e1-bbe9-4f6e-b986-533415c4a262",
                    "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": [
        832,
        432
      ],
      "id": "e2ecffd6-dcd7-4625-9abd-8400e0fd75a2",
      "name": "RouteByRegion"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 3
          },
          "conditions": [
            {
              "id": "1a49d28e-2cf9-4ea4-a355-c85a6f146ae0",
              "leftValue": "={{ $json.status }}",
              "rightValue": "delivered",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.filter",
      "typeVersion": 2.3,
      "position": [
        1120,
        320
      ],
      "id": "606971a9-c796-4cb8-8ffc-af10dfbce473",
      "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": "1d6f2263fd81b44480a5486782c87be0"
            }
          ]
        },
        "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": [
        1328,
        320
      ],
      "id": "02e77179-3856-4454-88dc-c391ae6ebcde",
      "name": "SendToPriorityQueue",
      "credentials": {
        "httpHeaderAuth": {
          "id": "IZ1z1MYLBwpoKx2J",
          "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": "bed2988fb684ee16b2cfbdee45dcd5e341307ecfd375cd84c432f4ed9cece2d3"
  }
}

Share the output returned by the last node

Error code

422

Full message

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

Request

{ "body": { "order_id": "ORD-037", "customer_id": "CUST-007", "company_name": "Summit Enterprises", "subscription": "Enterprise" }, "headers": { "x-assessment-id": "1d6f2263fd81b44480a5486782c87be0", "**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 }

Information on your n8n setup

    1. n8n version: 2.15.0
    2. Database: SQLite (default)
    3. EXECUTIONS_PROCESS setting: main
    4. Running n8n via: Docker (on Zeabur)
    5. Operating system: Linux (Ubuntu 24, Zeabur hosted)

أنا عالق في نفس الخطأ، لول. كيفية حل هذا؟

لدي نفس المشكلة بالضبط

هل حللت المشكلة؟ أنا عالق بنفس الخطأ

@nicknock @evanmoo @Vonn_Villasor هذا عطل يواجهه الكثيرون

@jamiemadden_n8n

السلام عليكم،

يرجى التحقق مرة أخرى من أن المعاملات لا تحتوي على أي مسافات قبل أو بعد اسم المتغير. قد يكون من الصعب ملاحظة ذلك في واجهة المستخدم.

في الختام،

تفقدت مرتين وأعدت إنشاء سير العمل بالكامل مرتين على كل من السحابة والخادم المستضاف ذاتيًا. وهو يرجع نفس الخطأ على طلب POST لهذه العقدة المحددة. تماماً كما في دليل الأكاديمية، لكن الخادم الخلفي يرجع رسالة خطأ Invalid order_id.

نفس المشكلتين هنا على N8N102 (عالق حاليًا عند 63٪، أحتاج إلى 70٪ للحصول على الشهادة):slight_smile:

  1. القسم 1 priority-queue هو الخلل الذي ذكره @achamm. يعيد 422 “Invalid order_id” لكل طلب enterprise. اختبرت مباشرة مقابل نقطة النهاية وأكدت: order_id حقيقي، واحد وهمي، وسلسلة فارغة — كلهم يعيدون خطأ “Invalid order_id” متطابق — لذا تبدو مجموعة التحقق فارغة لتقييمي. order_id من /orders نظيف (بدون مسافات بيضاء)، لذا لا ينطبق حل “المسافات الإضافية” هنا. orders-queue يعمل بشكل صحيح (orders_queued: 50). هذا يحجب كلا من تقييمات Priority Orders Queue و Finalization.

  2. القسم 2 (Webhooks) Hands-on الخاص بي يعمل بنجاح كامل — جميع التقييمات الأربعة تظهر 1.0/1.0 على صفحة التمرين (Secure Webhook و Data Storage و Order Processing و Processing Pipeline؛ “All Tests Passed”). لكنه لا يحسب ضمن درجتي: على صفحة التقدم لا تزال درجة “n8n Workflow” بنسبة 33.33٪ (القسم 1 فقط) والقسم 2 لا يظهر ضمن Graded Scores. يبدو أنها مشكلة مزامنة دفتر الدرجات.

معرّف التقييم: 34513bee…982bf9 (المعرّف الكامل متوفر عند الطلب). هل يمكن للفريق إصلاح نقطة نهاية priority-queue و/أو مزامنة درجة القسم 2؟ شكرًا!

Hey everyone,

I am experiencing the same bug on Step 2.5 of the N8N102 course that others have mentioned recently.

My SendToPriorityQueue node is throwing a 422 - "Invalid order_id" error, even though the order ID being sent is valid (e.g., ORD-005).

I have verified my workflow setup:

  • Data mapping is correct (={{ $json.order_id }}).
  • The BatchPriorityOrders loop is properly closed.
  • Batch size is correctly set to 5.

Here are screenshots showing the error:

And here is my workflow code for reference:

@jamiemadden_n8n @testn8n_Santiago
Thanks @jamiemadden_n8n and the team for looking into this bug.

مرحباً،

لقد عثرت على الخطأ، وقد تم إصلاحه. يرجى المحاولة مجدداً!

مع أطيب التحيات،