Search all guides

Reference · Tools

Google BigQuery integration

Execute SQL queries and insert rows into Google BigQuery tables via the BigQuery REST API.

Action Data & Storage v1

The Google BigQuery node executes SQL queries and inserts rows into BigQuery tables directly from your workflow. Use it to run analytical queries against large datasets and pipe results into downstream nodes — for example, pulling daily sales aggregates and sending them to a Slack report. It supports both OAuth2 and Service Account authentication.

Works as
Action
Tool name
google_bigquery
Operations
2 — Execute Query , Insert
Parameters
17
Outputs
Output, Error
Credentials
Google BigQuery OAuth2 , Google Service Account
Official docs
Google BigQuery docs docs.cloud.google.com

What you can build with Google BigQuery

  • Run a SQL query against a BigQuery dataset and get the rows.
  • Insert the incoming items as rows into a BigQuery table.
  • Run a parameterized query with values from the previous step.
  • Count rows in a BigQuery table with an aggregate query.
  • Load daily metrics into a reporting table in BigQuery.

Overview

Execute SQL queries and insert rows into Google BigQuery tables via the BigQuery REST API.

Node Type

Action — processes input items and produces output

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool supports two authentication methods — configure one of them: Google BigQuery OAuth2 or Google Service Account. See the Credentials Guide for setup instructions.

Operations

OperationValueDescription
Execute QueryexecuteQueryExecute a SQL query
InsertinsertInsert rows in a table

Parameters

Execute Query

ParameterTypeRequiredDefaultDescription
SQL QuerystringYes—SQL query to execute. Standard SQL by default; enable “Use Legacy SQL” option for legacy syntax.
Return AllbooleanNofalseWhether to return all result rows or only up to the specified limit.
LimitnumberNo50Maximum number of rows to return. (shown when Return All is false)
Options (queryOptions)collectionNo{}
— Default DatasetstringNo—If not set, all table names must be fully qualified (datasetId.tableId).
— Dry RunbooleanNofalseIf true, BigQuery validates but does not execute the query. Returns statistics (bytes processed, etc.).
— Include Schema in OutputbooleanNofalseWhether to include a _schema key in each output row with the table schema.
— Location (Region)stringNo—Location or region where the data will be processed. Required when the dataset is in a non-US/EU location.
— Maximum Bytes BilledstringNo—Limits bytes billed for this query. Queries exceeding this will fail without charge.
— Max Results Per PagenumberNo1000Maximum number of rows per result page. Does not affect the total rows returned.
— Timeout (ms)numberNo10000How long to wait for query completion in milliseconds.
— Raw OutputbooleanNofalseReturn the raw BigQuery API response instead of simplified row objects.
— Return Integers as NumbersbooleanNofalseWhen enabled, integer and numeric values are returned as JavaScript numbers instead of strings.
— Use Legacy SQLbooleanNofalseUse BigQuery’s legacy SQL dialect instead of standard SQL.
Query Parameters (Named)fixedCollectionNo{"namedParameters":[]}Named parameters for parameterized queries (standard SQL only). Use @paramName in the query.
— NamestringNo—Parameter name (without the @ prefix).
— ValuestringNo—The string value for this parameter.

Insert

ParameterTypeRequiredDefaultDescription
Dataset IDstringYes—The ID of the BigQuery dataset containing the target table.
Table IDstringYes—The ID of the BigQuery table to insert rows into.
Data ModeoptionsNoautoMapHow to map incoming item data to BigQuery table columns.
Options: autoMap (automatically map input fields to table columns by matching field names to schema field names), define (manually specify each field name and value to insert)
Fields to SendfixedCollectionNo{}Field name/value pairs to insert (used in “Map Each Field Below” mode). (shown when Data Mode is define)
— Field NamestringNo—The BigQuery table column name.
— Field ValuestringNo—The value to insert into this column.
Options (insertOptions)collectionNo{}
— Batch SizenumberNo100Number of rows to send per insertAll API request. Increase for higher throughput, decrease to avoid payload size limits.
— Ignore Unknown ValuesbooleanNofalseWhether to accept rows with values for fields not present in the table schema.
— Skip Invalid RowsbooleanNofalseWhether to insert valid rows even when some rows are invalid.
— Template SuffixstringNo—Creates a new table named {destinationTable}{templateSuffix} and inserts rows there.
— Trace IDstringNo—Unique request ID for debugging (UUID recommended). If omitted, a UUID v4 is auto-generated.

All Operations

ParameterTypeRequiredDefaultDescription
AuthenticationoptionsNo(current default)Authentication method to use.
Options: the authentication choices available to your workspace — pick one from the dropdown.
Google AccountcredentialNo—Connect or select your Google account. (shown when Authentication is oAuth2)
Service Account EmailstringYes—The email address of the Google service account. (shown when Authentication is serviceAccount)
Private KeystringYes—The private key from the service account JSON key file. (shown when Authentication is serviceAccount)
Project IDstringYes—The Google Cloud project ID that contains the BigQuery dataset.
Max ConcurrencynumberNo5Maximum number of items to process concurrently.

Output Data

This node replaces the item JSON rather than merging into it — output items carry the query rows or the insert summary and nothing else.

Execute Query fans out: each input item runs its own query, and every returned row becomes its own output item. Rows are simplified against the result schema, so each column is a top-level property named after the column:

{
  "customer_id": "1042",
  "order_count": "17",
  "lifetime_value": "8420.50"
}
  • Values arrive as strings by default, the way the BigQuery REST API returns them. Turn on Return Integers as Numbers to receive integer and numeric columns as JavaScript numbers.
  • With Include Schema in Output on, each row also carries _schema — the list of field definitions for the result.
  • With Raw Output on, or on a Dry Run, the node emits one item holding BigQuery’s unmodified API response instead of simplified rows. A dry run is how you check what a query would cost without running it.
  • A query that returns no rows at all emits a single item carrying success: true.

