Functions (previously called “scripts”) are the building blocks that power all integrations in Nango.

What are Functions in Nango?

Functions are TypeScript code that you write to define how your integrations work. Functions run in Nango’s infrastructure and give you deep control over your Syncs, Actions, or Webhook processing. They typically cover:
  • External API requests
  • Data transformation
  • Customer-specific logic (field mappings, filter options, etc.)
  • Other business logic about how you read and write data from external APIs
You can find many examples of Functions in our reference implementations GitHub repo. To implement your own functions, follow our implementation guides. Increasingly, AI agents can also help you write Nango functions.

Key facts

Overview of Functions in Nango

  • Functions are defined by you and run in the Nango infrastructure
  • Your Functions define the business logic (API requests, transformations, etc.) of your integration
  • All Functions in Nango are written in TypeScript. You can use any language in your own backend
  • The code of your Functions is stored in a nango-integrations folder in your codebase (e.g., in your monorepo)
  • You can test Functions locally with the CLI
  • You deploy your Functions to your Nango account with a CLI (or CI/CD of your choice)
    • Functions are deployed to an Environment within your account (e.g., dev, staging, prod, etc.)
  • Within Functions, you have a Nango SDK available. The exact features of this SDK depend on the context of your Function (sync execution, webhook handler, etc.)
    • Functions always run in the context of a Connection
    • The SDK helps with: External API requests, pagination, Connection info, logging, data validation, storing data in the cache, etc.
  • All inputs and outputs of Functions are strictly typed
  • Your Functions execute on an isolated runner with dedicated resources (memory, CPU, etc.)

Function types

Nango currently supports the following Function types:
  • Sync function: Executes whenever a sync run executes
  • Action function: Executes when the action is triggered
  • Webhook handler function: Executed when Nango processes an incoming webhook
  • Event function: Executes when certain lifecycle events happen on the platform
Our implementation guides have step-by-step instructions for each function type.