- Symptom
- Request to Notion API failed with status: 502503 service_unavailable followed by two identical rows after a retryBulk import of a few thousand pages ends with more rows than the source
- Cause
- Notion can save a write and still answer with a timeout, so a blind retry of POST or PATCH repeats it. Notion's guidance is to retry 5xx only for GET and DELETE unless the caller has its own idempotency check, and the JS SDK follows that rule.
- Fix
- Before retrying a create, query for the row by a unique property you set on it. On 503, read additional_data.retry_guidance before deciding.
- Apply
const hit = await notion.dataSources.query({ data_source_id, filter: { property: "External ID", rich_text: { equals: extId } } }); if (hit.results.length === 0) await notion.pages.create(payload);- Affected
- Notion REST API and @notionhq/client 5.x retry behavior, as of 2026-10
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders