Skip to main content
Actions are functions that run on Nango’s platform to read from or write to external APIs. Unlike syncs, actions are triggered explicitly and return a typed result synchronously (or asynchronously for batch workloads). Think of actions as “virtual endpoints” on external APIs that you define: a single create-contact action that works with Salesforce, HubSpot, Attio, and any other CRM through a unified interface.

When to use actions

Actions are ideal when you want to:
  • Create unified interfaces across different APIs (e.g., one create-contact that abstracts Salesforce, HubSpot, and Attio)
  • Write data to external APIs — creating records, sending messages, triggering workflows
  • Abstract multi-step operations into a single call (e.g., create an opportunity and link it to a contact and company in one request)
  • Enforce type safety for all interactions with external APIs

Key facts

  • Actions run in Nango’s infrastructure, scoped to a connection
  • Actions take a typed input and return a typed output — you control the code and data models
  • Actions run synchronously by default, returning results directly in the API response
  • Actions can also run asynchronously for batch workloads
  • Actions can call other actions to compose workflows
  • Actions can be exposed as LLM tools via Nango’s built-in MCP server
  • The output of an action cannot exceed 2 MB
  • All invocations and API calls are logged in the Nango dashboard

Build an action

Step 1 — Set up your integrations folder

If you don’t have a nango-integrations folder yet, follow the functions setup guide.

Step 2 — Start dev mode

Keep this terminal open while you develop.

Step 3 — Create the action file

Action files live inside an actions/ folder nested under the integration folder. For an action that fetches available fields on the Salesforce Contact object:
Paste the following scaffold:
salesforce-contact-fields.ts
Also import the new file in index.ts:
index.ts

Step 4 — Implement your action

Write the logic in the exec method. Here is a complete action that fetches available fields on the Salesforce Contact object:
salesforce-contact-fields.ts

SDK methods available in actions

Step 5 — Test locally

To pass input data:
Run nango dryrun --help to see all options.

Step 6 — Deploy

To deploy a single action:

Use an action from your backend

Triggering an action synchronously

The response body is the typed output of your action, returned immediately.

Triggering an action asynchronously

Asynchronous execution is ideal for batch writes or workloads where you want Nango to handle rate limits and retries transparently without blocking your request.
Nango can also send a webhook to your backend when an async action finishes.

Action workflows

Actions can call other actions using nango.triggerAction() from within the exec method. Each invocation appears separately in the Nango logs.

Action configuration reference