Skip to content

Fivetran

Fivetran connections, sync status and history, schema config, destinations, transformations and access as SQL tables

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/fivetran/index.md to help me query Fivetran 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 broken connections and failed syncs

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

SELECT schema_name, service, setup_state, failed_at
FROM fivetran.main.connections
WHERE NOT paused AND (setup_state <> 'connected' OR failed_at > coalesce(succeeded_at, TIMESTAMPTZ '1970-01-01'))
ORDER BY failed_at DESC

Quick start

Choose where to run Fivetran, 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 'fivetran' AS fivetran (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-fivetran'
);

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.

fivetran credentials

Fivetran REST API key and secret (a user API key or a system key), sent as HTTP Basic auth

Get these credentials →
secret.sql
CREATE SECRET fivetran (
    TYPE fivetran,
    api_key    '<FIVETRAN_API_KEY>',  -- secret
    api_secret '<FIVETRAN_API_SECRET>',  -- secret
    base_url   '<base_url>',
    page_size  '<page_size>'
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT schema_name, service, setup_state, failed_at
FROM fivetran.main.connections
WHERE NOT paused AND (setup_state <> 'connected' OR failed_at > coalesce(succeeded_at, TIMESTAMPTZ '1970-01-01'))
ORDER BY failed_at 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 'fivetran' AS fivetran (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Fivetran's ELT control plane as SQL: connections and their sync status, schema config, sync history, destinations, transformations, users and teams, read-only from the Fivetran REST API.

Catalog

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

fivetran 2 schemas
main 29 tables

Fivetran-native connections, syncs, destinations, transformations and access, read-only.

Schema examples (12)
Examples (12)

Which account the secret points at

SELECT id, account_name FROM fivetran.main.accounts;

Enabled human users by most recent login (both filters push down)

SELECT email, role, logged_in_at
FROM fivetran.main.users
WHERE active AND user_type = 'REGULAR_USER'
ORDER BY logged_in_at DESC NULLS LAST;

Service accounts holding API keys

SELECT email
FROM fivetran.main.users
WHERE has_api_key AND user_type = 'SERVICE_ACCOUNT'
ORDER BY email;

Teams and their account roles

SELECT name, role FROM fivetran.main.teams ORDER BY name;
8 more examples

Who is in which team

SELECT t.name AS team, u.email, m.role
FROM fivetran.main.team_users m
JOIN fivetran.main.teams t ON t.id = m.team_id
JOIN fivetran.main.users u ON u.id = m.user_id
ORDER BY team, u.email;

Destination roles of one team (team_id pushes down)

SELECT team_id, group_id, role
FROM fivetran.main.team_groups
WHERE team_id = 't_data_eng'
ORDER BY group_id;

Connection grants per team

SELECT team_id, count(*) AS connections
FROM fivetran.main.team_connections
GROUP BY team_id
ORDER BY connections DESC;

Direct destination roles per user

SELECT u.email, g.name AS destination_group, m.role
FROM fivetran.main.user_groups m
JOIN fivetran.main.users u ON u.id = m.user_id
JOIN fivetran.main.groups g ON g.id = m.group_id
ORDER BY u.email;

Connections one user can manage (user_id pushes down)

SELECT user_id, connection_id, role
FROM fivetran.main.user_connections
WHERE user_id = 'u_grace'
ORDER BY connection_id;

Connection count per group

SELECT g.name, count(c.id) AS connections
FROM fivetran.main.groups g
LEFT JOIN fivetran.main.connections c ON c.group_id = g.id
GROUP BY g.name
ORDER BY connections DESC;

Active users of one destination group (both filters push down)

SELECT email, role
FROM fivetran.main.group_users
WHERE group_id = 'g_warehouse' AND active
ORDER BY email;

Destinations that are broken or incomplete

SELECT id, service, region
FROM fivetran.main.destinations
WHERE setup_status <> 'CONNECTED'
ORDER BY id;
Tables
accounts 1 example4 cols

The Fivetran account the API key belongs to (one row)

Columns
idnot null VARCHAR
Fivetran account id.
account_name VARCHAR
Display name of the Fivetran account.
user_id VARCHAR
Id of the user who owns the API key (NULL for a system key).
system_key_id VARCHAR
Id of the system key in use (NULL for a user key).
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (user_id) REFERENCES users(id) · FOREIGN KEY (system_key_id) REFERENCES system_keys(id)
Example

Which account the secret points at

SELECT id, account_name FROM fivetran.main.accounts;
Link
connection_columns 2 examples13 cols

Configured columns of each connection: blocked, hashed, primary key

Columns
connection_idnot null VARCHAR
The connection id.
schema_namenot null VARCHAR
Source schema name.
table_namenot null VARCHAR
Source table name.
column_namenot null VARCHAR
Source column name.
name_in_destination VARCHAR
Column name in the destination.
enabled BOOLEAN
Whether the column syncs (false = blocked).
hashed BOOLEAN
Whether values are hashed before loading.
is_primary_key BOOLEAN
Whether the column is part of the primary key.
table_enabled BOOLEAN
Whether the column's table syncs.
target_data_type VARCHAR
Destination type override, if set.
patch_allowed BOOLEAN
Whether the enabled flag can be changed (enabled_patch_settings.allowed).
patch_reason_code VARCHAR
Why it cannot be changed: SYSTEM_TABLE, SYSTEM_COLUMN, DELETED, OTHER.
patch_reason VARCHAR
Human-readable reason it cannot be changed.
ConstraintsPRIMARY KEY (connection_id, schema_name, table_name, column_name) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Examples (2)

Columns hashed for PII

SELECT connection_id, table_name, column_name
FROM fivetran.main.connection_columns
WHERE hashed
ORDER BY ALL;

Blocked and hashed column counts per connection

SELECT connection_id, count(*) FILTER (WHERE NOT enabled) AS blocked,
  count(*) FILTER (WHERE hashed) AS hashed
FROM fivetran.main.connection_columns
GROUP BY connection_id
ORDER BY connection_id;
Link
connection_errors 1 example6 cols

Current errors of each connection

Columns
connection_idnot null VARCHAR
The connection id.
type VARCHAR
Error type.
title VARCHAR
Short title.
reason VARCHAR
Why it failed.
message VARCHAR
What to do about it.
created_at TIMESTAMP WITH TIME ZONE
When the error was raised.
ConstraintsFOREIGN KEY (connection_id) REFERENCES connections(id)
Example

All open connection errors, newest first

SELECT c.schema_name, e.title, e.created_at
FROM fivetran.main.connection_errors e
JOIN fivetran.main.connections c ON c.id = e.connection_id
ORDER BY e.created_at DESC;
Link
connection_schemas 1 example8 cols

Source schemas of each connection and whether they sync

Columns
connection_idnot null VARCHAR
The connection id.
schema_namenot null VARCHAR
Source schema name.
name_in_destination VARCHAR
Schema name in the destination.
enabled BOOLEAN
Whether the schema syncs.
table_count INTEGER
Count of tables listed in the schema config.
enabled_table_count INTEGER
Count of tables in the schema that sync (enabled).
enable_new_by_default BOOLEAN
Connection setting: new schemas/tables are enabled automatically.
schema_change_handling VARCHAR
Connection setting: ALLOW_ALL, ALLOW_COLUMNS or BLOCK_ALL.
ConstraintsPRIMARY KEY (connection_id, schema_name) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Example

Schema enablement of one connection

SELECT connection_id, schema_name, enabled_table_count, table_count
FROM fivetran.main.connection_schemas
WHERE connection_id = 'c_postgres'
ORDER BY schema_name;
Link
connection_states 1 example2 cols

The saved sync state (cursor) of each connection

Columns
connection_idnot null VARCHAR
The connection id.
state JSON
The connection's state object as JSON (NULL when none).
ConstraintsPRIMARY KEY (connection_id) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Example

Read one field of a connection's state

SELECT connection_id, state->>'lsn' AS lsn
FROM fivetran.main.connection_states
WHERE connection_id = 'c_postgres';
Link
connection_tables 2 examples14 cols

Source tables of each connection: enabled or blocked, sync mode

Columns
connection_idnot null VARCHAR
The connection id.
schema_namenot null VARCHAR
Source schema name.
table_namenot null VARCHAR
Source table name.
name_in_destination VARCHAR
Table name in the destination.
enabled BOOLEAN
Whether the table syncs (false = blocked).
schema_enabled BOOLEAN
Whether the table's schema syncs.
sync_mode VARCHAR
SOFT_DELETE, HISTORY or LIVE.
supports_columns_config BOOLEAN
Whether columns can be configured individually.
supports_history_mode BOOLEAN
Whether history mode is available.
patch_allowed BOOLEAN
Whether the enabled flag can be changed (enabled_patch_settings.allowed).
patch_reason_code VARCHAR
Why it cannot be changed: SYSTEM_TABLE, SYSTEM_COLUMN, DELETED, OTHER.
patch_reason VARCHAR
Human-readable reason it cannot be changed.
parent_table VARCHAR
Parent table for child tables.
column_count INTEGER
Columns listed in the schema config for this table.
ConstraintsPRIMARY KEY (connection_id, schema_name, table_name) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Examples (2)

Blocked (disabled) tables across all connections

SELECT connection_id, schema_name, table_name
FROM fivetran.main.connection_tables
WHERE NOT enabled
ORDER BY ALL;

Enabled tables by sync mode

SELECT sync_mode, count(*) AS tables
FROM fivetran.main.connection_tables
WHERE enabled
GROUP BY sync_mode
ORDER BY tables DESC;
Link
connection_warnings 1 example7 cols

Current per-table warnings of each connection

Columns
connection_idnot null VARCHAR
The connection id.
schema_name VARCHAR
Source schema.
table_name VARCHAR
Source table.
code VARCHAR
Warning code.
message VARCHAR
Warning message.
error_message VARCHAR
Underlying error detail.
created_at TIMESTAMP WITH TIME ZONE
When the warning was raised.
ConstraintsFOREIGN KEY (connection_id) REFERENCES connections(id)
Example

Warning codes by number of affected tables

SELECT code, count(*) AS tables
FROM fivetran.main.connection_warnings
GROUP BY code
ORDER BY tables DESC;
Link
connections 2 examples31 cols

Connections (connectors): source, schedule and sync status

Columns
idnot null VARCHAR
Connection id.
group_id VARCHAR
Group (destination) the connection loads into.
service VARCHAR
Source type, e.g. salesforce, postgres_rds, google_sheets.
service_version INTEGER
Connector implementation version number (an integer that increases with upgrades).
schema_name VARCHAR
Destination schema name (prefix) — the connection's name in the dashboard.
paused BOOLEAN
Whether syncing is paused.
setup_state VARCHAR
connected, incomplete or broken.
sync_state VARCHAR
scheduled, syncing, paused or rescheduled.
update_state VARCHAR
on_schedule or delayed (data is late).
schema_status VARCHAR
Schema discovery status, e.g. ready, blocked_on_capture.
is_historical_sync BOOLEAN
True while the initial / re-sync of all history runs.
rescheduled_for TIMESTAMP WITH TIME ZONE
When a rescheduled sync will run.
succeeded_at TIMESTAMP WITH TIME ZONE
Last successful sync.
failed_at TIMESTAMP WITH TIME ZONE
Last failed sync.
sync_frequency INTEGER
Sync interval in minutes (5, 15, 30, 60, 120, 180, 360, 480, 720, 1440).
schedule_type VARCHAR
auto (Fivetran schedules) or manual (API/trigger only).
daily_sync_time VARCHAR
Time of day for 24-hour syncs, e.g. 02:00.
data_delay_threshold INTEGER
Custom delay threshold in minutes for update_state.
data_delay_sensitivity VARCHAR
LOW, NORMAL, HIGH, CUSTOM or SYNC_FREQUENCY.
pause_after_trial BOOLEAN
Whether the connection pauses when its trial ends.
tasks STRUCT(code VARCHAR, message VARCHAR, details VARCHAR)[]
Actions a user must take (e.g. reconnect), as {code, message, details}.
warnings STRUCT(code VARCHAR, message VARCHAR, details VARCHAR)[]
Non-blocking warnings, as {code, message, details}.
connected_by VARCHAR
Id of the user who created the connection.
created_at TIMESTAMP WITH TIME ZONE
When the connection was created.
networking_method VARCHAR
Directly, SshTunnel, PrivateLink, ProxyAgent, …
hybrid_deployment_agent_id VARCHAR
Hybrid deployment agent running this connection, if any.
proxy_agent_id VARCHAR
Proxy agent used, if any.
private_link_id VARCHAR
Private link used, if any.
data_checks BOOLEAN
Whether data checks are enabled.
config JSON
Source configuration as JSON; passwords, tokens, keys and secrets are masked.
url VARCHAR
Link to the connection's status page in the Fivetran dashboard.
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (group_id) REFERENCES groups(id) · FOREIGN KEY (private_link_id) REFERENCES private_links(id) · FOREIGN KEY (hybrid_deployment_agent_id) REFERENCES hybrid_deployment_agents(id) · FOREIGN KEY (proxy_agent_id) REFERENCES proxy_agents(id)
Examples (2)

Active connections that are broken or whose last sync failed

SELECT schema_name, service, setup_state, failed_at
FROM fivetran.main.connections
WHERE NOT paused AND (setup_state <> 'connected' OR failed_at > coalesce(succeeded_at, TIMESTAMPTZ '1970-01-01'))
ORDER BY failed_at DESC;

Open user tasks in one group (group_id pushes down)

SELECT schema_name, t.code, t.message
FROM fivetran.main.connections,
     unnest(tasks) AS u(t)
WHERE group_id = 'g_lake'
ORDER BY schema_name;
Link
connector_types 1 example10 cols

The catalogue of Fivetran source connector types

Columns
idnot null VARCHAR
Service id (matches connections.service).
name VARCHAR
Display name.
type VARCHAR
Category, e.g. Database, Marketing, Finance, File.
description VARCHAR
Short summary of what the source is.
connector_class VARCHAR
standard or lite.
service_status VARCHAR
general_availability, beta, private_preview, sunset, development.
supported_features VARCHAR[]
Feature ids, e.g. COLUMN_HASHING, HISTORY, CAPTURE_DELETES.
supports_schema_reload BOOLEAN
Whether the schema can be reloaded.
link_to_docs VARCHAR
Setup documentation URL.
icon_url VARCHAR
URL of the connector's logo image.
ConstraintsPRIMARY KEY (id)
Example

Connections per source type, with readable names

SELECT ct.name, count(*) AS connections
FROM fivetran.main.connections c
JOIN fivetran.main.connector_types ct ON ct.id = c.service
GROUP BY ct.name
ORDER BY connections DESC;
Link
destinations 1 example11 cols

Destinations (warehouses and lakes) Fivetran loads into

Columns
idnot null VARCHAR
Destination id (equals its group id).
group_id VARCHAR
The group the destination belongs to.
service VARCHAR
Destination type, e.g. snowflake, big_query, databricks, redshift.
region VARCHAR
Fivetran processing region, e.g. AWS_US_EAST_1.
setup_status VARCHAR
CONNECTED, INCOMPLETE or BROKEN.
time_zone_offset VARCHAR
Time zone offset for daily syncs, e.g. -5.
daylight_saving_time_enabled BOOLEAN
Whether daylight saving time adjusts the offset.
networking_method VARCHAR
Directly, PrivateLink, SshTunnel or ProxyAgent.
private_link_id VARCHAR
Private link used, if any.
hybrid_deployment_agent_id VARCHAR
Hybrid deployment agent used, if any.
proxy_agent_id VARCHAR
Proxy agent used, if any.
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (group_id) REFERENCES groups(id) · FOREIGN KEY (private_link_id) REFERENCES private_links(id) · FOREIGN KEY (hybrid_deployment_agent_id) REFERENCES hybrid_deployment_agents(id) · FOREIGN KEY (proxy_agent_id) REFERENCES proxy_agents(id)
Example

Destinations that are broken or incomplete

SELECT id, service, region
FROM fivetran.main.destinations
WHERE setup_status <> 'CONNECTED'
ORDER BY id;
Link
group_users 1 example14 cols

Users with access to each group (destination)

Columns
group_idnot null VARCHAR
The group id.
user_idnot null VARCHAR
Fivetran user id.
email VARCHAR
Email address.
given_name VARCHAR
First name.
family_name VARCHAR
Last name.
role VARCHAR
Account-level role, e.g. Account Administrator (NULL when none).
active BOOLEAN
True when the user is enabled (allowed to log in); false when suspended.
verified BOOLEAN
Whether the email address is verified.
invited BOOLEAN
Whether the user has a pending invitation.
user_type VARCHAR
REGULAR_USER (a human) or SERVICE_ACCOUNT.
has_api_key BOOLEAN
Whether the user has an API key (including expired ones).
phone VARCHAR
Phone number.
logged_in_at TIMESTAMP WITH TIME ZONE
Last dashboard login.
created_at TIMESTAMP WITH TIME ZONE
When the user was created.
ConstraintsPRIMARY KEY (group_id, user_id) · FOREIGN KEY (group_id) REFERENCES groups(id) · FOREIGN KEY (user_id) REFERENCES users(id)
Example

Active users of one destination group (both filters push down)

SELECT email, role
FROM fivetran.main.group_users
WHERE group_id = 'g_warehouse' AND active
ORDER BY email;
Link
groups 1 example3 cols

Groups: each Fivetran destination and the connections that load into it

Columns
idnot null VARCHAR
Group id (equals the destination id).
name VARCHAR
Group name.
created_at TIMESTAMP WITH TIME ZONE
When the group was created.
ConstraintsPRIMARY KEY (id)
Example

Connection count per group

SELECT g.name, count(c.id) AS connections
FROM fivetran.main.groups g
LEFT JOIN fivetran.main.connections c ON c.group_id = g.id
GROUP BY g.name
ORDER BY connections DESC;
Link
hybrid_deployment_agents 1 example12 cols

Hybrid deployment agents that run syncs in your own environment

Columns
idnot null VARCHAR
Agent id.
display_name VARCHAR
Agent name.
group_id VARCHAR
Group the agent serves.
version VARCHAR
Agent version.
enabled BOOLEAN
Whether the agent is enabled.
online BOOLEAN
Whether the agent is currently connected.
deployment_type VARCHAR
DOCKER, PODMAN, KUBERNETES or SNOWPARK.
registered_at TIMESTAMP WITH TIME ZONE
When the agent registered.
updated_at TIMESTAMP WITH TIME ZONE
Last update.
last_used_at TIMESTAMP WITH TIME ZONE
Last time a sync used it.
created_by VARCHAR
Id of the creating user.
usage STRUCT of 3 fields[]
Connections the agent runs, as {connection_id, schema, service}.
STRUCT[] 3 fields
  • connection_idVARCHAR
  • schemaVARCHAR
  • serviceVARCHAR
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (group_id) REFERENCES groups(id)
Example

Agents of one group with health and load (group_id pushes down)

SELECT display_name, version, online, len(usage) AS connections
FROM fivetran.main.hybrid_deployment_agents
WHERE group_id = 'g_lake'
ORDER BY display_name;
Link
log_services 1 example4 cols

External log services Fivetran streams its logs to

Columns
idnot null VARCHAR
Log service id.
service VARCHAR
Log service type, e.g. datadog.
enabled BOOLEAN
Whether logs are being sent.
setup_state VARCHAR
Setup state, e.g. connected.
ConstraintsPRIMARY KEY (id)
Example

Configured log destinations

SELECT service, enabled FROM fivetran.main.log_services ORDER BY service;
Link
proxy_agents 1 example9 cols

Proxy agents that tunnel Fivetran traffic into private networks

Columns
idnot null VARCHAR
Proxy agent id.
display_name VARCHAR
Name.
region VARCHAR
Fivetran region the agent connects to, e.g. AWS_US_EAST_1.
version VARCHAR
Agent version.
status VARCHAR
CONNECTED, NOT_CONNECTED or NOT_FOUND.
connector_count INTEGER
Count of connections routed through the agent.
destination_count INTEGER
Count of destinations routed through the agent.
registered_at TIMESTAMP WITH TIME ZONE
When it registered.
created_by VARCHAR
Id of the creating user.
ConstraintsPRIMARY KEY (id)
Example

Proxy agent health

SELECT display_name, status, connector_count
FROM fivetran.main.proxy_agents
ORDER BY display_name;
Link
roles 1 example6 cols

Roles available in the account (built-in and custom)

Columns
namenot null VARCHAR
Role name.
description VARCHAR
What the role allows.
scope VARCHAR[]
Where the role applies: ACCOUNT, DESTINATION, CONNECTOR, TEAM.
is_custom BOOLEAN
Whether it is a custom role.
is_deprecated BOOLEAN
Whether it is deprecated.
replacement_role_name VARCHAR
Role replacing a deprecated one.
ConstraintsPRIMARY KEY (name)
Example

Current destination-level roles

SELECT name
FROM fivetran.main.roles
WHERE list_contains(scope, 'DESTINATION') AND NOT is_deprecated
ORDER BY name;
Link
syncs 2 examples10 cols

Sync runs of each connection over the last 7 days

Columns
connection_idnot null VARCHAR
The connection id.
idnot null VARCHAR
Fivetran's unique identifier of this sync run (sync_id).
status VARCHAR
COMPLETED, FAILURE, CANCELED, INCOMPLETE, RESCHEDULED or PAUSED.
reason VARCHAR
Failure / cancellation reason (NULL when completed).
started_at TIMESTAMP WITH TIME ZONE
When the sync started.
ended_at TIMESTAMP WITH TIME ZONE
When the sync finished (NULL while running).
duration_seconds DOUBLE
ended_at − started_at in seconds.
extract_volume DOUBLE
Data volume extracted from the source in this sync (Fivetran's stage volume, rows/records as reported by the API).
process_volume DOUBLE
Data volume processed in this sync (Fivetran's stage volume, rows/records as reported by the API).
load_volume DOUBLE
Data volume loaded into the destination in this sync (Fivetran's stage volume, rows/records as reported by the API).
ConstraintsPRIMARY KEY (connection_id, id) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Examples (2)

Failure counts and mean sync duration per connection (last 7 days)

SELECT connection_id,
  count(*) FILTER (WHERE status = 'FAILURE') AS failures, count(*) AS syncs,
  avg(duration_seconds) AS avg_seconds
FROM fivetran.main.syncs
GROUP BY connection_id
ORDER BY failures DESC;

Recent syncs of one connection (connection and time window push down)

SELECT id, status, reason, started_at
FROM fivetran.main.syncs
WHERE connection_id = 'c_postgres' AND started_at >= TIMESTAMPTZ '2026-11-14 00:00:00+00'
ORDER BY started_at DESC;
Link
system_keys 1 example7 cols

System keys (service API keys) and their permissions; key material omitted

Columns
idnot null VARCHAR
System key id.
name VARCHAR
Display name given to the system key.
permissions STRUCT of 4 fields[]
Grants as {resource_type, access_level, ids, group_ids}; ids / group_ids are JSON arrays.
STRUCT[] 4 fields
  • resource_typeVARCHAR
  • access_levelVARCHAR
  • idsVARCHAR
  • group_idsVARCHAR
created_at TIMESTAMP WITH TIME ZONE
When it was created.
updated_at TIMESTAMP WITH TIME ZONE
Last change.
expired_at TIMESTAMP WITH TIME ZONE
When it expires.
last_used_at TIMESTAMP WITH TIME ZONE
Last use.
ConstraintsPRIMARY KEY (id)
Example

System keys with manage permissions

SELECT name, p.resource_type, p.access_level
FROM fivetran.main.system_keys,
     unnest(permissions) AS u(p)
WHERE p.access_level = 'MANAGE'
ORDER BY name;
Link
team_connections 1 example4 cols

Connections each team has a role on

Columns
team_idnot null VARCHAR
The team id.
connection_idnot null VARCHAR
The member connection id.
role VARCHAR
The role granted by this membership.
created_at TIMESTAMP WITH TIME ZONE
When the membership was created.
ConstraintsPRIMARY KEY (team_id, connection_id) · FOREIGN KEY (team_id) REFERENCES teams(id) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Example

Connection grants per team

SELECT team_id, count(*) AS connections
FROM fivetran.main.team_connections
GROUP BY team_id
ORDER BY connections DESC;
Link
team_groups 1 example4 cols

Groups (destinations) each team has a role on

Columns
team_idnot null VARCHAR
The team id.
group_idnot null VARCHAR
The member group id.
role VARCHAR
The role granted by this membership.
created_at TIMESTAMP WITH TIME ZONE
When the membership was created.
ConstraintsPRIMARY KEY (team_id, group_id) · FOREIGN KEY (team_id) REFERENCES teams(id) · FOREIGN KEY (group_id) REFERENCES groups(id)
Example

Destination roles of one team (team_id pushes down)

SELECT team_id, group_id, role
FROM fivetran.main.team_groups
WHERE team_id = 't_data_eng'
ORDER BY group_id;
Link
team_users 1 example4 cols

Users who belong to each Fivetran team, with their team role

Columns
team_idnot null VARCHAR
The team id.
user_idnot null VARCHAR
The member user id.
role VARCHAR
The role granted by this membership.
created_at TIMESTAMP WITH TIME ZONE
When the membership was created.
ConstraintsPRIMARY KEY (team_id, user_id) · FOREIGN KEY (team_id) REFERENCES teams(id) · FOREIGN KEY (user_id) REFERENCES users(id)
Example

Who is in which team

SELECT t.name AS team, u.email, m.role
FROM fivetran.main.team_users m
JOIN fivetran.main.teams t ON t.id = m.team_id
JOIN fivetran.main.users u ON u.id = m.user_id
ORDER BY team, u.email;
Link
teams 1 example4 cols

Teams in the Fivetran account and their account-level roles

Columns
idnot null VARCHAR
Team id.
name VARCHAR
Team name.
description VARCHAR
Team description.
role VARCHAR
The team's account-level role (NULL when none).
ConstraintsPRIMARY KEY (id)
Example

Teams and their account roles

SELECT name, role FROM fivetran.main.teams ORDER BY name;
Link
transformation_projects 1 example5 cols

dbt projects connected to Fivetran Transformations

Columns
idnot null VARCHAR
Project id.
type VARCHAR
Project type (DBT_CORE).
group_id VARCHAR
Group whose destination the project builds in.
created_at TIMESTAMP WITH TIME ZONE
When it was created.
created_by_id VARCHAR
Id of the creating user.
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (group_id) REFERENCES groups(id)
Example

Transformations per dbt project

SELECT p.id, count(t.id) AS transformations
FROM fivetran.main.transformation_projects p
LEFT JOIN fivetran.main.transformations t ON t.project_id = p.id
GROUP BY p.id
ORDER BY p.id;
Link
transformations 2 examples18 cols

Transformations (dbt Core and Quickstart) with their last run

Columns
idnot null VARCHAR
Transformation id.
type VARCHAR
DBT_CORE or QUICKSTART.
status VARCHAR
Latest run: NEW, SCHEDULING, RUNNING, SUCCEEDED, FAILED, PARTIALLY_SUCCEEDED, …
paused BOOLEAN
Whether the schedule is paused.
last_started_at TIMESTAMP WITH TIME ZONE
Latest run start.
last_ended_at TIMESTAMP WITH TIME ZONE
Latest run end.
output_model_names VARCHAR[]
Models the transformation builds.
project_id VARCHAR
dbt project id (DBT_CORE).
schedule_type VARCHAR
Schedule kind: 'INTEGRATED' (after connection syncs), 'TIME_OF_DAY', 'INTERVAL' or 'CRON'.
time_of_day VARCHAR
Time of day for TIME_OF_DAY schedules.
interval_minutes INTEGER
Interval between runs, in minutes (interval schedules only).
cron VARCHAR[]
Cron expressions for CRON schedules.
days_of_week VARCHAR[]
Days the schedule runs.
connection_ids VARCHAR[]
Connections that trigger an INTEGRATED schedule.
smart_syncing BOOLEAN
Whether runs wait for upstream syncs.
created_at TIMESTAMP WITH TIME ZONE
When it was created.
created_by_id VARCHAR
Id of the creating user.
transformation_config JSON
Type-specific configuration (dbt steps or Quickstart package).
ConstraintsPRIMARY KEY (id)
Examples (2)

Active transformations with their latest outcome and runtime

SELECT id, type, status, last_ended_at - last_started_at AS last_runtime
FROM fivetran.main.transformations
WHERE NOT paused
ORDER BY last_started_at DESC;

Models built by dbt Core transformations (type pushes down)

SELECT id, unnest(output_model_names) AS model
FROM fivetran.main.transformations
WHERE type = 'DBT_CORE'
ORDER BY ALL;
Link
user_connections 1 example4 cols

Connections each user has a direct role on

Columns
user_idnot null VARCHAR
The user id.
connection_idnot null VARCHAR
The member connection id.
role VARCHAR
The role granted by this membership.
created_at TIMESTAMP WITH TIME ZONE
When the membership was created.
ConstraintsPRIMARY KEY (user_id, connection_id) · FOREIGN KEY (user_id) REFERENCES users(id) · FOREIGN KEY (connection_id) REFERENCES connections(id)
Example

Connections one user can manage (user_id pushes down)

SELECT user_id, connection_id, role
FROM fivetran.main.user_connections
WHERE user_id = 'u_grace'
ORDER BY connection_id;
Link
user_groups 1 example4 cols

Groups (destinations) each user has a direct role on

Columns
user_idnot null VARCHAR
The user id.
group_idnot null VARCHAR
The member group id.
role VARCHAR
The role granted by this membership.
created_at TIMESTAMP WITH TIME ZONE
When the membership was created.
ConstraintsPRIMARY KEY (user_id, group_id) · FOREIGN KEY (user_id) REFERENCES users(id) · FOREIGN KEY (group_id) REFERENCES groups(id)
Example

Direct destination roles per user

SELECT u.email, g.name AS destination_group, m.role
FROM fivetran.main.user_groups m
JOIN fivetran.main.users u ON u.id = m.user_id
JOIN fivetran.main.groups g ON g.id = m.group_id
ORDER BY u.email;
Link
users 2 examples13 cols

Users of the Fivetran account with their roles and login status

Columns
idnot null VARCHAR
Fivetran user id.
email VARCHAR
Email address.
given_name VARCHAR
First name.
family_name VARCHAR
Last name.
role VARCHAR
Account-level role, e.g. Account Administrator (NULL when none).
active BOOLEAN
True when the user is enabled (allowed to log in); false when suspended.
verified BOOLEAN
Whether the email address is verified.
invited BOOLEAN
Whether the user has a pending invitation.
user_type VARCHAR
REGULAR_USER (a human) or SERVICE_ACCOUNT.
has_api_key BOOLEAN
Whether the user has an API key (including expired ones).
phone VARCHAR
Phone number.
logged_in_at TIMESTAMP WITH TIME ZONE
Last dashboard login.
created_at TIMESTAMP WITH TIME ZONE
When the user was created.
ConstraintsPRIMARY KEY (id)
Examples (2)

Enabled human users by most recent login (both filters push down)

SELECT email, role, logged_in_at
FROM fivetran.main.users
WHERE active AND user_type = 'REGULAR_USER'
ORDER BY logged_in_at DESC NULLS LAST;

Service accounts holding API keys

SELECT email
FROM fivetran.main.users
WHERE has_api_key AND user_type = 'SERVICE_ACCOUNT'
ORDER BY email;
Link
webhooks 1 example9 cols

Webhooks that receive Fivetran events (secrets omitted)

Columns
idnot null VARCHAR
Webhook id.
type VARCHAR
account or group.
group_id VARCHAR
Group for group webhooks.
url VARCHAR
Target URL.
events VARCHAR[]
Subscribed events, e.g. sync_start, sync_end.
active BOOLEAN
Whether the webhook is delivering.
has_secret BOOLEAN
Whether a signing secret is configured (the secret is not exposed).
created_at TIMESTAMP WITH TIME ZONE
When the webhook was created.
created_by VARCHAR
Id of the user who created it.
ConstraintsPRIMARY KEY (id) · FOREIGN KEY (group_id) REFERENCES groups(id)
Example

Active webhooks notified when syncs end

SELECT id, url
FROM fivetran.main.webhooks
WHERE active AND list_contains(events, 'sync_end')
ORDER BY id;
Link
unified 1 table

Fivetran syncs in the shared cross-orchestrator runs shape.

Schema examples (2)
Examples (2)

Run outcomes per Fivetran connection in the unified shape

SELECT pipeline, status, count(*) AS runs
FROM fivetran.unified.runs
GROUP BY ALL
ORDER BY pipeline, status;

Failed syncs since a date (UNION ALL with other orchestrators' unified.runs)

SELECT orchestrator, pipeline, run_id, started_at
FROM fivetran.unified.runs
WHERE status = 'failed' AND started_at >= TIMESTAMPTZ '2026-11-14 00:00:00+00'
ORDER BY started_at DESC;
Tables
runs 2 examples11 cols

Fivetran syncs in the cross-orchestrator unified.runs shape

Columns
orchestratornot null VARCHAR
Always 'fivetran'.
run_idnot null VARCHAR
The Fivetran sync id.
pipeline VARCHAR
The connection's schema name (its name in the dashboard).
statusnot null VARCHAR
queued, running, success, failed, cancelled or skipped.
raw_status VARCHAR
Fivetran's status: COMPLETED, FAILURE, CANCELED, INCOMPLETE, RESCHEDULED, PAUSED.
trigger VARCHAR
How the run was triggered (NULL: Fivetran's sync history does not record it).
queued_at TIMESTAMP WITH TIME ZONE
When the run was queued (NULL: not recorded by Fivetran).
started_at TIMESTAMP WITH TIME ZONE
When the sync started.
ended_at TIMESTAMP WITH TIME ZONE
When the sync finished (NULL while running).
duration_seconds DOUBLE
ended_at − started_at in seconds.
url VARCHAR
The connection's status page in the Fivetran dashboard.
ConstraintsPRIMARY KEY (run_id)
Examples (2)

Run outcomes per Fivetran connection in the unified shape

SELECT pipeline, status, count(*) AS runs
FROM fivetran.unified.runs
GROUP BY ALL
ORDER BY pipeline, status;

Failed syncs since a date (UNION ALL with other orchestrators' unified.runs)

SELECT orchestrator, pipeline, run_id, started_at
FROM fivetran.unified.runs
WHERE status = 'failed' AND started_at >= TIMESTAMPTZ '2026-11-14 00:00:00+00'
ORDER BY started_at DESC;
Link

Credentials

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

fivetran

How to get these credentials

Fivetran REST API key and secret (a user API key or a system key), sent as HTTP Basic auth

secret.sql
CREATE SECRET fivetran (
    TYPE fivetran,
    api_key    '<FIVETRAN_API_KEY>',  -- secret
    api_secret '<FIVETRAN_API_SECRET>',  -- secret
    base_url   '<base_url>',
    page_size  '<page_size>'
);
Key Type Required Description
api_key secret VARCHAR — API key (Account Settings > API Key, or a system key's key).
api_secret secret VARCHAR — API secret paired with the key.
base_url VARCHAR — REST API base URL; defaults to https://api.fivetran.com (http:// is accepted only for 127.0.0.1/localhost).
page_size BIGINT — Rows requested per page (1..1000, default 1000).

The worker doesn't mark which keys are required.

Create the secret in the same session, after attaching fivetran — 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 table's status columns (binds only; create a fivetran secret and drop LIMIT 0 for rows)

SELECT id, service, setup_state, sync_state, succeeded_at, failed_at
FROM fivetran.main.connections
LIMIT 0;

Uses connections

runs_columns — The unified.runs columns (binds only; create a fivetran secret and drop LIMIT 0 for rows)

SELECT orchestrator, run_id, pipeline, status, started_at
FROM fivetran.unified.runs
LIMIT 0;

Uses runs

Which account the secret points at

SELECT id, account_name FROM fivetran.main.accounts

Uses accounts

Enabled human users by most recent login (both filters push down)

SELECT email, role, logged_in_at
FROM fivetran.main.users
WHERE active AND user_type = 'REGULAR_USER'
ORDER BY logged_in_at DESC NULLS LAST

Uses users

Teams and their account roles

SELECT name, role FROM fivetran.main.teams ORDER BY name

Uses teams

Who is in which team

SELECT t.name AS team, u.email, m.role
FROM fivetran.main.team_users m
JOIN fivetran.main.teams t ON t.id = m.team_id
JOIN fivetran.main.users u ON u.id = m.user_id
ORDER BY team, u.email

Uses team_usersteamsusers

32 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 Fivetran connections have a broken setup state? Give their schema names.
  • Which Fivetran connections are paused?
  • List the open user tasks (code and message) on Fivetran connections.
  • How many Fivetran connections does each group (by name) have?
  • Which columns are hashed in the Salesforce connection's schema config?
  • Which source tables are blocked (disabled) across all connections?

Fivetran 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.