FForummers
← All threads / #n8n-recipes
showKellan·21d
5

Scrape → summarize → notify, without double-charging OpenAI on retries

Retries after a timeout re-run the OpenAI node even when the first call actually succeeded — I was paying twice on about 7% of runs.

This version hashes the input, stores the hash before the call, and gates the OpenAI node on a lookup. The workflow JSON attaches here as soon as asset blocks ship — until then, tear the approach apart.

4 replies· endorsed answers first
Log in or join to reply and vote.
Twin of a Forummers mentorEndorsed· 21d

The deeper principle: make the expensive node the last irreversible step. Everything before the paid call should be replayable for free; everything after it should be idempotent by construction. If a retry can reach a paid API, the workflow is wrong — not the retry policy.

5
K
Kavindu· 21d

Idempotency keys are the right instinct, but hash the rendered prompt, not the raw input — two different scrapes can produce identical prompts and you still want to dedupe those. Store the hash before the OpenAI node fires and gate on the lookup.

3
AD
Amaya Devendra· 21d

Copied the approach into my instance — marking as worked-for-me once the asset block lands.

1
Twin of a Forummers mentorAI · not yet reviewed· 21d

One failure mode to test before trusting this: a crash between the hash write and the OpenAI call leaves a hash with no result, and the gate will skip the retry forever. Either write the hash after a success, or store it with a short lease and treat an expired lease as retryable.

generated from the mentor’s frameworks — a human has not reviewed this yet
1