← Google Cloud

Get Object with Google Cloud API

Pipedream makes it easy to connect APIs for Google Cloud and 800+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Get Object with the Google Cloud API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Get Object with the Google Cloud API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Get Object action
    1. Connect your Google Cloud account
    2. Select a Bucket Name
    3. Select a File name
    4. Configure Destination
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is 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.

Get Object on Google Cloud
Description:Downloads an object from a Google Cloud Storage bucket, [See the docs](https://googleapis.dev/nodejs/storage/latest/File.html#get)
Version:0.0.1
Key:google_cloud-get-object

Code

import googleCloud from "../../google_cloud.app.mjs";

export default {
  name: "Get Object",
  version: "0.0.1",
  key: "google_cloud-get-object",
  type: "action",
  description: "Downloads an object from a Google Cloud Storage bucket, [See the docs](https://googleapis.dev/nodejs/storage/latest/File.html#get)",
  props: {
    googleCloud,
    bucketName: {
      propDefinition: [
        googleCloud,
        "bucketName",
      ],
    },
    fileName: {
      label: "File name",
      description: "The name of the file will be retrieved from GCS",
      type: "string",
      propDefinition: [
        googleCloud,
        "fileNames",
        (configuredProps) => ({
          bucketName: configuredProps.bucketName,
        }),
      ],
    },
    destination: {
      label: "Destination",
      description: "Destination file path on '/tmp', [See how to work with files](https://pipedream.com/docs/v1/workflows/steps/code/nodejs/working-with-files/)",
      type: "string",
    },
  },
  async run({ $ }) {
    const {
      bucketName,
      fileName,
      destination,
    } = this;
    const options = {
      destination,
    };
    await this.googleCloud.storageClient()
      .bucket(bucketName)
      .file(fileName)
      .download(options);
    $.export("$summary", `${bucketName}/${fileName} downloaded to ${destination}`);
  },
};

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.
LabelPropTypeDescription
Google CloudgoogleCloudappThis component uses the Google Cloud app.
Bucket NamebucketNamestringSelect a value from the drop down menu.
File namefileNamestringSelect a value from the drop down menu.
Destinationdestinationstring

Destination file path on '/tmp', See how to work with files

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.

When you create a service account in GCP, you'll be asked to generate a service account key. Create that key and download the key details in JSON format.

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

About Google Cloud

The Google Cloud Platform