Install
$ agentstack add skill-estuary-agent-skills-materialize-bigquery-create ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Create BigQuery Materialization
Create a BigQuery materialization using flowctl to stream data from Estuary collections into BigQuery tables.
Applies to: materialize-bigquery
Step 0: Load Connector Documentation
Before proceeding, fetch the official connector docs for prerequisites, config reference, and setup instructions.
Load the docs page: https://docs.estuary.dev/reference/Connectors/materialization-connectors/BigQuery/
Use WebFetch to load this page. It covers:
- Prerequisites (GCS bucket, service account, IAM roles, dataset)
- Full config property reference
- gcloud CLI commands for setup
- Advanced options (delta updates, hard deletes, sync schedule)
Search Kapa for tribal knowledge (if the Estuary MCP is configured):
Search kapa ai knowledge sources for "materialize bigquery common issues"
If Kapa MCP is not configured, the user can set it up: https://docs.estuary.dev/features/mcp-integration/
This skill provides the flowctl workflow and troubleshooting that docs don't cover.
Step 1: Gather Requirements
Before writing any YAML, ask the user:
- GCP project ID? — The Google Cloud project
- BigQuery dataset and region? — Target dataset name and GCP region
- GCS staging bucket? — Bucket name for staging data (must be same region as dataset!)
- Authentication method? — Service account key (most common) or GCP IAM (workload identity federation)
- Non-default data plane? — Most users use the default. Ask if they need a non-default data plane.
- Source collections? — Which Estuary collections to materialize
- Hard deletes? — Off by default. Without it, deleted rows stay in BigQuery marked with
_meta/op: 'd'. Enable to physically remove them. - Delta updates? — Off by default. Switches from one-row-per-key (standard merge) to append-only. Use for event logs or history tables.
- Sync schedule? — Controls how often batches are written to BigQuery (default: 30 minutes,
0sfor real-time). Affects latency and compute cost.
CRITICAL: The GCS staging bucket and BigQuery dataset must be in the same GCP region. Region mismatch is the most common setup error.
Step 2: Find the Correct Connector Version
Always use the latest numbered version tag. Query the connector registry:
flowctl raw get --table connector_tags \
--query 'documentation_url=eq.https://go.estuary.dev/materialize-bigquery' \
--query 'select=image_tag,documentation_url' \
--output yaml
Use the returned image_tag — never hardcode a version.
Step 3: Help User Complete Prerequisites
Walk the user through prerequisites from the docs loaded in Step 0:
- GCS staging bucket — Create in the same region as the BigQuery dataset
- Service account — Create with required IAM roles:
bigquery.dataEditor— create/update tablesbigquery.jobUser— run BigQuery jobsbigquery.readSessionUser— read session accessstorage.objectAdmin— read/write staging files in GCS bucket
- BigQuery dataset — Create if it doesn't exist
- Service account key — Generate JSON key file
Refer to the docs page for exact gcloud commands.
Step 4: Create the Spec File
Build flow.yaml using the config reference from the docs. Minimal required config:
materializations:
//materialize-bigquery:
endpoint:
connector:
image: ghcr.io/estuary/materialize-bigquery:
config:
project_id: ""
dataset: ""
bucket: ""
bucket_path: "estuary-staging"
region: ""
# Option A: Service account key (most common)
credentials_json: |
{
...full service account key JSON...
}
# Option B: GCP IAM (workload identity federation)
# credentials:
# auth_type: "GCPIAM"
# gcp_service_account_to_impersonate: ""
# gcp_workload_identity_pool_audience: ""
bindings:
- source: /
resource:
table: ""
dataset: ""
Important: bucket is just the bucket name — no gs:// prefix. region must match both bucket and dataset.
Step 5: Publish
flowctl catalog publish --source flow.yaml --auto-approve
Step 6: Verify
# Check status
flowctl catalog status //materialize-bigquery
# View logs
flowctl logs --task //materialize-bigquery --since 5m | jq -c '{ts, message}'
Status progression:
PENDING— Normal for ~30 seconds during shard assignmentBACKFILLING— Initial data sync from collectionsOK— Running normally with real-time updates
Troubleshooting
"no such bucket" or "bucket does not exist"
Cause: GCS bucket doesn't exist or name is incorrect
Fix: Create the bucket first — see docs for gcloud command. Ensure no gs:// prefix in config.
"not authorized to write to bucket" or storage access denied
Cause: Service account lacks permissions on the GCS bucket
Fix: Grant roles/storage.objectAdmin on the bucket — see docs for gcloud command.
"Error 409: Already Exists: Dataset"
Cause: Service account can't see the existing dataset due to missing permissions, so it tries to create it
Fix: This paradoxical error means the dataset exists but the service account can't list it. Grant bigquery.dataEditor and bigquery.jobUser at the project level.
"accessDenied" or "403 Forbidden" on BigQuery
Cause: Missing BigQuery IAM roles
Fix: Ensure all three roles are granted: bigquery.dataEditor, bigquery.jobUser, bigquery.readSessionUser. See docs for gcloud commands.
"Invalid credentials" or authentication failures
Cause: Service account key is invalid, incomplete, or malformed
Fix:
- Regenerate the key
- Ensure entire JSON content is included (including
{and}) - Use YAML
|for multiline credentials_json
"BucketRegionError" or 301 status
Cause: GCS bucket is in a different region than the BigQuery dataset
Fix: Both must be in the same region. Check with gcloud — see docs. Recreate whichever is easier to move.
Staging files accumulating in bucket
Cause: Materialization failed during "store" phase before cleanup
Fix: The connector normally cleans up staging files. If files accumulate, check logs for errors, fix the underlying issue, then manually delete old staging files.
"jobInternalError" or "Error 400" from BigQuery
Cause: Transient BigQuery backend error
Fix: Estuary automatically retries these. If persistent, check BigQuery service status and logs for specific error details.
Materialization stuck in PENDING
Wait 30-60 seconds — this is normal during shard assignment. If still stuck:
flowctl logs --task //materialize-bigquery --since 5m | jq 'select(.level == "error")'
Related Skills
connector-disable-enable— Pause/restart existing materializationsconnector-delete-recreate— Nuclear option for stuck materializationsestuary-logs— Deep log analysisestuary-catalog-status— Status checking
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: estuary
- Source: estuary/agent-skills
- License: Apache-2.0
- Homepage: https://estuary.dev
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.