npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-gcs-service-account

v1.3.0

Published

Google Cloud Storage node with service account authentication for n8n - Download and upload files on GCS buckets using service account credentials instead of OAuth

Readme

n8n-nodes-gcs-service-account

npm version License: MIT

An n8n community node for downloading files from Google Cloud Storage using Service Account authentication instead of OAuth. Perfect for automated workflows and server-to-server applications.

🚀 Features

  • 🔐 Service Account Authentication - Use JSON key files instead of OAuth
  • 📥 Single File Download - Download specific files from your bucket
  • 📦 Bulk Download - Download all files from bucket root directory
  • 🎯 Prefix Filtering - Filter files by prefix when bulk downloading
  • 🔄 n8n Integration - Seamless integration with n8n workflows
  • Production Ready - No token refresh issues, works 24/7
  • 🛡️ Error Handling - Robust error handling with detailed feedback

📦 Installation

Via n8n Community Nodes (Recommended)

  1. Open your n8n instance
  2. Go to SettingsCommunity Nodes
  3. Click Install a community node
  4. Enter: n8n-nodes-gcs-service-account
  5. Click Install

Manual Installation

npm install n8n-nodes-gcs-service-account

🔧 Setup

1. Create Google Cloud Service Account

  1. Go to Google Cloud Console
  2. Navigate to IAM & AdminService Accounts
  3. Click Create Service Account
  4. Assign these roles:
    • Storage Object Viewer (to read objects)
    • Storage Legacy Bucket Reader (to list buckets)
  5. Create and download a JSON key file

2. Configure n8n Credentials

  1. In n8n, go to SettingsCredentials
  2. Click Add Credential
  3. Select Google Service Account
  4. Paste the complete JSON key file content
  5. Save the credential

🎯 Operations

1. Download Single File

Download a specific file from your GCS bucket.

Parameters:

  • Bucket Name: Name of your GCS bucket
  • File Path: Path to the specific file (e.g., documents/file.pdf)
  • Binary Property: Name for the output binary data (default: data)

2. Download All Files from Root

Download all files from the root directory of your bucket.

Parameters:

  • Bucket Name: Name of your GCS bucket
  • Prefix Filter: (Optional) Only download files starting with this prefix
  • Max Files: Maximum number of files to download (default: 100)
  • Binary Property: Name for the output binary data (default: data)

💡 Usage Examples

Example 1: Download a Single PDF File

{
  "operation": "downloadSingle",
  "bucketName": "my-documents",
  "filePath": "reports/monthly-report.pdf"
}

Example 2: Download All Files from Root

{
  "operation": "downloadAll", 
  "bucketName": "my-images",
  "maxFiles": 50
}

Example 3: Download Files with Prefix

{
  "operation": "downloadAll",
  "bucketName": "my-data",
  "prefix": "exports/",
  "maxFiles": 20
}

📊 Output Data

Single File Download

{
  "fileName": "monthly-report.pdf",
  "filePath": "reports/monthly-report.pdf", 
  "bucketName": "my-documents",
  "size": 2048576,
  "contentType": "application/pdf",
  "downloadedAt": "2024-01-01T12:00:00.000Z",
  "etag": "abc123",
  "updated": "2024-01-01T10:00:00.000Z",
  "operation": "downloadSingle"
}

Bulk Download

Each file creates a separate output item:

{
  "fileName": "image1.jpg",
  "filePath": "image1.jpg",
  "bucketName": "my-images", 
  "size": 1024000,
  "contentType": "image/jpeg",
  "downloadedAt": "2024-01-01T12:00:00.000Z",
  "etag": "def456",
  "updated": "2024-01-01T11:00:00.000Z",
  "operation": "downloadAll",
  "totalFiles": 5
}

🔍 Binary Data

Downloaded files are available as binary data in the specified property (default: data). You can:

  • Save to disk using the Write Binary File node
  • Send via email using Email nodes
  • Upload elsewhere using HTTP Request or other storage nodes
  • Process content using appropriate nodes based on file type

⚠️ Important Notes

  • Permissions: Ensure your service account has Storage Object Viewer role
  • File Limits: Bulk download is limited to prevent memory issues (default: 100 files)
  • Large Files: Very large files may cause memory issues - consider using streams for production
  • Billing: Downloads count towards your GCS egress charges

🐛 Troubleshooting

Authentication Errors

  • Verify your service account JSON is complete and valid
  • Check that the service account has proper GCS permissions
  • Ensure the bucket exists and is accessible

File Not Found

  • Verify the file path is correct (case-sensitive)
  • Check that the file exists in the specified bucket
  • Ensure you have read permissions on the file

Memory Issues

  • Reduce maxFiles parameter for bulk downloads
  • Process files in smaller batches
  • Consider file size limits in your n8n instance

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT © Gabriel Lacanna

🙏 Credits


Need help? Open an issue or check the n8n community forum.