Self-hosting n8n on Google Cloud Run or GKE

Choosing between Cloud Run and Google Kubernetes Engine for self-hosted n8n, with the queue mode, database, key and identity decisions that shape the build.

On this page

Self-hosting n8n on Google Cloud Run or GKE: which fits your team

For most teams, the choice between Cloud Run and Google Kubernetes Engine (GKE) for n8n comes down to three questions: whether you need queue mode with separate workers, whether the instance must keep its state and scheduled work through restarts without extra design, and how much Kubernetes operations your team already runs. Cloud Run suits a single main instance backed by Cloud SQL for PostgreSQL, while GKE is worth its extra setup when you need worker pools, custom networking or the same cluster standards you apply to other workloads. n8n is a fair-code workflow automation platform built with TypeScript and Node.js that combines a visual canvas with custom JavaScript or Python code. It is licensed under the Sustainable Use License, which is source-available and not OSI open source, so your legal team should review the license terms before you commit to a production design.

A team usually needs a self-hosted instance when workflows touch systems that must stay inside its Google Cloud project, when credentials and execution data must remain under its own controls, or when its security review asks where data is processed. Hosting n8n yourself also means you own the upgrade cadence, backups, the encryption key that protects stored credentials and the sign-in model for workflow builders. Before you pick a runtime, confirm which n8n edition and plan your organization needs, since features such as SSO and Git-backed environments are limited to the Business and Enterprise plans on n8n's pricing page, and multi-main high availability is limited to Enterprise self-hosted deployments.

Cloud Run, GKE and when each fits

Cloud Run suits a small team that wants n8n running with little infrastructure to maintain. One service runs the editor, webhooks and executions in the same container, and the database sits in Cloud SQL for PostgreSQL. This model carries the lightest operating load of the three options and fits internal automation where execution volume is modest and a short interruption during a deploy is acceptable. The team still owns the image tag, environment configuration, the encryption key and the database connection, while Google runs the underlying platform.

  • Fit: internal automations, proofs of concept that move toward production, and teams without a Kubernetes practice.
  • What you operate: the pinned image tag, environment variables, secret injection for the encryption key, Cloud SQL backups and the upgrade window for each n8n release.
  • Queue mode: not used here. Executions run inside the main service, so a heavy run competes with the editor and webhooks for the same resources.
  • Setup burden: low. Most of the work is service configuration, a service account with database access, secret handling and a custom domain.
  • State: keep workflow and execution data in PostgreSQL rather than the container filesystem, because container instances are replaceable.

Before you commit, confirm that the encryption key is stored in a managed secret store and that you can restore the database into a new service within your recovery objectives.

Configuration options and when each fits

This table compares the four main choices for hosting n8n on Google Cloud: a single Cloud Run instance, queue mode with workers on Cloud Run, GKE with the Helm chart path, and Cloud SQL versus self-managed PostgreSQL. Read each row against your team's Kubernetes experience, your execution volume and how much platform work you want to own. The main takeaway is that the database and queue decisions usually matter more than the compute platform.

OptionFits whenWhat you operateTrade-off
Single instance on Cloud RunLow to moderate volume, few webhooks, one team and no need for worker scalingThe n8n service configuration, its secrets, the encryption key and the connection to the databaseSimplest to run, but all triggers, webhooks and executions share one service, so scaling and isolation are limited
Queue mode with workers on Cloud RunExecution volume varies, webhooks must stay responsive during heavy runs, and the team wants managed computeMain and worker services, a Redis queue, the shared encryption key across every process and worker concurrency settingsMore moving parts to configure and monitor, and the Redis queue becomes a dependency you must keep available
GKE with the n8n Helm chartThe organization already runs GKE, needs fine control over scheduling, network policy or ingress, or must keep n8n alongside other workloadsCluster upgrades, node pools, ingress and TLS, Helm values, secrets handling and in-cluster or external data servicesLargest set of platform duties. Kubernetes lifecycle and patching become your team's work, which is worth it only if the cluster skills already exist
Cloud SQL for PostgreSQLYou want managed backups, patching and failover options from Google Cloud and a supported PostgreSQL version without running the databaseInstance sizing, network connectivity, database users, backup settings and the maintenance windowAdds a managed service cost and dependency. Confirm the high availability, backup and connection options against current Google Cloud documentation
Self-managed PostgreSQLYour database team already runs PostgreSQL on Compute Engine or GKE and has tested backup and restore proceduresThe database host or cluster, high availability design, backups, point-in-time recovery, upgrades and security patchesFull control over versions and tuning, but backup testing, failover and major upgrades become your responsibility

