Parece que el curso n8n102 está diseñado para hacer sufrir a los estudiantes. Primero, hay un error en la sección 1 en SendToPriorityQueue que aún no se ha resuelto, y ahora la parte de Webhook simplemente no se puede seguir porque la página de prueba requiere https mientras que el tutorial usa http. De nuevo atrapado en grande justo al inicio del ejercicio práctico. Aquí está la captura de pantalla del error de 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": "Order received and queued for processing"\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": "Missing required fields: order_id, customer_id, and total are required"\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”
}
}