N101/Exercício prático: Construção de uma cadeia de dados de vendas/STEP 2/ERROR 422

Olá, sou novo no n8n e comecei a fazer os cursos de aprendizagem com n8nAcademy, começando pelo módulo n8n101.
Na prática da Seção 2, Building a Data Sales Pipeline, especificamente na etapa 2, no seu nó final, não estou obtendo uma resposta após a solicitação HTTP ‘post’. Na segunda captura de tela adicionei uma resposta ao body para que você veja a resposta ‘422’.
Revisei outras consultas relacionadas, mas não consigo resolver a resposta.
Agradeci se puderem me orientar.

Descreva o problema/erro/pergunta

Qual é a mensagem de erro (se houver)?

422 - “{\“error\”:\“orders are missing required fields: order_total\”}”

Compartilhe seu fluxo de trabalho

(

Selecione os nós na sua tela e use os atalhos de teclado CMD+C/CTRL+C e CMD+V/CTRL+V para copiar e colar o fluxo de trabalho.)

Compartilhe a saída retornada pelo último nó

{ “body”: { “orders”: [ { “order_id”: “ORD-001”, “customer_name”: “Acme Corp”, “region”: “north”, “status”: “delivered”, "order_total ": 598 }, { “order_id”: “ORD-002”, “customer_name”: “TechStart Inc”, “region”: “west”, “status”: “shipped”, "order_total ": 245 }, { “order_id”: “ORD-003”, “customer_name”: “Global Systems”, “region”: “south”, “status”: “processing”, "order_total ": 149 }, { “order_id”: “ORD-004”, “customer_name”: “Acme Corp”, “region”: “north”, “status”: “delivered”, "order_total ": 99 }, { “order_id”: “ORD-005”, “customer_name”: “DataFlow Ltd”, “region”: “east”, “status”: “pending”, "order_total ": 299 }, { “order_id”: “ORD-006”, “customer_name”: “CloudNine Solutions”, “region”: “west”, “status”: “shipped”, "order_total ": 447 }, { “order_id”: “ORD-007”, “customer_name”: “Bright Ideas Co”, “region”: “north”, “status”: “delivered”, "order_total ": 490 }, { “order_id”: “ORD-008”, “customer_name”: “Summit Enterprises”, “region”: “north”, “status”: “processing”, "order_total ": 1495 }, { “order_id”: “ORD-009”, “customer_name”: “TechStart Inc”, “region”: “west”, “status”: “delivered”, "order_total ": 79 }, { “order_id”: “ORD-010”, “customer_name”: “Innovate LLC”, “region”: “east”, “status”: “shipped”, "order_total ": 298 }, { “order_id”: “ORD-011”, “customer_name”: “Pioneer Tech”, “region”: “south”, “status”: “pending”, "order_total ": 49 }, { “order_id”: “ORD-012”, “customer_name”: “Nexus Industries”, “region”: “north”, “status”: “delivered”, "order_total ": 897 }, { “order_id”: “ORD-013”, “customer_name”: “Global Systems”, “region”: “south”, “status”: “shipped”, "order_total ": 99 }, { “order_id”: “ORD-014”, “customer_name”: “DataFlow Ltd”, “region”: “east”, “status”: “processing”, "order_total ": 149 }, { “order_id”: “ORD-015”, “customer_name”: “CloudNine Solutions”, “region”: “west”, “status”: “delivered”, "order_total ": 98 }, { “order_id”: “ORD-016”, “customer_name”: “Acme Corp”, “region”: “north”, “status”: “shipped”, "order_total ": 149 }, { “order_id”: “ORD-017”, “customer_name”: “Bright Ideas Co”, “region”: “south”, “status”: “pending”, "order_total ": 299 }, { “order_id”: “ORD-018”, “customer_name”: “Summit Enterprises”, “region”: “north”, “status”: “delivered”, "order_total ": 158 }, { “order_id”: “ORD-019”, “customer_name”: “Innovate LLC”, “region”: “east”, “status”: “shipped”, "order_total ": 196 }, { “order_id”: “ORD-020”, “customer_name”: “Pioneer Tech”, “region”: “south”, “status”: “processing”, "order_total ": 149 }, { “order_id”: “ORD-021”, “customer_name”: “Nexus Industries”, “region”: “north”, “status”: “delivered”, "order_total ": 294 }, { “order_id”: “ORD-022”, “customer_name”: “TechStart Inc”, “region”: “west”, “status”: “shipped”, "order_total ": 299 }, { “order_id”: “ORD-023”, “customer_name”: “Global Systems”, “region”: “south”, “status”: “pending”, "order_total ": 79 }, { “order_id”: “ORD-024”, “customer_name”: “DataFlow Ltd”, “region”: “east”, “status”: “delivered”, "order_total ": 147 }, { “order_id”: “ORD-025”, “customer_name”: “CloudNine Solutions”, “region”: “west”, “status”: “processing”, "order_total ": 598 }, { “order_id”: “ORD-026”, “customer_name”: “Bright Ideas Co”, “region”: “south”, “status”: “shipped”, "order_total ": 149 }, { “order_id”: “ORD-027”, “customer_name”: “Summit Enterprises”, “region”: “north”, “status”: “delivered”, "order_total ": 98 }, { “order_id”: “ORD-028”, “customer_name”: “Innovate LLC”, “region”: “east”, “status”: “pending”, "order_total ": 99 }, { “order_id”: “ORD-029”, “customer_name”: “Pioneer Tech”, “region”: “south”, “status”: “shipped”, "order_total ": 299 }, { “order_id”: “ORD-030”, “customer_name”: “Nexus Industries”, “region”: “north”, “status”: “delivered”, "order_total ": 298 }, { “order_id”: “ORD-031”, “customer_name”: “Acme Corp”, “region”: “north”, “status”: “processing”, "order_total ": 49 }, { “order_id”: “ORD-032”, “customer_name”: “TechStart Inc”, “region”: “west”, “status”: “shipped”, "order_total ": 298 }, { “order_id”: “ORD-033”, “customer_name”: “Global Systems”, “region”: “south”, “status”: “delivered”, "order_total ": 299 }, { “order_id”: “ORD-034”, “customer_name”: “DataFlow Ltd”, “region”: “east”, “status”: “pending”, "order_total ": 99 }, { “order_id”: “ORD-035”, “customer_name”: “CloudNine Solutions”, “region”: “west”, “status”: “shipped”, "order_total ": 245 }, { “order_id”: “ORD-036”, “customer_name”: “Bright Ideas Co”, “region”: “south”, “status”: “delivered”, "order_total ": 79 }, { “order_id”: “ORD-037”, “customer_name”: “Summit Enterprises”, “region”: “north”, “status”: “processing”, "order_total ": 149 }, { “order_id”: “ORD-038”, “customer_name”: “Innovate LLC”, “region”: “east”, “status”: “shipped”, "order_total ": 299 }, { “order_id”: “ORD-039”, “customer_name”: “Pioneer Tech”, “region”: “south”, “status”: “delivered”, "order_total ": 158 }, { “order_id”: “ORD-040”, “customer_name”: “Nexus Industries”, “region”: “north”, “status”: “pending”, "order_total ": 49 }, { “order_id”: “ORD-041”, “customer_name”: “Acme Corp”, “region”: “north”, “status”: “shipped”, "order_total ": 79 }, { “order_id”: “ORD-042”, “customer_name”: “TechStart Inc”, “region”: “west”, “status”: “delivered”, "order_total ": 99 }, { “order_id”: “ORD-043”, “customer_name”: “Global Systems”, “region”: “south”, “status”: “processing”, "order_total ": 98 }, { “order_id”: “ORD-044”, “customer_name”: “DataFlow Ltd”, “region”: “east”, “status”: “shipped”, "order_total ": 598 }, { “order_id”: “ORD-045”, “customer_name”: “CloudNine Solutions”, “region”: “west”, “status”: “delivered”, "order_total ": 99 }, { “order_id”: “ORD-046”, “customer_name”: “Bright Ideas Co”, “region”: “south”, “status”: “pending”, "order_total ": 298 }, { “order_id”: “ORD-047”, “customer_name”: “Summit Enterprises”, “region”: “north”, “status”: “shipped”, "order_total ": 147 }, { “order_id”: “ORD-048”, “customer_name”: “Innovate LLC”, “region”: “east”, “status”: “delivered”, "order_total ": 79 }, { “order_id”: “ORD-049”, “customer_name”: “Pioneer Tech”, “region”: “south”, “status”: “processing”, "order_total ": 149 }, { “order_id”: “ORD-050”, “customer_name”: “Nexus Industries”, “region”: “north”, “status”: “shipped”, "order_total “: 299 } ] }, “headers”: { " x-assessment-id”: “97f43a08583fa8da285a741ac1386f52”, “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/n8n101/process-orders”, “gzip”: true, “rejectUnauthorized”: true, “followRedirect”: true, “resolveWithFullResponse”: true, “sendCredentialsOnCrossOriginRedirect”: false, “followAllRedirects”: true, “timeout”: 300000, “encoding”: null, “json”: false, “useStream”: true }

Informações sobre sua configuração do n8n

  • Versão do n8n:
  • Banco de dados (padrão: SQLite):
  • Configuração EXECUTIONS_PROCESS do n8n (padrão: own, main):
  • Executando n8n via (Docker, npm, n8n cloud, aplicativo de desktop):
  • Sistema operacional:

Oi @estemagon, enquanto você aguarda uma resposta, aqui estão algumas coisas que podem ajudar:

Recursos sugeridos

Automaticamente compatível com sua pergunta.

Documentação:

Fórum:

@Ronnie_Ysela_Craig, @Nika - vocês já ajudaram com problemas similares antes, podem dar uma olhada?

Sugerido automaticamente pelo bot da comunidade do n8n. É um piloto - compartilhe seu feedback aqui.

Observe atentamente o resultado do último nó: a chave é "order_total " com um espaço no final, não "order_total". A API faz uma correspondência exata nos nomes dos campos, então a trata como uma chave diferente e informa que order_total está faltando. O 422 está correto.

O espaço indesejado está vindo de onde esse nome de campo foi digitado. Os locais mais prováveis neste exercício:

  1. O nó Edit Fields (Set) antes do HTTP Request: abra o campo chamado order_total e delete o espaço depois do nome.
  2. Se o nó HTTP Request constrói o corpo por si só: em Body Parameters, verifique o campo Name dessa entrada, ou se Specify Body estiver definido como Using JSON, verifique a chave dentro do JSON.

n8n mantém exatamente o que você digita em um nome de campo, espaços inclusos, e não o remove. Corrija o nome, execute novamente o workflow, e a resposta deve retornar 200 com os pedidos aceitos. Se ainda assim falhar, cole o JSON do nó HTTP Request (selecione-o, Ctrl+C, cole aqui) para que o corpo possa ser verificado diretamente.

@blessoftware Obrigado pela sua ajuda, de fato o erro estava no espaço no campo “order_total”.