How the n8n parts connect on Google Cloud

The diagram starts with users and webhook callers at the public edge, where traffic reaches the main instance for triggers, webhooks and the editor. In queue mode, the main instance hands executions through Redis to worker pools, which read and write workflow data in PostgreSQL on Cloud SQL. Workers and main share the same encryption key, so check that every process receives it. Google Workspace OAuth sits on the sign-in path and is separate from the database hop.

Request, queue and database paths for n8n on Google Cloud, with trust boundaries marked.

Setup sequence for n8n on Cloud Run or GKE

This sequence takes an n8n instance from a sizing decision to a verified deployment on Google Cloud, with the database, encryption key, proxy settings and sign-in wired in the right order. Each step ends with a check you can record before moving on.

  1. Decide single or queue mode

    Choose whether one main instance can handle your triggers, webhooks and executions, or whether you need a main instance that hands executions to workers through Redis. Write the decision down with the expected webhook volume, the number of concurrent executions and the workflows that run long or process large files. Queue mode adds a Redis service and worker components, so this choice determines what you build in the later steps. The step is done when the target mode and its reasons are recorded and approved by the platform owner.

  2. Provision Cloud SQL for PostgreSQL

    Create a Cloud SQL for PostgreSQL instance in the same region as the compute service, with private connectivity, automated backups and point-in-time recovery enabled. Create a dedicated database and user for n8n with only the privileges it needs, and confirm the PostgreSQL major version against the n8n version you plan to run. Do not rely on SQLite for production. The check is a successful connection from the n8n runtime over the network path you intend to use, with SSL to the database enabled where your policy requires it.

  3. Store the encryption key in Secret Manager

    Generate the n8n encryption key and store it in Google Secret Manager, or in the cluster's secret mechanism if you run GKE, with access granted only to the service identities that run n8n. The key protects the credentials stored in the database, so every main, worker and webhook process must receive the same value, and the key must be backed up separately from the database. Record who can read the secret and how rotation would be handled. The check is that each runtime starts with the key injected from the secret store and that no copy exists in images, repositories or plain environment files.

  4. Configure Redis for queue mode

    If you chose queue mode, provision a Redis service reachable from the main instance and every worker, such as Memorystore for Redis, and restrict access to the n8n service identities and the private network. Set the queue connection settings on all components using the same values. Keep Redis on the private network and confirm its version and maintenance settings with the service documentation. Single-mode deployments skip this step. The check is that the main instance can write to the queue and a test execution passes from the main instance to a worker and completes.

  5. Deploy main and worker components

    Deploy the main instance and, in queue mode, the worker and webhook processor components as separate Cloud Run services or GKE workloads, each with the same image tag, the same encryption key and the database and Redis settings. On GKE, apply Pod Security settings and a least-privilege service account. Pin the image to a specific version and keep worker concurrency and memory limits explicit. The check is that every component reports healthy, the main instance serves the editor, and workers appear as active in the instance's queue view.

  6. Set the public URL and proxy settings

    Set the public URL n8n uses to build editor links and webhook addresses, and configure the proxy hop count so forwarded client addresses are read correctly behind the Google load balancer. Put TLS on the public hostname with a managed or customer certificate, and confirm the webhook address shown in the editor matches the hostname that external systems will call. Mismatched URLs are a common cause of webhook failures. The check is that a request to the public hostname reaches the editor over HTTPS and the webhook URL shown in a test trigger matches the address you published.

  7. Configure Google Workspace OAuth

    Create an OAuth client in your Google Cloud project for the n8n callback address, restrict it to your Workspace organization, and add the client credentials to Secret Manager. Use the Google credential types in n8n for the workflow tools your teams connect, and record which Google scopes each credential requests. Note that SSO for signing into n8n itself is a separate feature that depends on your plan, so confirm it against the n8n pricing page before you rely on it. The check is that a test Google credential authorizes successfully, the consent screen shows only the scopes you approved, and the credential is stored encrypted in the database.

  8. Verify webhooks, worker access and restore

    Run three tests before you open the instance to users. First, send a test request to a production webhook and confirm the workflow runs end to end. Second, confirm that a worker executes a workflow that uses a stored credential, which proves the workers hold the same encryption key. Third, restore a recent database backup into a separate Cloud SQL instance, start n8n against it with the same key, and confirm the restored credentials decrypt and a workflow runs. Record the results and the restore duration you measured. The sequence is complete when all three tests pass and the results are filed with the change record.

