Adapter: Google BigQuery
Insert rows into a BigQuery table, run a parameterized GoogleSQL query, or poll a query with a cursor (Workload Identity or a service account key).
Purpose
Stream workflow output into an existing BigQuery table or upsert it by key (one MERGE on the columns you name, so replays never duplicate a row), run a parameterized GoogleSQL query and pass the rows to the next step, or read new rows on a schedule as the reader of a polling trigger. It is for healthcare organizations that keep their warehouse in BigQuery. See Google BigQuery for setup, duplicates and access.
Auth
workload-identity(default): the engine's own Google service account on GKE, with no stored key.service-account-key: a stored JSON key, for an engine outside GKE. The token is cached and fetched again once after a 401; a second 401 fails the step.- Upsert needs
roles/bigquery.dataEditoron the dataset (Terraform'sedit) androles/bigquery.jobUseronjobProject: it runs a MERGE job. - Insert needs
bigquery.tables.updateData,bigquery.tables.getandbigquery.datasets.geton the dataset (the Terraform module's insert-only custom role;roles/bigquery.dataEditoralso works but can read rows and delete tables). Query and poll needroles/bigquery.dataVieweron the dataset androles/bigquery.jobUseronjobProject(defaultproject). - It takes the shared connection options for its BigQuery requests. A service account key's token exchange does not go through the proxy, and the profile shows a warning when both are set; use Workload Identity behind a proxy. With
workload-identitya profile CA (tlsCaPem) is refused: the requests carry the engine's own Google token, so they are verified against the system CAs only.
Settings
Auth is chosen with authType: workload-identity, service-account-key (default workload-identity). Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.
| Setting | Type | Required | Default | Secret | Description |
|---|---|---|---|---|---|
project | string | Yes | No | Google Cloud project ID that holds the dataset. | |
dataset | string | Yes | No | BigQuery dataset ID, e.g. clinical_rows. | |
jobProject | string | No | No | Project where query, poll and upsert jobs run and are billed. Defaults to project; set it for a separate billing project or a VPC Service Controls perimeter. | |
location | string | No | No | Dataset location for query, poll and upsert jobs (US, EU, europe-west2). Sent only when set. | |
authType | enum: workload-identity, service-account-key | No | workload-identity | No | workload-identity: the engine's own Google service account (GKE), no stored key. service-account-key: a stored JSON key, for an engine outside GKE. |
credentials | object | No | |||
credentials.serviceAccountKey | string | No | Yes | Service account JSON key (encrypted at rest). Used when authType is service-account-key. | |
maximumBytesBilled | number | No | 10737418240 | No | Most bytes one query, poll or upsert job may bill; a bigger job fails without running (default 10 GiB). |
kmsKeyName | string | No | No | Customer-managed key (CMEK) for query result tables: projects/P/locations/L/keyRings/R/cryptoKeys/K. | |
timeout | number | No | 30000 | No | Timeout for each HTTP request in milliseconds. |
queryTimeoutMs | number | No | 120000 | No | Longest wait for a query or poll job to finish, in milliseconds. |
tlsCaPem | string | No | Yes | PEM CA certificate(s) to verify the server against. See tlsCaMode. | |
tlsCaMode | enum: replace, add | No | No | Trust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem. | |
tlsClientCertPem | string | No | Yes | PEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem. | |
tlsClientKeyPem | string | No | Yes | PEM private key for the client certificate (encrypted at rest). | |
tlsClientPfx | string | No | Yes | Client certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair. | |
tlsClientPassphrase | string | No | Yes | Passphrase of the PKCS#12 bundle. | |
tlsMinVersion | enum: TLSv1.2, TLSv1.3 | No | No | Lowest TLS version to accept (default TLSv1.2). | |
proxyUrl | url | No | No | HTTP(S) proxy, e.g. http://proxy.example.test:3128 (opens in a new tab). The proxy host must pass the SSRF rules (SSRF_ALLOWLIST for a private one). | |
proxyUsername | string | No | No | Proxy user (Basic auth). | |
proxyPassword | string | No | Yes | Proxy password. | |
noProxy | array of string | No | No | Hosts sent direct, not through the proxy: a name (and its subdomains), .suffix, host:port or *. |
Actions
A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.
| Action | What it does | Step parameters | Keys a message may supply |
|---|---|---|---|
insert | Stream rows into an existing table (tabledata.insertAll), with a retry-stable insertId per row. | table, rows?, onRowError?, ignoreUnknownValues?, rowIdColumn?, jsonColumns?, checkSchema? | rows |
upsert | Upsert by key: one parameterized MERGE on the key columns, so a resend or replay never duplicates a row; rows are checked against the table first. | table, keyColumns, rows?, ignoreUnknownValues?, maxConcurrentMerges? | rows |
query | Run one GoogleSQL statement with :name or @name parameters; returns rows. | sql, params?, paramTypes?, maxRows? | params |
poll | Polling trigger read: a query using :cursor and :limit, one message per row. | sql, cursor?, cursorInitial?, limit?, params?, paramTypes? | None |
Minimal example
The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.
{
"name": "Google BigQuery (example)",
"adapterType": "bigquery",
"config": {
"project": "demohealth-prod",
"dataset": "clinical_rows"
}
}Limits
- An insert takes at most 10,000 rows and 9.5 MB. A bigger batch fails before anything is sent; split it with a loop or a batch transform. The adapter never splits a batch for you.
- Each row gets an
insertIdthat stays the same across the step's retries, so BigQuery drops a retried row for about 60 seconds. A replay or a new execution gets new IDs, so it is not deduplicated. See Duplicates, retries and replays. - The table must exist: the adapter creates no tables or datasets, and the table, dataset and project come from the profile and the step, never from a message.
- An upsert checks every row against the table's columns before its MERGE, and an insert does with
checkSchema: true: an unknown field, a missingREQUIREDcolumn or a missing key value fails the step naming the row number and the column, never a value. Otherwise BigQuery reports a bad inserted row by row number, reason and column, and nothing else. WithonRowError: fail(default) nothing lands; withskipthe good rows land and the bad ones come back asfailedRows. - An upsert sends its rows as one typed query parameter and matches on
keyColumns; a retry, resend or replay of the same rows leaves one row per key. DML contention on the table (a full DML queue, a concurrent update, a DML quota) is retried after a randomized wait, and each engine replica runs at mostmaxConcurrentMerges(default 1) MERGEs at once per table. For a high-volume feed, put a Collector before the upsert so a whole window is one MERGE; see High-volume feeds. See Upsert by key. - Send a JSON column's value as a string (
JSON.stringify), and an INT64 or NUMERIC value above 2^53 as a string. - Every query and poll job carries
maximumBytesBilled(default 10 GiB). A job that would scan more fails without running. - A query returns at most
maxRowsrows (at most 10,000, default 1,000) and reportstruncatedwhen there were more. A poll returns at mostlimitrows (at most 10,000, default 100); keeplimitabove the number of rows that share one cursor value. - The SQL is one GoogleSQL query (
SELECT,WITHorFROMfirst); DML, DDL and scripts are refused. Values are bound as:nameor@nameparameters, never pasted into the SQL;{{...}}templates and positional?are refused.