Builds Nango Functions in a checked-out Zero YAML TypeScript Nango project using local files, index.ts registration, nango dryrun, generated tests, and optional nango deploy. Use when creating or updating Nango actions or syncs locally.
How the checkpoint changes the provider request or resume state
Delete strategy (deleted-record endpoint/webhook, or why full refresh is required)
If proposing a full refresh, the exact provider limitation that blocks checkpoints from the docs/sample response
Metadata JSON if required (team_id, workspace_id)
If any required external values are missing, ask a targeted question after checking the repo and provider docs. For syncs, choose a checkpoint plus deletion strategy whenever the provider supports one. If you cannot find a viable checkpoint strategy, state exactly why before writing a full refresh.
Non-Negotiable Rules
Shared platform constraints
Nango functions use
createAction()
/
createSync()
.
You cannot add arbitrary packages. Use relative imports only when the chosen workflow supports them; built-ins include
zod
,
crypto
/
node:crypto
, and
url
/
node:url
.
Use the Nango HTTP API for connection lookup, credentials, and proxy calls outside function code. Do not invent CLI token or connection commands.
Add an API doc link comment above each provider call.
Action outputs cannot exceed 2MB.
HTTP retries default to
0
; set
retries
deliberately, especially for writes.
Sync rules
Sync records need a stable string
id
.
New syncs should define a
checkpoint
schema, call
nango.getCheckpoint()
first, and
nango.saveCheckpoint()
after each page or batch.
A checkpoint is valid only if it changes the request or resume state (
since
,
updated_after
,
cursor
,
page_token
,
offset
,
page
,
since_id
, etc.). Saving one without using it is not incremental sync.
New syncs must not use
syncType: 'incremental'
or
nango.lastSyncDate
.
Default to
nango.paginate(...)
+
nango.batchSave(...)
. Avoid manual
while (true)
loops when
cursor
,
link
, or
offset
pagination fits.
Prefer
batchDelete()
when the provider returns deletions, tombstones, or delete webhooks.
Use full refresh only if the provider cannot return changes, deletions, or resume state, or if the dataset is tiny.
For full refresh, cite the exact provider limitation from docs or payloads. "It is easier" is not enough.
deleteRecordsFromPreviousExecutions()
is deprecated. For full refresh, call
trackDeletesStart()
before fetch/save and
trackDeletesEnd()
only after a successful full fetch/save.
Never combine
trackDeletesStart()
/
trackDeletesEnd()
with changed-only checkpoints (
modified_after
,
updated_after
, changed-records endpoints, etc.). They omit unchanged rows, so
trackDeletesEnd()
would delete them.
Checkpointed full refreshes are still full refreshes. Call
trackDeletesEnd()
only in the run that finishes the full window.
Conventions
Match field casing to the external API. Passthrough fields keep provider casing; non-passthrough fields should use the majority casing of that API.
Prefer explicit field names.
Add
.describe()
examples for IDs, timestamps, enums, and URLs.
Avoid
any
; use inline mapping types.
Prefer static Nango endpoint paths (avoid
:id
/
{id}
in the exposed endpoint); pass IDs in input or params.
List actions should expose
cursor
plus a next-cursor field in the majority casing of that API (
next_cursor
,
nextCursor
, etc.).
Use
nango.zodValidateInput()
only when you need custom validation or logging; otherwise rely on schemas plus the chosen validation workflow.
Schema Semantics
Default non-required inputs to
.optional()
.
Use
.nullable()
only when
null
has meaning, usually clear-on-update; add
.optional()
when callers may omit the field too.
Raw provider schemas should match the provider:
.optional()
for omitted fields,
.nullable()
for explicit
null
,
.nullish()
only when the provider truly does both.
Final action outputs and normalized sync models should prefer
.optional()
and normalize upstream
null
to omission unless
null
matters.
Default generated schemas to
.optional()
for non-required inputs and normalized outputs; widen only when the upstream contract justifies it.
Prefer
.nullable()
over
z.union([z.null(), T])
or
z.union([T, z.null()])
.
Return
null
only when the output schema allows it.
z.object()
strips unknown keys by default. For provider pass-through use
z.object({}).passthrough()
,
z.record(z.unknown())
, or
z.unknown()
with minimal refinements.
Field Naming and Casing Rules
Use explicit suffixes in the API's majority casing: IDs (
user_id
,
userId
), names (
channel_name
,
channelName
), emails (
user_email
,
userEmail
), URLs (
callback_url
,
callbackUrl
), and timestamps (
created_at
,
createdAt
).
Mapping example (API expects a different parameter name):
If web fetching returns incomplete docs (JS-rendered):
Ask the user for a sample response
Use existing Nango actions or syncs in the workspace as a pattern when they exist
Use the skill-specific validation or dryrun workflow until it passes
Workflow (required)
Decide whether this is an action or a sync.
Read the matching reference file:
references/actions.md
or
references/syncs.md
.
For syncs, inspect provider docs or payloads for checkpoints and deletes, decide whether the endpoint returns full data or changed rows, and complete the Sync Strategy Gate.
Gather required inputs and external values. For connection lookup, credentials, or discovery, use the Nango HTTP API.
Confirm this is a Zero YAML TypeScript project (
no nango.yaml
) and that you are in the Nango root (
.nango/
exists).
Create or update the function under
{integrationId}/actions/
or
{integrationId}/syncs/
, apply the shared schema and casing rules, then register it in
index.ts
.
Validate with
nango dryrun ... --validate -e dev --no-interactive --auto-confirm
.
If validation cannot pass, stop and report the missing external state or inputs.
After validation passes, run
nango dryrun ... --save
, then
nango generate:tests
, then
npm test
.
Deploy with
nango deploy dev
only when requested.
Preconditions (Do Before Writing Code)
Confirm TypeScript Project (No
nango.yaml
)
This skill only supports TypeScript projects using
createAction()
/
createSync()
.
bash
ls nango.yaml 2>/dev/null &&echo"YAML PROJECT DETECTED"||echo"OK - No nango.yaml"
If you see
YAML PROJECT DETECTED
:
Stop immediately.
Tell the user to upgrade to the TypeScript format first.
Do not create files until you confirm the Nango root:
bash
ls-la .nango/ 2>/dev/null &&pwd&&echo"IN NANGO PROJECT ROOT"||echo"NOT in Nango root"
If you see
NOT in Nango root
:
cd
into the directory that contains
.nango/
Re-run the check
Do not use absolute paths as a workaround
All file paths must be relative to the Nango root. Creating files with extra prefixes while already in the Nango root will create nested directories that break the build.