Skip to content

Google Add File to Bucket

Uploads a local file to a specified Google Cloud Storage bucket. If the file already exists in the bucket, the user can choose to replace it.

Purpose

Use this node to upload a file from the local file system into a Google Cloud Storage bucket as part of your workflow. Useful for archiving, sharing, or processing files within the Google Cloud ecosystem.


Inputs

LabelTypeDescriptionRequiredExample / Notes
Bucket NameTextThe name of the destination bucket in Google Cloud Storage.my-project-uploads
Local Full PathTextThe full local file path of the file to upload.C:\temp\report.pdf
ReplacePicklistDetermines if the existing file in the bucket should be overwritten.Options: true, false

Behavior

  1. Validates Required Inputs: Ensures Bucket Name, Local Full Path, and Replace are provided.

  2. Checks File Existence (Local): If the specified local file doesn't exist, the task fails.

  3. Checks File Existence (Cloud): If the file already exists in the bucket:

    • If Replace is true, the existing file is deleted and a new file is uploaded.
    • If Replace is false, the task fails to prevent unintentional overwrites.
  4. Uploads File: Uses Google Cloud's API to upload the file.

  5. Returns Success or Error: Responds with appropriate task status and message.


Output

There are no specific output variables. The success or failure of the task is communicated through the workflow engine’s status messaging.


Common Use Cases

  • Uploading a generated report, document, or data export to Google Cloud for access by other systems.
  • Archiving automation results or logs.
  • Publishing files to a shared storage location for cross-platform access.

Notes

  • The file name used in the bucket is derived from the original file name in the path (e.g., C:\temp\report.pdf becomes report.pdf in the bucket).
  • The node uses a service account with access to Google Cloud Platform. Make sure the necessary permissions are granted.

Troubleshooting

IssueCauseResolution
File not foundLocal file path is incorrect or file was deletedCheck the path and ensure the file exists
File already existsReplace is set to false and the file exists in bucketChange Replace to true if overwriting
Upload failedToken expired or network error during file transferEnsure valid token and retry

Tentech 2024