Security decisions for the Google Cloud deployment

Running n8n on Cloud Run or GKE puts the encryption key, database connection, identities and inbound webhooks in your hands, not a vendor's. The cards below cover the decisions that most often go wrong, and what to verify before the instance handles production credentials.

Encryption key across main and workers

In queue mode, the encryption key set on the main instance must also be available to every worker and webhook processor, or they cannot decrypt the credentials stored in PostgreSQL. Store the key in Secret Manager and inject it into each service through the same reference. Confirm that a key rotation plan exists, because changing the key without re-encrypting stored credentials will break existing workflows.

n8n queue mode docs

Database connectivity and SSL

Cloud SQL for PostgreSQL should be reached over a private IP or the Cloud SQL connector rather than a public address with an open allowlist. Require SSL on the connection and confirm which certificate n8n validates. Check that the database user has rights only to the n8n schema, and that the password is pulled from Secret Manager rather than typed into the service configuration.

Least-privilege service accounts

Give each Cloud Run service or GKE workload its own Google service account with only the roles it needs, such as Cloud SQL client access and read access to specific secrets. Avoid the default Compute Engine service account, which often carries broad project-level roles. Review the bindings after each change, and confirm that no one outside the platform team can impersonate these accounts.

Webhook exposure and outbound controls

Webhooks are the only public entry point in most designs, so limit ingress to the webhook service and keep the editor behind a separate, access-controlled route or identity-aware proxy. Restrict outbound traffic from the n8n service with VPC egress rules so workflows reach only approved hosts. Confirm which nodes can make arbitrary HTTP calls and who is allowed to build them.

GKE secret handling

Kubernetes Secrets are stored unencrypted in etcd by default. On GKE, confirm that application-layer encryption of Secrets with a Cloud KMS key is enabled, then restrict list and watch access on Secrets with RBAC. Where the encryption key and database password must never sit in etcd at all, the Secrets Store CSI Driver can mount them from Secret Manager. The CIS Kubernetes Benchmark is a useful checklist for this review.

Default in etcd
Unencrypted
Kubernetes Secrets practices

Audit logging and retention

Turn on Cloud Audit Logs for the project, including Secret Manager and Cloud SQL administrative activity, and route them to a log bucket with a retention period set by your records policy. Enable Kubernetes audit logging on GKE and confirm n8n execution logs leave the container. Test that a sample change to a credential or workflow produces a traceable record before go-live.

Questions buyers ask before choosing Cloud Run or GKE

What drives the cost of running n8n on Cloud Run compared with GKE?

The biggest cost difference is the platform you run and who operates it, not the license. n8n's Community edition is free to self-host, but the Cloud Run or GKE bill depends on always-on instances, memory and CPU allocation, Cloud SQL for PostgreSQL, Redis if you run queue mode, and egress. Cloud Run bills mostly for the compute your instances use and keeps the cluster out of your hands. GKE adds node pools, cluster management, and the engineering time to upgrade and patch them. Ask any partner for a quote that lists each Google Cloud service, who pays Google for it, and which items recur monthly versus one time. Estimates from Google's pricing calculator should be checked against your own traffic and retention settings.

Can Cloud Run run n8n in queue mode?

