NEWSubscribe to Receive Free E-mail UpdatesSubscribe

Automating Data Workflows with N8N and BigQuery

In today’s data-driven world, automating workflows between applications and databases is crucial for efficiency. This tutorial demonstrates a Proof of Concept (POC) for integrating N8N with Google BigQuery, enabling seamless data extraction, transformation, and action-based automation.

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

  1. Go to GCP ConsoleIAM & AdminService Accounts.
  2. Create a new service account with the BigQuery User and BigQuery Data Viewer roles.
  3. Generate a JSON key and download it.
  4. 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.
  1. Add a BigQuery node to your N8N workflow.
  2. 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:
  1. Add an IF node to check if unresolved tickets exist:
    • Condition: {{ $node["BigQuery"].json["rows"].length > 0 }}
  2. 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}

Stay updated with Developers Group official social media channels:
{alertInfo}

Join free N8N Developers community on Facebook.{alertInfo}


Post a Comment

0 Comments