يبدو أن المسار n8n102 مصمم لإرهاق المتعلمين، أولاً لأنه يحتوي على خطأ في القسم 1 في SendToPriorityQueue الذي لم يتم حله بعد، والآن جزء Webhook لا يمكن متابعته لأن صفحة الاختبار تتطلب https بينما يستخدم البرنامج التعليمي http، لذا застрял مجدداً بشكل كبير في بداية التمرين العملي. إليك لقطة الشاشة الخاصة بخطأ json/workflow:
{
“nodes”: [
{
“parameters”: {
“httpMethod”: “POST”,
“path”: “course/n8n102/new-order”,
“authentication”: “headerAuth”,
“responseMode”: “responseNode”,
“options”: {
“allowedOrigins”: “*”
}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2.1,
“position”: [
0,
0
],
“id”: “5b647ab0-18c4-41a4-bb01-62fddb40e0d7”,
“name”: “WebhookNewOrder”,
“webhookId”: “cb64f5fc-8c9c-4d7d-abb7-7f3ca5eb7305”,
“credentials”: {
“httpHeaderAuth”: {
“id”: “vMHAPkPKaravjcEZ”,
“name”: “n8n Academy API Key”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “dd887f0b-a710-4f6d-ae7b-4135da5667a8”,
“leftValue”: “={{ $json.body.order_id }}”,
“rightValue”: “”,
“operator”: {
“type”: “string”,
“operation”: “notEmpty”,
“singleValue”: true
}
},
{
“id”: “a7140c1e-23cc-4dba-9662-0059886cdb53”,
“leftValue”: “={{ $json.body.customer_id }}”,
“rightValue”: “”,
“operator”: {
“type”: “string”,
“operation”: “notEmpty”,
“singleValue”: true
}
},
{
“id”: “438dee60-5bcf-4002-927e-280813e11b18”,
“leftValue”: “={{ $json.body.total }}”,
“rightValue”: “”,
“operator”: {
“type”: “number”,
“operation”: “notEmpty”,
“singleValue”: true
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.3,
“position”: [
208,
0
],
“id”: “9fb45b77-fe7c-4240-848b-deadf5cf8bc7”,
“name”: “ValidateRequiredFields”
},
{
“parameters”: {
“respondWith”: “json”,
“responseBody”: “={\n "status": "accepted",\n "order_id": "{{ $(‘WebhookNewOrder’).item.json.body.order_id }}",\n "message": "تم استقبال الطلب وتم وضعه في قائمة الانتظار للمعالجة"\n}”,
“options”: {
“responseCode”: 200
}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.5,
“position”: [
416,
-96
],
“id”: “b945dafb-6e2f-461a-8534-414b735b7ab8”,
“name”: “RespondSuccess”
},
{
“parameters”: {
“respondWith”: “json”,
“responseBody”: “={\n "status": "error",\n "message": "حقول مفقودة: order_id و customer_id و total مطلوبة"\n}”,
“options”: {
“responseCode”: 400
}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.5,
“position”: [
416,
96
],
“id”: “b23fadc8-b731-444d-bc84-10cb1f7d9f38”,
“name”: “RespondValidationError”
}
],
“connections”: {
“WebhookNewOrder”: {
“main”: [
[
{
“node”: “ValidateRequiredFields”,
“type”: “main”,
“index”: 0
}
]
]
},
“ValidateRequiredFields”: {
“main”: [
[
{
“node”: “RespondSuccess”,
“type”: “main”,
“index”: 0
}
],
[
{
“node”: “RespondValidationError”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “1b202188b62737e64678f469a8e86b98e8d2c2147255e95f1e4af4dc019b5e9d”
}
}