Skip to main content

Securely call Google Cloud Run APIs with service account auth (main-workflow)

Workflow preview

Workflow preview
100%
Securely call Google Cloud Run APIs with service account auth (main-workflow) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Who it’s for? Anyone who wants a simple, secure way to call a Google Cloud Run endpoint from n8n—without exposing it publicly. People who want a cheap/free tier way to run custom API logic without ...

Best for

  • DevOps automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.executeworkflow, n8n-nodes-base.manualtrigger, n8n-nodes-base.merge, n8n-nodes-base.set, n8n-nodes-base.splitout, n8n-nodes-base.httprequest, n8n-nodes-base.splitinbatches

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Marco Cassar.

Original n8n.io source

1.1 Workflow description

Title
Securely call Google Cloud Run APIs with service account auth (main-workflow)
Workflow name
Securely call Google Cloud Run APIs with service account auth (main-workflow)

Who it’s for?

Anyone who wants a simple, secure way to call a Google Cloud Run endpoint from n8n—without exposing it publicly.

People who want a cheap/free-tier way to run custom API logic without hosting n8n or spinning up servers. Example: you’ve got scraping code that needs specific system/python libs—build it into a Dockerfile on Cloud Run, then call it as a secure endpoint from n8n.

How it works

This is a conjunctive workflow: the main workflow calls Service Auth (sub-workflow) to get a Google ID token, merges that auth with your context, then calls your Cloud Run URL with Authorization: Bearer <id_token>. Works great for single calls or looping over items.

How to set up

General instructions below—see my detailed guide for more info:

Build a Secure Google Cloud Run API, Then Call It from n8n (Free Tier)

Setup:

  1. Create a Cloud Run service and enable Require authentication (Cloud IAM).
  2. Create a Google Service Account and grant Cloud Run Invoker on that service.
  3. In n8n, import the workflows and update the Vars node (service_url, optional service_path).
  4. Create a JWT (PEM) credential from your service account key, then run.
  5. Make sure to read the sticky notes in the workflows—they contain helpful pointers and optional configurations.

Requirements

  • Cloud Run service URL (auth required)
  • Google Service Account with Cloud Run Invoker
  • Private key JSON fields downloaded from Service Account | needed to generate JWT credentials

How to customize

Change the HTTP method/path/body in Cloud Run Request, or drop the Service Auth (sub-workflow) into other workflows to reuse the same auth pattern.

More details

Full write-up (minimal + modular flows), screenshots, and more:

Build a Secure Google Cloud Run API, Then Call It from n8n (Free Tier) — by Marco Cassar

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Check Auth

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.2

Block 4 - Execute

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 5 - Collect Context Example

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 6 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Set Example Context Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 9 - Sticky Note9

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Get Auth

Type / Role
n8n-nodes-base.executeWorkflow - executeWorkflow
Config choices
Version 1.2

Block 13 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Cloud Run Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 15 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 16 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Vars

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Done

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

3. Summary Table

Workflow Securely call Google Cloud Run APIs with service account auth (main-workflow)
Complexity advanced
Nodes 18
Categories DevOps, Multimodal AI
Author Marco Cassar
Published 19 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7568/7568.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Securely call Google Cloud Run APIs with service account auth (main-workflow) do?

Who it’s for? Anyone who wants a simple, secure way to call a Google Cloud Run endpoint from n8n—without exposing it publicly. People who want a cheap/free tier way to run custom API logic without ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, Multimodal AI use case.