Why This POC?
Many businesses rely on BigQuery for analytics but struggle with manual processes for triggering actions based on query results. This POC will:- Extract data from BigQuery.
- Process and filter results in N8N.
- Trigger actions (e.g., Slack alerts, email notifications) based on conditions.
Prerequisites
- A free or paid N8N instance (cloud or self-hosted).
- Google Cloud Platform (GCP) account with BigQuery access.
- A BigQuery dataset and table (we’ll use a sample dataset for this demo).
Step 1: Set Up BigQuery Credentials in N8N
- Go to GCP Console → IAM & Admin → Service Accounts.
- Create a new service account with the BigQuery User and BigQuery Data Viewer roles.
- Generate a JSON key and download it.
- In N8N:
- Add the BigQuery node (under Google).
- Upload the JSON key and name the credential (e.g., BigQuery-POC).
Step 2: Query Data from BigQuery
For this POC, let’s assume we’re tracking customer support tickets and want to flag unresolved tickets older than 7 days.- Add a BigQuery node to your N8N workflow.
- Configure the node:
- Project ID: Your GCP project ID.
- Dataset ID: The dataset containing your table (e.g., support_data).
- Write the query:
SELECT ticket_id, customer_email, created_at, status FROM support_data.tickets WHERE status != 'resolved' AND created_at < DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)#output{codeBox}
- Test the node to ensure data is returned.
Step 3: Filter and Process Results
Use N8N’s Function node or IF node to refine results:- Add an IF node to check if unresolved tickets exist:
- Condition: {{ $node["BigQuery"].json["rows"].length > 0 }}
- If true, proceed to notifications; else, end the workflow.
Step 4: Trigger Actions (Slack/Email)
- Add a Slack node (or Email/SMS node).
- Configure it to post a message like:
- Alert: {{ $node["IF"].json["rows"].length }} unresolved tickets older than 7 days!
- Alternatively, use an HTTP node to trigger a webhook (e.g., Zapier, internal API).
Step 5: Schedule the Workflow
- Add a Schedule Trigger node to run daily.
- Set the cron expression (e.g., 0 9 * * * for 9 AM daily).
Why This POC Matters
This automation:- Saves time by replacing manual checks.
- Reduces errors with consistent query execution.
- Scales easily — add more actions (e.g., CRM updates, spreadsheets).
Next Steps
- Expand by writing resolved tickets back to BigQuery.
- Integrate with CRM tools like Salesforce or HubSpot.
By following this tutorial, you’ve built a scalable, no-code automation — proving the power of N8N and BigQuery. Try adapting it to your use case!
Need a custom automation solution?
{alertInfo}
- Hire me on Upwork to build tailored workflows for your business.
Stay updated with Developers Group official social media channels:
{alertInfo}
Join free N8N Developers community on Facebook.{alertInfo}
0 Comments