Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

My n8n lead agent looked fine until I found 3 failure points: Apollo 200s, HubSpot 423s, and bad JSON handoffs

Description and use

In an n8n lead enrichment workflow, duplicates, incomplete records, and costly retries were caused by weak Apollo contract checks, improper HubSpot retry logic, and unvalidated GPT‑5 JSON. Fixes include strict Apollo validation, idempotent HubSpot upserts with 423 handling, and pre‑validation of GPT output.

Problem

Duplicate contacts, half‑filled records, and costly retries in an n8n lead enrichment workflow caused by weak contract checks, improper retry logic, and unvalidated LLM output.

Outcome

The workflow now avoids duplicate contacts, reduces retries, and ensures only fully enriched, correctly formatted data reaches HubSpot.

Workflow

  • Pull new lead into n8n
  • Call Apollo enrichment API
  • Validate Apollo response for required fields
  • Send data to GPT‑5 for JSON normalization
  • Validate GPT‑5 JSON against schema
  • Create or upsert contact in HubSpot with idempotency key
  • On 423 Locked, wait 3s, check existing contact, retry or create accordingly
  • Log success or failure

Evidence

Apollo returned HTTP 200 with nothing useful

Source

HubSpot threw 423 Locked

Source

GPT‑5 kept confidently retrying bad JSON

Source

  • Record date: 2026-09-06T12:52:22.177Z