Queue mode needs a shared Redis, so the answer depends on whether your Cloud Run setup can reach one and run more than one service. In n8n's queue mode, the main instance handles triggers and webhooks and passes executions through Redis to workers that read and write PostgreSQL. Each worker and webhook processor must share the main instance's encryption key so it can read stored credentials. On Cloud Run, you would deploy the main, worker and webhook roles as separate services, keep their settings identical, and connect them to Redis and Cloud SQL. Confirm the exact role settings and Redis options against the current queue mode documentation before you commit to the design.

How long does a Cloud Run or GKE build take?

Duration depends on scope more than on the platform choice. A single-instance deployment with a managed database, a domain, and TLS is a small job. Queue mode with several workers, a Redis service, secrets handling, Google Workspace sign-in, backups, and a tested upgrade path is a larger one, and GKE with cluster hardening and identity integration adds more. Ask for a written plan that lists the environments, integrations, and acceptance tests, and that states what the client must provide and when. Timelines should come with that scope attached, not as standalone numbers.

What does the client need to provide for this work?

The work needs decisions and access from three owners. Your cloud team provides the Google Cloud project, billing, a service account plan, and network rules. Your identity administrator provides a Google Workspace OAuth client, the allowed domains, and group membership for role mapping. Your database owner approves the Cloud SQL instance size, backup retention, and who holds credentials. Each owner should be named before the scope is agreed, because delays usually come from waiting for approvals rather than from configuration. A written responsibility list makes this visible from the start.

Can our own team deploy n8n on Cloud Run or GKE without a partner?

Yes, a capable platform team can do it, and the question is whether they can own it after launch. The first deployment requires knowing Cloud Run or Kubernetes, Cloud SQL, secret management, and n8n's configuration, including the encryption key that must stay identical across processes. The harder part is ongoing work: upgrades between n8n releases, backups you have restored at least once, monitoring, and security review. Check whether your team has run similar services in production and whether it can cover on-call for them. A partner can take the initial build or the upgrade path, or both, under a written scope.

How does Google Workspace OAuth affect who can access n8n?

Google Workspace sign-in controls who reaches the n8n login page, but it does not map to n8n's full access model on every plan. Confirm the sign-in method your n8n edition supports. SSO and LDAP, along with environments with Git and log streaming, are included only in n8n's Business and Enterprise plans. SAML single sign-on is listed on those same plans, and n8n publishes setup guides for Okta and Azure AD, not for Google Workspace. Before you rely on Google sign-in, decide which Google groups grant admin rights, how a departing employee loses access, and whether any workflow credential is shared. Ask for the access model in writing and test it with a non-admin account.

Limits to confirm in your Google Cloud environment

Several limits shape what a Cloud Run or GKE deployment of n8n can do, and they come from n8n's licensing and plan tiers, from Google Cloud's own quotas and from n8n's release cadence. Confirm each one before you choose an architecture, because some change the design and others change the budget.

Multi-main high availability needs Enterprise

Running several main instances for high availability is restricted to Enterprise self-hosted deployments. It is not available in the Community edition or on n8n Cloud. If your design depends on multiple main instances, ask n8n to confirm the Enterprise License terms in writing before you size the Cloud Run or GKE services. On the Community edition, plan for one main instance and scale workers instead, and treat the main instance as a single point to restart and back up.

Queue mode docs

SSO and Git environments need paid plans

According to n8n's pricing page, SSO and LDAP, environments with Git, and log streaming are included only in the Business and Enterprise plans. Google Workspace OAuth for individual workflow tools is a separate question from SSO for n8n users. Before you plan login for your staff, confirm which plan covers the identity features you need, and whether Business self-hosted pricing fits your budget.

n8n pricing

Sustainable Use License limits internal use

n8n is licensed under the Sustainable Use License, which allows use or modification for your own internal business purposes, and distribution only free of charge for non-commercial purposes. If you plan to run n8n for customers, as a hosted service or inside a product, the license may not cover that model. Files with .ee in their name require a valid Enterprise License. Ask your counsel to review the license text against your intended use before you build.

n8n license text

Cloud Run and GKE quotas and regions

