Skip to main content

Overview

Functions are Nango’s TypeScript runtime for building custom integrations. You write integration logic in TypeScript and deploy it to Nango. Functions execute with built-in access to authenticated APIs, retries, storage, and observability. Functions are a flexible primitive that you can use to build any integration use-case, from simple API actions to complex data syncs, RAG pipelines & real-time webhook ingestion. Pair Functions with the AI integration builder to generate and maintain integration code faster—combining the speed of AI with human-reviewable code you fully control.

How it works

1. Define a function
export default async function run(nango: Nango) {
    const { owner, repo, title, body } = nango.input;
    
    const response = await nango.post({
        endpoint: `/repos/${owner}/${repo}/issues`,
        data: { title, body }
    });
    
    return response.data;
}
You can find many examples of Functions in our integration templates GitHub repo.
2. Deploy the function Deploy your function to Nango using the CLI:
nango deploy
3. Trigger the function Call the function via Nango’s API using the connection ID and function name:
const result = await nango.trigger({
    integrationId: 'github',
    connectionId: connectionId,
    functionName: 'create-issue',
    input: {
        owner: 'acme',
        repo: 'my-repo',
        title: 'Bug report',
        body: 'Something is broken'
    }
});

Capabilities

Runtime and execution

  • Runs inside Nango
  • Isolated execution per customer and per run
  • Elastic scaling & fast startup time (less than 100ms)
  • Flexible use-cases: long-running syncs, rapid-fire actions, etc.
  • Triggered by API calls, schedules, webhooks, or life-cycle events

Developer experience

  • TypeScript-first, but compatible with any code base (HTTP-controlled)
  • Generate & maintain integration code with your favorite AI models
  • Local development, local dry runs & testing framework
  • CLI-based workflow & CI/CD integration
  • Code lives in your own Git repository

Runtime SDK

  • Authenticated API requests
  • Retries & rate-limit handling
  • Sync engine with caching & checkpointing for ETL & RAG
  • Data transformation utilities
  • Runtime and compile-time data validation & auto-completion

State and configuration

  • Per-customer configuration & logical branching
  • Per-customer key-value storage
  • Compose functions into workflows

Observability

  • Execution & custom logs
  • Metrics and monitoring
  • Debuggable failures
  • OpenTelemetry export

Use cases

Functions are a powerful & flexible primitive to support any complex integration use-case:

Next step