Google BigQuery
Google BigQuery is a fully-managed, serverless data warehouse that enables scalable analysis over petabytes of data. It is a Platform as a Service that supports querying using ANSI SQL.
!!! note "Credentials" You can find authentication information for this node here.
Basic Operations
Record
- Create a new record
- Retrieve all records
Example Usage
This example allows you to send position updates of the ISS every minute to a table in Google BigQuery. This example usage workflow uses the following nodes.
1. Cron node
The Cron node will trigger the workflow every minute.
- Click on Add Cron Time.
- Select 'Every Minute' from the Mode dropdown list.
- Click on Execute Node to run the node.
2. HTTP Request node (GET)
This node will make a GET request to the API https://api.wheretheiss.at/v1/satellites/25544/positions
to fetch the position of the ISS. This information gets passed on to the next node in the workflow.
- Enter
https://api.wheretheiss.at/v1/satellites/25544/positions
in the URL field. - Click on the Add Parameter button in the Query Parameters section.
- Enter
timestamps
in the Name field. - Click on the gears icon next to the Value field and click on Add Expression.
- Enter the following expression:
{{Date.now()}}
. This expression will return the current timestamp. - Click on Execute Node to run the node.
3. Set node
We will use the Set node to ensure that only the data that we set in this node gets passed on to the next nodes in the workflow.
- Click on Add Value and select 'String' from the dropdown list.
- Enter
name
in the Name field. - Click on the gears icon next to the Value field and click on Add Expression.
- Select the following in the Variable Selector section: Current Node > Input Data > JSON > 0 > name. You can also add the following expression:
{{$json["0"]["name"]}}
. - Click on Add Value and select 'Number' from the dropdown list.
- Enter
latitude
in the Name field. - Click on the gears icon next to the Value field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > Input Data > JSON > 0 > latitude. You can also add the following expression:
{{$json["0"]["latitude"]}}
. - Click on Add Value and select 'Number' from the dropdown list.
- Enter
longitude
in the Name field. - Click on the gears icon next to the Value field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > Input Data > JSON > 0 > longitude. You can also add the following expression:
{{$json["0"]["longitude"]}}
. - Click on Add Value and select 'Number' from the dropdown list.
- Enter
timestamp
in the Name field. - Click on the gears icon next to the Value field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > Input Data > JSON > 0 > timpestamp. You can also add the following expression:
{{$json["0"]["timestamp"]}}
. - Toggle Keep Only Set to
true
. We set this option to true to ensure that only the data that we have set in this node get passed on to the next nodes in the workflow. - Click on Execute Node to run the node.
4. Google BigQuery node (create: record)
This node will send the data from the previous node to the position
table in Google BigQuery. If you have created a table with a different name, use that table instead.
- First of all, you'll have to enter credentials for the Google BigQuery node. You can find out how to do that here.
- Select a project from the Project ID dropdown list.
- Select a dataset from the Dataset ID dropdown list.
- Select the table from
position
from the Table ID dropdown list. If you created a table with a different name, select that table instead. - Enter
name, latitude, longitude, timestamp
in the Columns field. - Click on Execute Node to run the node.
!!! note "Activate workflow for production" This example workflow uses the Cron node, which is a Trigger node. You'll need to save the workflow and then click on the Activate toggle on the top right of the screen to activate the workflow. Your workflow will then be triggered as specified by the settings in the Cron node.