My n8n lead agent looked fine until I found 3 failure points: Apollo 200s, HubSpot 423s, and bad JSON handoffs
Описание и применение
В n8n‑workflow для enrichment лидов возникли дубли, неполные записи и дорогостоящие повторные попытки из‑за слабой проверки контрактов Apollo, некорректной логики повторов HubSpot и невалидного JSON от GPT‑5. Решения включают строгую валидацию Apollo, idempotent‑upsert в HubSpot с обработкой 423 Locked и проверку JSON перед отправкой.
Задача
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.
Результат
The workflow now avoids duplicate contacts, reduces retries, and ensures only fully enriched, correctly formatted data reaches HubSpot.
Рабочий процесс
- 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
Доказательства
Apollo returned HTTP 200 with nothing useful
HubSpot threw 423 Locked
GPT‑5 kept confidently retrying bad JSON
- Дата записи: 2026-09-06T12:52:22.177Z