- Search BigQuery with SQL: BigQuery read‑only, user OAuth, SQL text input.
- Gemini BigQuery Analytics with Context: Natural‑language analytics,user OAuth (cloud‑platform scope), centralized OAuth app with background execution supported by default.
Key Features
- Real-time warehouse access – no extra indexing required.
- User-level OAuth ensures results match the caller’s BigQuery permissions.
- Read-only guarantees: write/DDL statements are blocked by the bigquery.readonly scope.
- Glean Agents can combine the results from this action with unstructured docs to generate unified answers for users.
Configuration
Prerequisites
- In order to use the Search BigQuery with SQL or Gemini BigQuery Analytics with Context actions, the BigQuery API must be enabled in your Billing GCP Project from Google APIs. Users who are using the action must have the BigQuery User role.
- In order to use the Gemini action, the Gemini Data Analytics API, the Cloud Companion API and the BigQuery API must be enabled for your GCP project. Users must have the Gemini for Google Cloud role, the BigQuery User role and the Gemini Data Analytics Stateless Chat User role.
Setup Google Cloud action pack
This action pack needs the GCP Project ID that you want to bill your queries on. BigQuery determines the location to run the job based on the datasets referenced in the request.- Open the Glean Admin Console → Platform → Actions.
- Click Add and select Google Cloud Actions.
- Enter the GCP Project ID in the Configuration section.
- In Publish Settings, choose the actions that you want to enable in Agents.
- Click Save.
Glean’s OAuth App is currently under review and should be verified soon. Until then admins have to authorize the unverified app. Otherwise users will see a message that the app is unverified when authenticating with this option.
Usage Instructions
Set Up in Agent Builder
Search BigQuery with SQL action
- Add a step and navigate to Select Step → All actions → By data source → Google Cloud.
- Select the action as per your requirement.
-
Setup the action:
- For the action Search BigQuery with SQL, enter the SQL that you want to execute.
select * from acmecorp.customers.dim_all_customers- For the action Gemini BigQuery Analytics with Context, enter a natural‑language query that you wish to execute.
- Add a Respond step.
select * from acmecorp.customers.dim_all_customers
- “Show only the results from the previous step. If >10 rows, present as a table and mention the column names from row 0. Always add citations.”
Grant OAuth access
Because Glean ships with a central, scope-restricted Google OAuth client, customers do not have to create their own. Users simply:- Run an agent that calls a Google Cloud action.
- Follow the Google consent screen and grant permission:
- For Search BigQuery with SQL action, add https://www.googleapis.com/auth/bigquery.readonly in the prompt.
- For Gemini BigQuery Analytics with Context action, add https://www.googleapis.com/auth/cloud-platform in the prompt.
Best Practices and Troubleshooting
- Always supply a valid Project ID; otherwise calls will fail with a 404 error.
- If your queries time out, you can reach out to your Glean account team to raise it. We recommend keeping queries under 120 secs to avoid BigQuery cost spikes.
- If a natural‑language question is ambiguous, include short hints like datasets, measures or filters to improve quality and reduce retries.
Known Limitations
- Only SELECT statements are supported. Write statements (INSERT/UPDATE/DDL) will return “read-only scope” errors.
- SQL results longer than 10 rows are truncated in the current UI. We advise adding a LIMIT or filter.
- Multi-turn conversations are not preserved; each action run is stateless.
- No automatic retries on BigQuery quota or transient errors – rerun the agent if that occurs.
- For more information on limitations for Gemini BigQuery Analytics with Context action, see Data processing limitations.