Skip to content

B2B Leads API Retry Design: Recovery and Duplicate Prevention

Design bounded retries for lead workflows by tracking the failed stage, stored results and uncertain outcomes.

Dievio Team · Growth Systems · August 7, 2026 · 4 min read

A recovery bridge connects a destination drawer with a stored result and retry state, illustrating recovery without blindly repeating retrieval.

Key points

  • Classify the failed stage before choosing recovery.
  • Persist attempt limits and retry state across worker restarts.
  • Keep source billing uncertainty separate from destination idempotency.

A retry policy should repeat only the stage that failed, under a clear limit. In a lead-data workflow, retrying a destination write and repeating a paid source retrieval have different consequences.

Begin with the actual endpoint contract and record whether a usable response was already stored. The public-search error reference describes Dievio's current status and message shape; this guide focuses on the recovery decision.

Classify the state before retrying

StateRecovery decision
Request rejected for authentication or invalid configurationFix the configuration before another attempt
Credit or budget condition prevents retrievalPause for balance and scope review
Potentially temporary source-service failureConsider a bounded retry under the source policy
Timeout with a saved page keyRetry the same Search page parameters with that key inside the replay window
Timeout without a keyCheck the job log and credit activity before repeating the request
Successful response stored, destination failedRetry downstream work from stored data
Successful empty resultComplete or review the audience; do not treat it as a transport failure

A status alone may not explain the cause. For example, Dievio public search can return 500 for configuration or balance-read failures as well as unexpected errors. Repeating a configuration failure indefinitely is not a recovery strategy.

Set limits at the attempt and job levels

Define request timeouts, maximum attempts, maximum elapsed recovery time and the condition that pauses the whole job. These values depend on the workflow deadline, response behavior and acceptable cost; there is no universal five-retry rule for every lead API.

Store the retry state outside worker memory. Include the attempt count, earliest next attempt, failure category and recovery owner. A worker restart should not reset the attempt counter and create an endless loop.

  • Use an increasing delay for recoverable repeated failures.
  • Add jitter where needed to avoid synchronized workers.
  • Cap the delay and the total recovery period.
  • Route exhausted or unexplained failures to a review state.

Treat provider guidance as a contract

If a provider supplies a documented retry delay, interpret it correctly. An HTTP Retry-After value can be a delay in seconds or an HTTP date. Do not parse every value as a decimal number.

That general HTTP behavior does not establish that Dievio always supplies a retry header or rate-limit counters. Use a bounded client policy when the response offers no documented guidance. The request-controls guide separates traffic pacing from credit limits.

Dievio

Your workflow. Powered by Dievio.

Bring B2B contact search and LinkedIn enrichment into the tools you already use.

Explore Dievio API

Search contacts · Enrich profiles · Export results

Dievio APIExample
POST /api/public/search{ "job_titles": ["Founder"], "max_results": 10 }
Contacts ready for your workflow

Distinguish repeated reads from idempotent billing

Before calling Public Search, store a unique Idempotency-Key for each logical page along with its parameters. If the connection drops, resend the same key and parameters within one hour of completion. A successful replay includes Idempotency-Replayed: true and uses no additional credits.

Do not claim a provider request-status endpoint, deduplication header or billing lookup exists unless it is documented. If no definitive result can be recovered, the operator needs an explicit decision about a bounded repeat request.

Checkpoint a page only after durable storage

For numeric pagination, preserve the job's filters and page size. Save the response and its effective pagination state before marking the page complete. Do not advance the page number after a timeout merely to keep the worker moving.

A subsequent CRM failure should leave the source checkpoint intact. Resume transformation or delivery from the saved response. The pagination workflow explains page-boundary and changing-result limitations.

Make destination recovery safe

Use the destination's documented idempotency contract where available. Otherwise, combine conservative matching, a stable logical delivery reference and reconciliation appropriate to the destination.

An acknowledgement can mean that a receiver accepted the job rather than completed the CRM write. Track both states. The application-owned relay guide explains why transport acceptance and final business completion must remain separate.

Test interruptions rather than only success

  1. Return a temporary error and verify the delayed, bounded next attempt.
  2. Restart the worker and confirm its retry history survives.
  3. Simulate a dropped response and confirm the worker retries the same page with its saved key before advancing.
  4. Fail the destination after source storage and confirm no extra search starts.
  5. Exhaust the recovery budget and require a review decision.

Use fixtures for failure cases and a small live request to validate the real response contract. Keep recovered jobs, unresolved jobs and paid repeat retrievals visible in the final operating report.

Keep reading

Build your first list.

100 free credits. No credit card required.

Start free