Cloud Run service limits, GKE node pool quotas, and regional availability for the services you need can differ by project and location. Check instance, CPU, memory and IP address quotas in the region where your data must stay, and confirm that Cloud SQL and any Redis service you use are available there too. A quota increase request can take time, so raise it during design rather than at launch.

Cloud SQL versions and maintenance windows

Confirm with Google which PostgreSQL major versions Cloud SQL supports for your target instance, how long each version receives support, and when maintenance windows apply. Maintenance can restart the database, which affects active executions and queue mode workers. Ask for the maintenance window settings you can control, and set n8n's connection pool and retry behavior so that a short restart does not corrupt execution state.

Queue mode docs

Planned upgrades for frequent releases

n8n uses semantic versioning and ships minor releases roughly weekly, so an image tag you pin today will fall behind quickly. Decide who tests each release, where staging runs, and how a Cloud Run revision or GKE rollout is rolled back. Keep the encryption key unchanged across upgrades, and record the version you run in your change log so an auditor can trace what was deployed on each date.

n8n release notes

How a fixed-scope n8n deployment on Google Cloud is agreed

DeployOpen agrees scope, deliverables and timelines in writing before any work starts, and the written scope is what the quote follows from. For an n8n deployment on Cloud Run or GKE, that document should name the target Google Cloud project and organization policies, the runtime chosen (Cloud Run or GKE), the n8n edition, whether queue mode with workers is in scope, the webhook domain and certificate approach, and what is excluded. Because DeployOpen does not publish a price list, the clearest way to compare offers is to hold every bidder to the same written scope. Ask each provider to state which of these items it has priced and which it has left out.

The client side of the agreement is mostly inputs. Expect to provide the target project and billing arrangement, the identity setup for signing users in (for example, Google Workspace OAuth for workflow tools, or a SAML identity provider if the Business or Enterprise plan is in use), and the names of the people who approve access and secrets. For the database, state the Cloud SQL for PostgreSQL requirements: version, high availability expectations, private networking, maintenance windows and whether an existing instance must be reused. Also state backup and retention needs, including how long execution data and database backups must be kept and who may restore them. Each of these inputs changes the work, so they belong in the scope rather than in later change requests.

Confirm the timeline and the handover terms in writing as well. The scope should say which environment is delivered (development, staging or production), what documentation and runbooks the client receives, who holds the encryption key and where it is stored, and how changes after sign-off are priced. Do not rely on a duration from a general estimate: ask for the milestones, the dependencies on client approvals and the acceptance criteria for each deliverable. A written scope with those elements gives both sides a fixed reference when the work is reviewed.

How DeployOpen works on this

DeployOpen plans, builds, documents and supports self-hosted n8n inside your own Google Cloud projects, so the runtime choice between Cloud Run and GKE is settled against your queue mode, database, identity and network requirements before any build starts. Engagements are fixed-scope, with the deliverables agreed in writing first.

How we scope

  • Written scope covers the Cloud Run or GKE decision, the n8n edition and license fit, and the target project layout.
  • Scope records whether you need queue mode workers, which Cloud SQL for PostgreSQL configuration applies, and how Google Workspace OAuth is handled.
  • Confirm with your team which n8n features need a paid plan, since SSO and environments depend on the Business or Enterprise edition.

How we build

  • Deploy n8n on the agreed runtime in your Google Cloud project, with Cloud SQL for PostgreSQL, secrets and networking configured to your standards.
  • Set the n8n encryption key handling so that every worker and webhook processor can read stored credentials, and test that path explicitly.
  • Test webhook reachability, OAuth callbacks, scaling behavior and restore from backup before the environment is accepted.

How we hand over

  • Deliver architecture notes, configuration records, IAM and network diagrams, and a runbook covering deployment and rollback steps.
  • Document the upgrade procedure for n8n releases, including pinned image tags and the checks to run before and after each upgrade.
  • Walk your platform and security teams through the build so they can review it against their own controls and operate it afterward.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer that follows the written scope.
  • Retainer work can cover n8n version upgrades, Google Cloud service changes, and periodic review of access, secrets and license terms.
  • Ask for the support hours, response process and upgrade responsibilities to be written into the agreement before work begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.