← Google Cloud + SWAPI - Star Wars integrations

Get Film with SWAPI - Star Wars API on BigQuery - New Row from Google Cloud API

Pipedream makes it easy to connect APIs for SWAPI - Star Wars, Google Cloud and 1000+ other apps remarkably fast.

Trigger workflow on
BigQuery - New Row from the Google Cloud API
Next, do this
Get Film with the SWAPI - Star Wars API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Google Cloud trigger and SWAPI - Star Wars action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the BigQuery - New Row trigger
    1. Connect your Google Cloud account
    2. Configure Polling interval
    3. Configure Event Size
    4. Select a Dataset ID
    5. Select a Table Name
    6. Select a Unique Key
  3. Configure the Get Film action
    1. Connect your SWAPI - Star Wars account
    2. Select a film
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger


This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.


Description:Emit new events when a new row is added to a table

Google Cloud Overview

The Google Cloud API allows developers to access a variety of Google Cloud
services from their own applications. Services that can be accessed include
Google Cloud Storage, Google Cloud Datastore, Google Cloud Functions, and
Google Cloud Pub/Sub. With the Google Cloud API, developers can build a variety
of applications that take advantage of Google Cloud services.

Trigger Code

import crypto from "crypto";
import { isString } from "lodash-es";
import googleCloud from "../../google_cloud.app.mjs";
import common from "../common/bigquery.mjs";

