Skip to content

Nango

Nango integrations, connections, syncs and records as SQL, plus read-only calls to 400+ APIs through the Nango proxy

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/nango/index.md to help me query Nango with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Find integrations with broken authentication

Uses your connected account. Set up the connector and credentials to run it with your data.

SELECT provider_config_key, count(*) AS connections,
  count(*) FILTER (WHERE has_auth_error) AS broken
FROM nango.main.connections()
GROUP BY provider_config_key
ORDER BY broken DESC, connections DESC

Quick start

Choose where to run Nango, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'nango' AS nango (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-nango'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

nango credentials

Nango environment secret key, plus the API host for a self-hosted Nango

Get these credentials →
secret.sql
CREATE SECRET nango (
    TYPE nango,
    secret_key '<SECRET_KEY>',  -- secret
    host       '<host>'
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT provider_config_key, count(*) AS connections,
  count(*) FILTER (WHERE has_auth_error) AS broken
FROM nango.main.connections()
GROUP BY provider_config_key
ORDER BY broken DESC, connections DESC
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach the release directly

Uses the verified release each time you attach the connector.

ATTACH 'nango' AS nango (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Nango as SQL: its provider catalog, integrations, connections, syncs and synced records, plus read-only calls to 400+ APIs through the Nango proxy with Nango-managed credentials.

Catalog

Everything nango exposes once attached — read straight from the worker's released build.

nango 1 schema
main 7 tables · 3 functions

Nango providers, integrations, connections, syncs, records and the read-only proxy.

Schema examples (12)
Examples (12)

Connections and broken (auth-error) connections per integration

SELECT provider_config_key, count(*) AS connections,
  count(*) FILTER (WHERE has_auth_error) AS broken
FROM nango.main.connections()
GROUP BY provider_config_key
ORDER BY connections DESC;

One organization's connections and when their tokens expire

SELECT connection_id, provider, credential_type, credential_expires_at
FROM nango.main.connections()
WHERE organization_id = 'org_acme'
ORDER BY credential_expires_at;

Open GitHub issues a Nango sync stored (typed model columns such as state are also available)

SELECT _record->>'title' AS title, _nango_last_modified_at
FROM nango.main.records('github-prod', 'conn-ada-github', 'GithubIssue')
WHERE _nango_deleted_at IS NULL AND _record->>'state' = 'open'
ORDER BY title;

Incremental read: records changed since a timestamp (pushed down as modified_after)

SELECT id, _nango_last_action
FROM nango.main.records('github-prod', 'conn-ada-github', 'GithubIssue')
WHERE _nango_last_modified_at > TIMESTAMPTZ '2026-11-01 00:00:00+00'
ORDER BY id;
8 more examples

Every GitHub repository the connection can see, following Link-header pages

SELECT item->>'full_name' AS repo
FROM nango.main.proxy('conn-ada-github', 'github-prod', '/user/repos', paginate := 'provider', params := '{"per_page": 50}')
ORDER BY repo;

HubSpot contacts through the proxy with the provider's cursor pagination

SELECT item->>'id' AS id, item->'properties'->>'email' AS email
FROM nango.main.proxy('conn-acme-hubspot', 'hubspot', '/crm/v3/objects/contacts', paginate := 'provider')
ORDER BY id;

How many catalog providers use each auth mode

SELECT auth_mode, count(*) AS providers
FROM nango.main.providers
GROUP BY auth_mode
ORDER BY providers DESC;

CRM providers Nango supports

SELECT name, display_name, auth_mode
FROM nango.main.providers
WHERE list_contains(categories, 'crm')
ORDER BY name;

Integrations whose developer-app credentials are incomplete

SELECT unique_key, provider, missing_fields
FROM nango.main.integrations
WHERE NOT is_configured
ORDER BY unique_key;

Each integration with its provider's auth mode

SELECT i.unique_key, p.auth_mode
FROM nango.main.integrations i
JOIN nango.main.providers p ON p.name = i.provider
ORDER BY i.unique_key;

Enabled syncs and the models they produce

SELECT provider_config_key, name, models, runs
FROM nango.main.syncs
WHERE enabled
ORDER BY provider_config_key, name;

Every (integration, model) pair records() can read

SELECT provider_config_key, unnest(models) AS model
FROM nango.main.syncs
ORDER BY ALL;
Tables
actions 1 example12 cols

Action functions deployed in this Nango environment (listed only; this worker never triggers them)

Columns
provider_config_keynot null VARCHAR
Integration id the function is deployed to.
provider VARCHAR
Provider name.
namenot null VARCHAR
Action name.
models VARCHAR[]
Model names it returns (pass one to records() as `model`).
description VARCHAR
Description from the function's definition.
version VARCHAR
Deployed version.
last_deployed TIMESTAMP WITH TIME ZONE
When it was last deployed.
is_public BOOLEAN
True for a public (catalog) template.
pre_built BOOLEAN
True for a Nango pre-built template.
scopes VARCHAR[]
Provider scopes it needs.
endpoints JSON
Endpoints it exposes ({method, path, group}).
input JSON
Input model reference, as JSON.
ConstraintsPRIMARY KEY (provider_config_key, name) · FOREIGN KEY (provider_config_key) REFERENCES integrations(unique_key)
Example

Deployed actions per integration

SELECT provider_config_key, name, description
FROM nango.main.actions
ORDER BY provider_config_key, name;
Link
connection_syncs 2 examples17 cols

Status of every sync on every connection: state, last finish, next run and record counts

Columns
provider_config_key VARCHAR
Integration id.
connection_id VARCHAR
The connection the sync runs for (connections.connection_id).
sync_name VARCHAR
Sync name (syncs.name).
variant VARCHAR
Sync variant ('base' unless variants are used).
status VARCHAR
RUNNING, PAUSED, STOPPED, SUCCESS or ERROR.
sync_type VARCHAR
Most recent run type: INITIAL or INCREMENTAL.
finished_at TIMESTAMP WITH TIME ZONE
When the most recent run finished.
next_scheduled_sync_at TIMESTAMP WITH TIME ZONE
When the next run is scheduled.
frequency VARCHAR
Execution frequency, e.g. 'every hour'.
total_records BIGINT
Count of records currently stored, summed over the sync's models.
record_count JSON
Records stored per model, as JSON.
last_added BIGINT
Count of records the latest run added (all models).
last_updated BIGINT
Count of records the latest run updated (all models).
last_deleted BIGINT
Count of records the latest run deleted (all models).
latest_result JSON
Latest run's per-model added/updated/deleted counts, as JSON.
checkpoint JSON
Last checkpoint saved by the sync, as JSON (NULL when none).
idnot null VARCHAR
Nango's id for this sync on this connection (unique per row).
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (provider_config_key) REFERENCES integrations(unique_key)
Examples (2)

Failing syncs

SELECT provider_config_key, connection_id, sync_name, finished_at
FROM nango.main.connection_syncs
WHERE status = 'ERROR'
ORDER BY ALL;

Records stored per sync for one integration

SELECT sync_name, sum(total_records) AS records
FROM nango.main.connection_syncs
WHERE provider_config_key = 'github-prod'
GROUP BY sync_name
ORDER BY records DESC;
Link
environment_variables 1 example2 cols

Names of the environment variables set in this Nango environment (values are never returned)

Columns
namenot null VARCHAR
Variable name.
is_set BOOLEAN
True when the variable has a non-empty value (the value itself is never returned).
ConstraintsPRIMARY KEY (name)
Example

Environment variables defined without a value

SELECT name
FROM nango.main.environment_variables
WHERE NOT is_set
ORDER BY name;
Link
environments 1 example4 cols

Environments in the Nango account (needs an account API key in the nango secret)

Columns
numeric_id BIGINT
Nango's numeric environment identifier (an id, not a quantity).
uuid VARCHAR
Environment UUID.
namenot null VARCHAR
Environment name, e.g. 'prod'.
is_production BOOLEAN
Whether this is a production environment.
ConstraintsPRIMARY KEY (name)
Example

The account's environments

SELECT name, is_production FROM nango.main.environments ORDER BY name;
Link
integrations 2 examples9 cols

Integrations configured in this Nango environment (provider configs; client secrets are never read)

Columns
unique_keynot null VARCHAR
Integration id (provider_config_key) used by connections, syncs, records and proxy.
display_name VARCHAR
Human-readable integration name shown in the Nango dashboard.
provider VARCHAR
Provider name; joins nango.main.providers.name.
logo VARCHAR
Logo URL (SVG).
created_at TIMESTAMP WITH TIME ZONE
When the integration was created.
updated_at TIMESTAMP WITH TIME ZONE
When the integration last changed.
forward_webhooks BOOLEAN
Whether provider webhooks are forwarded to your backend.
missing_fields VARCHAR[]
Credential fields still missing (names only, never values).
is_configured BOOLEAN
True when no credential fields are missing.
ConstraintsPRIMARY KEY (unique_key) · FOREIGN KEY (provider) REFERENCES providers(name)
Examples (2)

Integrations whose developer-app credentials are incomplete

SELECT unique_key, provider, missing_fields
FROM nango.main.integrations
WHERE NOT is_configured
ORDER BY unique_key;

Each integration with its provider's auth mode

SELECT i.unique_key, p.auth_mode
FROM nango.main.integrations i
JOIN nango.main.providers p ON p.name = i.provider
ORDER BY i.unique_key;
Link
providers 2 examples10 cols

Nango's provider catalog: every API Nango can authenticate to, with its auth mode and categories

Columns
namenot null VARCHAR
Provider name, the key used when creating an integration (e.g. 'github', 'hubspot').
display_name VARCHAR
Human-readable provider name.
auth_mode VARCHAR
How Nango authenticates: OAUTH1, OAUTH2, OAUTH2_CC, API_KEY, BASIC, APP, JWT, TBA, NONE, CUSTOM, …
categories VARCHAR[]
Catalog categories, e.g. ['crm', 'marketing'].
docs VARCHAR
Nango's documentation page for this provider.
proxy_base_url VARCHAR
Base URL the Nango proxy prefixes to request paths for this provider.
proxy_paginate JSON
The provider's default proxy pagination config (type cursor / link / offset and its field names), or NULL.
default_scopes VARCHAR[]
OAuth scopes requested by default.
authorization_url VARCHAR
OAuth authorization endpoint (OAuth providers).
token_url VARCHAR
OAuth token endpoint (a string, or JSON for per-grant URLs).
ConstraintsPRIMARY KEY (name)
Examples (2)

How many catalog providers use each auth mode

SELECT auth_mode, count(*) AS providers
FROM nango.main.providers
GROUP BY auth_mode
ORDER BY providers DESC;

CRM providers Nango supports

SELECT name, display_name, auth_mode
FROM nango.main.providers
WHERE list_contains(categories, 'crm')
ORDER BY name;
Link
syncs 2 examples16 cols

Sync functions deployed in this Nango environment, with their models, schedule and JSON schema

Columns
provider_config_keynot null VARCHAR
Integration id the function is deployed to.
provider VARCHAR
Provider name.
namenot null VARCHAR
Sync name.
models VARCHAR[]
Model names it returns (pass one to records() as `model`).
description VARCHAR
Description from the function's definition.
version VARCHAR
Deployed version.
last_deployed TIMESTAMP WITH TIME ZONE
When it was last deployed.
is_public BOOLEAN
True for a public (catalog) template.
pre_built BOOLEAN
True for a Nango pre-built template.
scopes VARCHAR[]
Provider scopes it needs.
endpoints JSON
Endpoints it exposes ({method, path, group}).
runs VARCHAR
Schedule, e.g. 'every 30 minutes'.
enabled BOOLEAN
Whether the sync is enabled.
auto_start BOOLEAN
Whether it starts automatically for new connections.
track_deletes BOOLEAN
Whether deletions are detected (records get last_action DELETED).
json_schema JSON
JSON Schema of the returned models ({definitions: {Model: …}}), or NULL.
ConstraintsPRIMARY KEY (provider_config_key, name) · FOREIGN KEY (provider_config_key) REFERENCES integrations(unique_key)
Examples (2)

Enabled syncs and the models they produce

SELECT provider_config_key, name, models, runs
FROM nango.main.syncs
WHERE enabled
ORDER BY provider_config_key, name;

Every (integration, model) pair records() can read

SELECT provider_config_key, unnest(models) AS model
FROM nango.main.syncs
ORDER BY ALL;
Link
Table functions
connections (page_size := BIGINT, tags := VARCHAR) 2 examples

Nango connections with end-user / organization tags, errors and credential type + expiry (never tokens)

Named arguments
page_size := BIGINT
Connections requested per page (1 to 1000). · default 100
tags := VARCHAR
Optional JSON object of connection tags that must all match, e.g. '{"organization_id": "org_1"}'. · default null
Returns columns
id BIGINT
Nango's internal numeric connection id.
connection_id VARCHAR
The connection id (pass it to records() and proxy()).
provider_config_key VARCHAR
Integration id (integrations.unique_key).
provider VARCHAR
Provider name (providers.name).
created TIMESTAMP WITH TIME ZONE
When the connection was created.
end_user_id VARCHAR
The end_user_id connection tag.
end_user_email VARCHAR
The end_user_email connection tag.
organization_id VARCHAR
The organization_id connection tag.
tags JSON
All connection tags (lowercase keys) as a JSON object.
metadata JSON
Custom metadata attached to the connection, as JSON (NULL when none).
end_user JSON
Deprecated end_user object (id, email, display_name, organization) when set.
errors STRUCT(type VARCHAR, log_id VARCHAR)[]
Connection errors: type 'auth' (credentials invalid) or 'sync' (last sync failed), with the Nango log id.
has_auth_error BOOLEAN
True when Nango reports the credentials invalid (an 'auth' error).
credential_type VARCHAR
Credential type, e.g. OAUTH2, API_KEY, BASIC, APP (detail call; never the token).
credential_expires_at TIMESTAMP WITH TIME ZONE
When the current access token expires (OAuth); NULL when it does not.
updated_at TIMESTAMP WITH TIME ZONE
When the connection last changed (detail call).
last_fetched_at TIMESTAMP WITH TIME ZONE
When credentials were last fetched through Nango (detail call).
Examples (2)

Connections and broken (auth-error) connections per integration

SELECT provider_config_key, count(*) AS connections,
  count(*) FILTER (WHERE has_auth_error) AS broken
FROM nango.main.connections()
GROUP BY provider_config_key
ORDER BY connections DESC;

One organization's connections and when their tokens expire

SELECT connection_id, provider, credential_type, credential_expires_at
FROM nango.main.connections()
WHERE organization_id = 'org_acme'
ORDER BY credential_expires_at;
Link
proxy (connection_id VARCHAR, provider_config_key VARCHAR, path VARCHAR, headers := VARCHAR, max_pages := BIGINT, method := VARCHAR, paginate := VARCHAR, params := VARCHAR, response_path := VARCHAR) 2 examples

Read any API Nango brokers through the Nango proxy (GET/HEAD only) with Nango-managed credentials

Positional arguments
connection_id VARCHAR
Connection id whose credential Nango should use.
provider_config_key VARCHAR
Integration id (provider_config_key) of that connection.
path VARCHAR
API path relative to the provider's base URL, e.g. '/user/repos' (a '?query' part is allowed).
Named arguments
headers := VARCHAR
Extra request headers as a JSON object (named); sent as Nango-Proxy-<name> and forwarded upstream. · default null
max_pages := BIGINT
Stop after this many pages (named, 1 to 10000). · default 100
method := VARCHAR
HTTP method (named): GET (default) or HEAD. Mutating methods are rejected — the worker is read-only. · default "GET"
paginate := VARCHAR
Pagination (named): NULL = one page; 'provider' = the provider's default from the catalog; or a JSON object in Nango's proxy paginate format ({type: cursor|link|offset, …}). · default null
params := VARCHAR
Query parameters as a JSON object (named), e.g. '{"per_page": 100}'; array values repeat the key. · default null
response_path := VARCHAR
Where the rows are in the JSON response (named): dotted path ('data.items') or JSON pointer. · default null
Returns columns
page INTEGER
1-based page number the row came from.
item_index INTEGER
0-based position of the item within its page.
http_status INTEGER
HTTP status of the page's response.
item JSON
One element of the response (at response_path), as JSON. For HEAD: the response headers.
Examples (2)

Every GitHub repository the connection can see, following Link-header pages

SELECT item->>'full_name' AS repo
FROM nango.main.proxy('conn-ada-github', 'github-prod', '/user/repos', paginate := 'provider', params := '{"per_page": 50}')
ORDER BY repo;

HubSpot contacts through the proxy with the provider's cursor pagination

SELECT item->>'id' AS id, item->'properties'->>'email' AS email
FROM nango.main.proxy('conn-acme-hubspot', 'hubspot', '/crm/v3/objects/contacts', paginate := 'provider')
ORDER BY id;
Link
records (integration VARCHAR, connection_id VARCHAR, model VARCHAR, filter := VARCHAR, modified_after := TIMESTAMP WITH TIME ZONE, page_size := BIGINT, variant := VARCHAR) 2 examples

Records a Nango sync stored for one connection and model, typed from the model's JSON Schema

Positional arguments
integration VARCHAR
Integration id (provider_config_key), e.g. 'github-prod'.
connection_id VARCHAR
Connection id whose records to read.
model VARCHAR
Model name as listed in the models column of nango.main.syncs, e.g. 'GithubIssue'.
Named arguments
filter := VARCHAR
Only records whose last action is one of these: comma list of added, updated, deleted (named). · default null
modified_after := TIMESTAMP WITH TIME ZONE
Only records Nango changed after this instant (named; also pushed from _nango_last_modified_at). · default null
page_size := BIGINT
Records requested per page (named, 1 to 1000). · default 100
variant := VARCHAR
Sync variant to read (named; default the base variant). · default null
Returns columns
id VARCHAR
Record id (hoisted from the payload; the rest is in _record).
_nango_last_action VARCHAR
Last change Nango saw: ADDED, UPDATED or DELETED.
_nango_last_modified_at TIMESTAMP WITH TIME ZONE
When Nango last detected a change to the record.
_nango_first_seen_at TIMESTAMP WITH TIME ZONE
When Nango first saw the record.
_nango_deleted_at TIMESTAMP WITH TIME ZONE
When Nango detected the record as deleted (NULL if not deleted).
_nango_pruned_at TIMESTAMP WITH TIME ZONE
When the record payload was pruned (emptied), or NULL.
_nango_cursor VARCHAR
The record's cursor (records after it can be read with Nango's cursor API).
_record JSON
The full record payload (without _nango_metadata) as JSON.
Examples (2)

Open GitHub issues a Nango sync stored (typed model columns such as state are also available)

SELECT _record->>'title' AS title, _nango_last_modified_at
FROM nango.main.records('github-prod', 'conn-ada-github', 'GithubIssue')
WHERE _nango_deleted_at IS NULL AND _record->>'state' = 'open'
ORDER BY title;

Incremental read: records changed since a timestamp (pushed down as modified_after)

SELECT id, _nango_last_action
FROM nango.main.records('github-prod', 'conn-ada-github', 'GithubIssue')
WHERE _nango_last_modified_at > TIMESTAMPTZ '2026-11-01 00:00:00+00'
ORDER BY id;
Link

Credentials

The secret type nango declares, as reported by the worker itself.

nango

How to get these credentials

Nango environment secret key, plus the API host for a self-hosted Nango

secret.sql
CREATE SECRET nango (
    TYPE nango,
    secret_key '<SECRET_KEY>',  -- secret
    host       '<host>'
);
Key Type Required Description
secret_key secret VARCHAR — Environment secret key (Environment Settings > API keys), sent as a Bearer token. An account API key works for the environments table only.
host VARCHAR — Nango API base URL; default https://api.nango.dev. Set it for a self-hosted Nango (http:// only for localhost).

The worker doesn't mark which keys are required.

Create the secret in the same session, after attaching nango — the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

connections_columns — The connections() result columns (binds only; create a nango secret and drop LIMIT 0 for rows)

SELECT connection_id, provider_config_key, has_auth_error,
  credential_expires_at
FROM nango.main.connections()
LIMIT 0;

Uses connections

proxy_columns — The proxy() result columns (binds only; create a nango secret and drop LIMIT 0 for rows)

SELECT page, item_index, http_status, item
FROM nango.main.proxy('conn-1', 'github', '/user')
LIMIT 0;

Uses proxy

Open GitHub issues a Nango sync stored (typed model columns such as state are also available)

SELECT _record->>'title' AS title, _nango_last_modified_at
FROM nango.main.records('github-prod', 'conn-ada-github', 'GithubIssue')
WHERE _nango_deleted_at IS NULL AND _record->>'state' = 'open'
ORDER BY title

Uses records

How many catalog providers use each auth mode

SELECT auth_mode, count(*) AS providers
FROM nango.main.providers
GROUP BY auth_mode
ORDER BY providers DESC

Uses providers

Integrations whose developer-app credentials are incomplete

SELECT unique_key, provider, missing_fields
FROM nango.main.integrations
WHERE NOT is_configured
ORDER BY unique_key

Uses integrations

Enabled syncs and the models they produce

SELECT provider_config_key, name, models, runs
FROM nango.main.syncs
WHERE enabled
ORDER BY provider_config_key, name

Uses syncs

13 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Which providers in the Nango catalog are in the crm category?
  • Which Nango integrations are missing credential fields, and which fields?
  • Which Nango connections have an auth error?
  • List the connection ids that belong to organization org_acme.
  • When does the access token of connection conn-ada-github expire?
  • Which syncs are in the ERROR state, and on which connections?

Nango is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.