Zapier
Integrating Zapier as a Source with GlassFlow Using Webhook Connector
Last updated
Integrating Zapier as a Source with GlassFlow Using Webhook Connector
Last updated
© 2023 GlassFlow
Zapier is a popular automation platform that connects to your favorite apps and services to automate repetitive tasks and streamline your workflows. With the Zapier and GlassFlow integration, you can automatically send updates from any of the thousands of apps and services supported by Zapier to a GlassFlow pipeline via Webhook Connector.
This tutorial will guide you through setting up an integration between Zapier and GlassFlow. One of the good examples to demonstrate this is how you keep your data in sync and enrich. Think about every time a row in your Google Sheets spreadsheet is updated, Zapier will send a POST request to the GlassFlow webhook. The GlassFlow pipeline processes, transforms and sends the output data to other related systems (e.g., CRM, marketing tools, analytics platforms) in real-time.
Data Source: The data source for this pipeline is Zapier. GlassFlow pipeline is triggered by receiving POST requests from Zapier using the GlassFlow Webhook connector whenever a row in your Google Sheets is updated.
Transformation: You define a transformation function to process the incoming data. This could include tasks like data cleaning, enrichment, or applying business logic.
Data Sink: After processing, the data can be sent to any configured data sink, such as a database, analytics platform, or another API.
Let's assume your Google Sheets tracks customer orders:
Every time an order is updated (e.g., status changes from "Pending" to "Completed"), Zapier sends the update to GlassFlow via the webhook URL. GlassFlow processes this update, enriching it with additional information (like the customer's previous order history or shipping details), and sends it to your CRM or analytics dashboard.
You will use the GlassFlow WebApp to create a data processing pipeline.
To start with this setup, you need a free GlassFlow account.
Navigate to the GlassFlow WebApp and log in with your credentials.
Click on "Create New Pipeline" and give it a name like "Google Sheets Updates."
Choose "Webhook" as the Data Source type. GlassFlow will provide you with a unique webhook URL for your pipeline after the pipeline is created.
Define the transformation function in the pipeline. This function cleans the incoming data and adds some metadata before sending it to the next stage in the pipeline.
Copy and paste the following transformation function code into the transformer's built-in editor.
Note that the handler function is mandatory to implement in your code. Without it, the transformation function will not be successful.
Select "SDK" to configure the pipeline to use Python SDK to send output data to the desired destination. For simplicity, you can consume the transformed data from the GlassFlow pipeline and print it to the console. See consume data from the pipeline section below.
Confirm the pipeline settings in the final step and click "Create Pipeline".
Once the pipeline is created, copy its Access Token and Webhook URL specific to this pipeline on the "Details" page.
Log in to your Zapier account.
Click on "Make a Zap" to create a new automation.
Set Google Sheets as the trigger app.
Select the trigger event "New or Updated Spreadsheet Row." This ensures that Zapier triggers whenever a row is added or updated in your Google Sheets. Or you can also use a ready template called: Send webhook POSTs with new updates to Google Sheets rows
Connect your Google account and select the specific spreadsheet and worksheet you'd like to monitor.
Choose "Webhook" as the action app.
Select the action event "POST."
In the "URL" field, paste the GlassFlow webhook URL you copied earlier.
In the "Payload Type" field, choose "JSON."
Map the fields from your Google Sheets row to the corresponding JSON keys. For example, if your spreadsheet has columns for "Order ID," "Customer Name," and "Status," map these to JSON keys like "Order ID": "1001"
, "Customer Name": "Jane Doe"
, etc.
For the Headers, add one header with the following key and value pair: X-Pipeline-Access-Token and your pipeline Access Token
Test the Zap to ensure it's working correctly. Zapier will send a sample POST request to your GlassFlow pipeline.
Once the test is successful, activate the Zap.
To complete this part you'll need the following:
Python is installed on your machine.
Download and Install Pip to manage project packages.
You can consume the transformed data from the GlassFlow pipeline using managed connectors or implement a custom sink integration using Python SDK. For the sake of the demo, we can print it to the console using the below consumer.py
Python script. Here's an example of how to implement this:
Replace your_pipeline_id
and your_pipeline_access_token
with appropriate values obtained from your GlassFlow account.
Run consumer.py
Python script in a terminal to consume data from the GlassFlow pipeline:
This script will continuously consume new events from the GlassFlow pipeline. Upon receiving transformed events, it will print data in the console.
Also, you can see processed event logs in the GlassFlow Pipeline Logs section.
This integration can be replaced with any other integrations that Zapier connects to.
If you're ready to use this foundational setup, start by creating your GlassFlow pipeline and connecting it to Zapier today!
Order ID | Customer Name | Product | Quantity | Status |
---|---|---|---|---|
1001
Jane Doe
Widget
2
Completed
1002
John Smith
Gizmo
1
Pending