Automate secure calls to Google Cloud Run services within your n8n workflow. This template uses service account tokens for authentication and manages complex iteration logic.
Download this n8n workflow template and start using it instantly.
When interacting with secure Google Cloud Run services configured to require authentication, a standard HTTP request is insufficient. This sophisticated n8n workflow template solves this challenge by implementing the necessary Google Service Account authentication flow.
This n8n template relies on a dedicated sub-workflow (referenced by the Execute Workflow n8n node) to handle the generation and caching of the ephemeral Google ID Token. This token is essential for invoking the Cloud Run service via an Authorization: Bearer header.
Furthermore, the n8n workflow demonstrates advanced flow control by using Set, Merge, and Split Out n8n nodes to attach the necessary authentication context (idtoken) to every item in an array before iterating and making individual API calls, ensuring high reliability and security throughout the entire execution.
This secure automation process starts with the manual Execute n8n trigger.
Vars n8n node defines the necessary endpoint variables, serviceurl and optionally servicepath.Get Auth n8n node, an Execute Workflow node, calls a dedicated Google Service Auth sub-workflow. This critical component uses the Service Account credentials to generate a valid, time-sensitive Google ID token required for Cloud Run.Set Example Context Fields n8n node defines sample data fields (like an arrayofsoups) that need processing.Collect Context Example Merge n8n node combines the newly retrieved idtoken (from Get Auth) with the data context (from Set Example Context Fields). The authentication details are now tied to the data.Split Out n8n node takes the merged item and splits the arrayofsoups array into multiple individual items, ensuring that the authentication context fields (including the idtoken and service_url) are preserved with every split item.Loop Over Items n8n node (a Split In Batches n8n node) processes the items sequentially.Check Auth n8n node ensures context variables are correctly passed before the final call.Cloud Run Request n8n node executes the HTTP request. It uses dynamic expressions to construct the full URL and applies HTTP Bearer Auth, supplying the Google ID Token obtained earlier as the bearer token to securely invoke the Cloud Run endpoint. The process loops back until all items are processed.To deploy this secure n8n workflow, follow these steps:
Execute Workflow n8n node IDs match.clientemail and the entire privatekey (including the BEGIN/END tags) from your Google Service Account JSON key file.Cloud Run Request n8n node.Vars n8n node and set the serviceurl to your target Google Cloud Run base URL and optionally set the servicepath.Execute n8n trigger. Execute (Manual Trigger): The starting n8n trigger for manual execution and testing of the n8n workflow.
Vars (Set n8n node): Defines global variables, specifically serviceurl and servicepath, which point to the target Google Cloud Run service endpoint.
Get Auth (Execute Workflow n8n node): Calls the dedicated sub-workflow to retrieve the Google ID token using configured Google Service Account credentials. Key Configuration: Targets Templates — Service Auth (sub-workflow).
Set Example Context Fields (Set n8n node): Demonstrates adding workflow context, including a sample array (arrayofsoups) to be iterated over.
Collect Context Example (Merge n8n node): Combines the authentication token context with the data context, ensuring all items have the required idtoken.
Split Out (Split Out n8n node): Prepares the list for looping by splitting the array field (arrayofsoups) into separate items while including all other fields (crucially, keeping the idtoken, service_url, etc.).
Loop Over Items (Split In Batches n8n node): Manages the iteration process, handling the subsequent API calls one item at a time.
Cloud Run Request (HTTP Request n8n node): Performs the final, secure call to the Cloud Run service. Key Configuration: Uses dynamic URL generation and HTTP Bearer Auth (supplied via the ID token generated earlier in this n8n workflow) for authorization.
Secure your essential documents using this robust n8n workflow. It automatically captures Gmail attachments, uploads them to Google Drive, and sends an instant confirmation via WhatsApp.

Use this n8n workflow to securely ingest web form data, validate required fields, look up UTM parameters (Source, Medium, Campaign) in Odoo, and automatically create a qualified CRM lead. Deploy this reliable n8n template today.

Learn to implement secure AES-256 data encryption routines directly within an n8n workflow using the Code n8n node. A crucial n8n template for PII security.

Use this robust n8n workflow to authenticate with Google Service Accounts and securely call private Cloud Run endpoints. Features JWT signing and Bearer token exchange.

Use this powerful n8n workflow to automate security reconnaissance. It leverages Google Dorks, scrapes sensitive links via AI Scraper (Parsera), and sends automated reports using an n8n Gmail node.

Automate robust PDF segmentation using Chunkr.ai and Google Gemini within this powerful n8n workflow. Generate structured JSON, HTML, and Markdown outputs, ideal for RAG and knowledge base pipelines. Download this n8n templates solution today.









































