sync

Scaffolds Notion Worker sync capabilities with guided architecture, schema, and pagination design.

Updated Jul 31, 2026
One-click install
npx skills add https://github.com/Duckshot-Productions/ntn-worker --skill sync-duckshot-productions
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sync
Source: https://github.com/Duckshot-Productions/ntn-worker/tree/main/.agents/skills/sync
Command: npx skills add https://github.com/Duckshot-Productions/ntn-worker --skill sync-duckshot-productions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @notionhq/workers, and includes references (resource) components.

What problem does it solve? Building a data sync from an external API into a Notion database requires many decisions — replace vs incremental mode, pagination strategy, state design, auth setup, and deletion handling. This Skill walks you through each decision and generates working TypeScript code for a Notion Worker sync capability. ## Core Features & Use Cases - Guided Architecture Selection: Recommends a simple replace sync or a backfill + delta pair based on whether the source API supports change tracking. - Schema and State Design: Proposes a Notion database schema mapped from the API's fields and designs pagination/change-tracking state (opaque cursor, page number, keyset, event cursor). - End-to-End Code Generation and Testing: Writes the sync into src/index.ts with pacers, auth (static token or OAuth), consistency buffers, then guides local execution, deploy, preview, and go-live via the ntn CLI. - Use Case: You want Jira issues mirrored into a Notion database. The Skill identifies Jira's pagination and updated_at support, proposes a schema, generates a backfill + delta sync pair, and walks you through testing and deployment. ## Quick Start Ask the assistant to scaffold a new sync for your data source, for example: "Create a sync that pulls my GitHub issues into a Notion database."

Frequently Asked Questions about sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync external API data into a Notion database?▼

Define a managed database with worker.database(), then create a sync with worker.sync() that returns upsert changes from your API. This Skill guides you through schema design, pagination state, auth, and generates the TypeScript code in src/index.ts.

When should I use replace mode vs incremental mode for a Notion sync?▼

Use replace mode when the dataset is small or the API has no change tracking; the runtime auto-deletes records missing from each full fetch. Use a backfill plus delta pair with incremental mode when the API supports updated_at fields, events, or changelogs.

Can I test a Notion Worker sync locally before deploying?▼

Yes, for syncs using static API tokens. Run ntn workers exec <key> --local to execute the sync with your .env loaded, and pass -d with nextState to test pagination. OAuth syncs cannot run locally and require deploy plus preview instead.

How are deletions handled in a Notion Worker sync?▼

If the API emits delete events, emit { type: "delete", key } in the delta sync. If deletes are rare, stale records can be left in place. Otherwise, the backfill sync's replace mode mark-and-sweep removes records not seen during a full cycle.

Does the sync skill support OAuth APIs like Google or Salesforce?▼

Yes, it generates a worker.oauth() configuration with explicit authorization and token endpoints plus client credentials from .env. The OAuth flow completes after deployment using ntn workers oauth start, and tokens are retrieved via .accessToken().