BigQuery Action Block
What it does: Runs SQL against Google BigQuery, streams rows into tables, and manages datasets and tables — straight from a workflow.
📊
In simple terms: Ask your warehouse a question in SQL and get back a clean array of row objects you can loop over, feed to an LLM, or push into a report. You can also write events back into BigQuery as they happen.
Credentials
| Field | Required | Description |
|---|---|---|
| Service Account JSON | Yes | The full contents of a service account JSON key file (client_email + private_key are used to mint an access token) |
| Default Project ID | No | Used when the block leaves Project ID empty; falls back to project_id inside the JSON key |
Create the service account in Google Cloud Console → IAM & Admin → Service Accounts, grant it BigQuery Data Editor and BigQuery Job User on the project, then download a JSON key.
Actions
| Action | What it does | Output |
|---|---|---|
| Run Query | Runs a Standard SQL query, polling until the job completes | rows (array of plain objects), rowCount, totalRows, jobId, schema, raw |
| Insert Rows | Streams a JSON array of row objects into a table (insertAll) | insertedRows, raw — reports insertErrors as a failure |
| List Datasets | Lists datasets in the project | Datasets list |
| List Tables | Lists tables in a dataset | Tables list |
| Get Table Schema | Reads a table's column definitions | fields, numRows, location, raw |
| Create Dataset | Creates a dataset in a location | Dataset resource |
| Create Table | Creates a table from JSON schema fields | Table resource |
| Delete Table | Permanently deletes a table | { deleted: true } |
| Get Job | Fetches a BigQuery job by id | Job resource |
Fields
projectId, datasetId, tableId, query, params, maxResults, timeoutMs, location, rows, schemaFields, ignoreUnknownValues, skipInvalidRows, jobId, defaultDataset — all accept {{variables}}.
Tips
- Query parameters avoid SQL injection. Named form:
[{"name":"min","type":"INT64","value":"100"}]used as@min. A plain array like["abc", 5]becomes positional?parameters. - Timeout (ms) is both the initial query wait and the polling deadline — raise it for heavy scans instead of splitting the query.
- Set Location whenever the dataset is not in the project's default region (
EU,asia-south1, …), otherwise BigQuery returns "not found". - Rows from Run Query are already typed (INT64/FLOAT64 → number, BOOL → boolean), so
{{bigquery.rows[0].total}}works directly. Very large integers stay strings to avoid precision loss. - Insert Rows uses the streaming buffer: rows appear in queries within seconds but cannot be updated or deleted for a short window.