Insert works differently: every input item is treated as a row and the whole batch is written together, so the node emits one summary item for the run rather than one item per input:

{
  "success": true,
  "insertedCount": 250,
  "totalRows": 252,
  "errorCount": 2,
  "errors": [
    { "index": 17, "message": "Row 17 failed: …" }
  ]
}
  • errors[].index is the position of the failing row in the batch, so you can trace it back to the input item.
  • With Skip Invalid Rows on, BigQuery writes the valid rows and the rejected ones are not reported as item errors.
  • If every row fails, the node raises an error for the node as a whole rather than returning a summary.

Reference results downstream by column name, e.g. {{ $json.customer_id }} or {{ $json.insertedCount }}.

Example Configuration

Run a query and return the first 100 rows:

{
  "type": "google_bigquery",
  "parameters": {
    "authentication": "oAuth2",
    "operation": "executeQuery",
    "projectId": "my-gcp-project",
    "sqlQuery": "SELECT customer_id, COUNT(*) AS order_count FROM `sales.orders` GROUP BY customer_id",
    "returnAll": false,
    "limit": 100
  }
}

Run a parameterized query — reference each parameter as @name in the SQL:

{
  "type": "google_bigquery",
  "parameters": {
    "authentication": "oAuth2",
    "operation": "executeQuery",
    "projectId": "my-gcp-project",
    "sqlQuery": "SELECT * FROM `sales.orders` WHERE status = @status AND total > @minTotal",
    "returnAll": true,
    "queryParameters": {
      "namedParameters": [
        { "name": "status", "value": "{{ $json.status }}" },
        { "name": "minTotal", "value": "1000" }
      ]
    },
    "queryOptions": {
      "defaultDataset": "sales",
      "location": "europe-west3",
      "returnAsNumbers": true,
      "maximumBytesBilled": "1000000000"
    }
  }
}

Validate a query and see what it would cost, without running it:

{
  "type": "google_bigquery",
  "parameters": {
    "authentication": "oAuth2",
    "operation": "executeQuery",
    "projectId": "my-gcp-project",
    "sqlQuery": "SELECT * FROM `sales.orders`",
    "queryOptions": {
      "dryRun": true,
      "includeSchema": true,
      "timeoutMs": 10000
    }
  }
}

Insert every incoming item as a row, matching properties to column names:

{
  "type": "google_bigquery",
  "parameters": {
    "authentication": "serviceAccount",
    "serviceAccountEmail": "my-service-account@my-gcp-project.iam.gserviceaccount.com",
    "operation": "insert",
    "projectId": "my-gcp-project",
    "datasetId": "analytics",
    "tableId": "events",
    "dataMode": "autoMap",
    "insertOptions": {
      "batchSize": 500,
      "ignoreUnknownValues": true,
      "skipInvalidRows": true
    }
  }
}

Insert with each column mapped explicitly:

{
  "type": "google_bigquery",
  "parameters": {
    "authentication": "oAuth2",
    "operation": "insert",
    "projectId": "my-gcp-project",
    "datasetId": "analytics",
    "tableId": "events",
    "dataMode": "define",
    "fields": {
      "values": [
        { "fieldId": "event_name", "fieldValue": "{{ $json.name }}" },
        { "fieldId": "user_id", "fieldValue": "{{ $json.userId }}" },
        { "fieldId": "occurred_at", "fieldValue": "{{ $json.timestamp }}" }
      ]
    },
    "insertOptions": {
      "templateSuffix": "_2026"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Execute SQL queries and insert rows into Google BigQuery tables with support for parameterized queries and multiple SQL dialects. Use when you need to run analytical queries on large datasets or load data into BigQuery. Returns query result rows or insert confirmation.

Frequently asked questions

What authentication options does this node support?

The node supports two credential types: Google BigQuery OAuth2 (googleBigQueryOAuth2Api) for user-delegated access, and Google Service Account (googleApi) for server-to-server workflows. Service Account credentials are typically the right choice for automated pipelines running without a human in the loop, while OAuth2 is more appropriate when the workflow acts on behalf of a specific user.

Can I run parameterized SQL queries, or do I have to interpolate values into the query string?

Yes, the node supports parameterized queries, which means you can pass values as parameters rather than concatenating them into the SQL string. This is the safer approach — it avoids SQL injection risks and handles type coercion correctly when working with dates, integers, or other typed BigQuery columns.

Does the node support both Standard SQL and Legacy SQL dialects?

Yes, the node exposes support for multiple SQL dialects. If you are working with older BigQuery datasets or scripts written against the Legacy SQL syntax, you can switch dialects. For new work, Standard SQL is the recommended default and is what most BigQuery documentation assumes.

What does the node return after a query or insert?

For SQL queries, the node outputs the result rows on its main output, which you can pass directly to subsequent nodes for processing, filtering, or transformation. For insert operations, it returns a confirmation of the insert rather than the inserted rows themselves. Either way, there is a single output channel — no separate error branch.

When should I use this node versus a generic HTTP node to call the BigQuery API?

Use this node when your goal is to run a SQL query or insert rows — those are the two operations it is purpose-built for. It handles OAuth token management, request formatting against the BigQuery REST API, and result parsing automatically. A generic HTTP node would require you to construct all of that manually, which adds complexity without benefit for these common use cases.

Build with Google BigQuery

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Google BigQuery OAuth2 credentials first.

Open BusyBot

Last reviewed . Spotted something wrong? Tell us.