export default {
  key: "google_cloud-bigquery-new-row",
  // eslint-disable-next-line pipedream/source-name
  name: "BigQuery - New Row",
  description: "Emit new events when a new row is added to a table",
  version: "0.1.4",
  dedupe: "unique",
  type: "source",
  props: {
    tableId: {
      propDefinition: [
        ({ datasetId }) => ({
    uniqueKey: {
      type: "string",
      label: "Unique Key",
      description: "The name of a column in the table to use for deduplication. See [the docs](https://github.com/PipedreamHQ/pipedream/tree/master/components/google_cloud/sources/bigquery-new-row#technical-details) for more info.",
      async options(context) {
        const { page } = context;
        if (page !== 0) {
          return [];

        const columnNames = await this._getColumnNames();
        return columnNames.sort();
  hooks: {
    async deploy() {
      await this._validateColumn(this.uniqueKey);
      const lastResultId = await this._getIdOfLastRow(this.getInitialEventCount());
    async activate() {
      if (this._getLastResultId()) {
        // ID of the last result has already been initialised during deploy(),
        // so we skip the rest of the activation.

      await this._validateColumn(this.uniqueKey);
      const lastResultId = await this._getIdOfLastRow();
    deactivate() {
  methods: {
    _getLastResultId() {
      return this.db.get("lastResultId");
    _setLastResultId(lastResultId) {
      this.db.set("lastResultId", lastResultId);
        Next scan of table '${this.tableId}' will start at ${this.uniqueKey}=${lastResultId}
     * Utility method to make sure that a certain column exists in the target
     * table. Useful for SQL query sanitizing.
     * @param {string} columnNameToValidate The name of the column to validate
     * for existence
    async _validateColumn(columnNameToValidate) {
      if (!isString(columnNameToValidate)) {
        throw new Error("columnNameToValidate must be a string");

      const columnNames = await this._getColumnNames();
      if (!columnNames.includes(columnNameToValidate)) {
        throw new Error(`Nonexistent column: ${columnNameToValidate}`);
    async _getColumnNames() {
      const table = this.googleCloud
      const [
      ] = await table.getMetadata();
      const { fields } = metadata.schema;
      return fields.map(({ name }) => name);
    async _getIdOfLastRow(offset = 0) {
      const limit = offset + 1;
      const query = `
        SELECT *
        FROM \`${this.tableId}\`
        ORDER BY \`${this.uniqueKey}\` DESC
        LIMIT @limit
      const queryOpts = {
        params: {
      const rows = await this.getRowsForQuery(queryOpts, this.datasetId);
      if (rows.length === 0) {
          No records found in the target table, will start scanning from the beginning

      const startingRow = rows.pop();
      return startingRow[this.uniqueKey];
    getQueryOpts() {
      const lastResultId = this._getLastResultId();
      const query = `
        SELECT *
        FROM \`${this.tableId}\`
        WHERE \`${this.uniqueKey}\` >= @lastResultId
        ORDER BY \`${this.uniqueKey}\` ASC
      const params = {
      return {
    generateMeta(row, ts) {
      const id = row[this.uniqueKey];
      const summary = `New row: ${id}`;
      return {
    generateMetaForCollection(rows, ts) {
      const hash = crypto.createHash("sha1");
        .map((i) => i[this.uniqueKey])
        .map((i) => i.toString())
        .forEach((i) => hash.update(i));
      const id = hash.digest("base64");

      const rowCount = rows.length;
      const entity = rowCount === 1
        ? "row"
        : "rows";
      const summary = `${rowCount} new ${entity}`;

      return {

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
Google CloudgoogleCloudappThis component uses the Google Cloud app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
Polling intervaltimer$.interface.timer

How often to run your query

Event SizeeventSizeinteger

The number of rows to include in a single event (by default, emits 1 event per row)

Dataset IDdatasetIdstringSelect a value from the drop down menu.
Table NametableIdstringSelect a value from the drop down menu.
Unique KeyuniqueKeystringSelect a value from the drop down menu.

Trigger Authentication

Google Cloud uses API keys for authentication. When you connect your Google Cloud account, Pipedream securely stores the keys so you can easily authenticate to Google Cloud APIs in both code and no-code steps.

  1. Create a service account in GCP and set the permissions you need for Pipedream workflows.

  2. Generate a service account key

  3. Download the key details in JSON format

  4. Open the JSON in a text editor, and copy and paste its contents here.

About Google Cloud

The Google Cloud Platform


Description:Get a film

SWAPI - Star Wars Overview

The SWAPI (Star Wars API) provides a wealth of data about the Star Wars
universe to build applications. With the SWAPI, developers can access detailed
Star Wars related data about people, planets, films, species and much more.
From web and mobile applications to data analysis, the possibilities are

Here are a few examples of what developers can build using the SWAPI:

  • Create a Star Wars encyclopedia to document the Star Wars universe and its
  • Design a custom interactive map to explore the planets of the Star Wars
  • Analyze the data to uncover patterns and insights about Star Wars films,
    characters, and species.
  • Design a search engine to query Star Wars related data.
  • Create a mobile app that displays information about the characters, films and
    species in the Star Wars universe.
  • Design a live score system specialized in providing stats related to the Star
    Wars films and characters.

Action Code

const swapi = require("../../swapi.app.js");
const axios = require("axios");

module.exports = {
  key: "swapi-get-film",
  name: "Get Film",
  version: "0.0.13",
  description: "Get a film",
  type: "action",
  props: {
    film: {
      propDefinition: [
  async run() {
    return (await axios({
      url: `https://swapi.dev/api/films/${this.film}`,

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

SWAPI - Star WarsswapiappThis component uses the SWAPI - Star Wars app.
filmfilmstringSelect a value from the drop down menu.

Action Authentication

The SWAPI - Star Wars API does not require authentication.

About SWAPI - Star Wars

The Star Wars API

More Ways to Connect SWAPI - Star Wars + Google Cloud

Get Film with SWAPI API on New Pub/Sub Messages from Google Cloud API
Google Cloud + SWAPI - Star Wars
Try it
Get Film with SWAPI API on BigQuery - Query Results from Google Cloud API
Google Cloud + SWAPI - Star Wars
Try it
New Pub/Sub Messages from the Google Cloud API

Emit new Pub/Sub topic in your GCP account. Messages published to this topic are emitted from the Pipedream source.

Try it
BigQuery - New Row from the Google Cloud API

Emit new events when a new row is added to a table

Try it
BigQuery - Query Results from the Google Cloud API

Emit new events with the results of an arbitrary query

Try it
Bigquery Insert Rows with the Google Cloud API

Inserts rows into a BigQuery table. See the docs and for an example here.

Try it
Create Bucket with the Google Cloud API

Creates a bucket on Google Cloud Storage See the docs

Try it
Get Bucket Metadata with the Google Cloud API

Gets Google Cloud Storage bucket metadata. See the docs.

Try it
Get Object with the Google Cloud API

Downloads an object from a Google Cloud Storage bucket, See the docs

Try it
List Buckets with the Google Cloud API

List Google Cloud Storage buckets, See the docs

Try it