How to setup blue/green deployment strategy for n8n?

I’m following the directions in Amazon Web Services | n8n Docs to setup the n8n container in Kubernetes. Ultimately, I want to have a setup where a new deployment of the container has a smooth transfer from the old to the new. I know this as a blue/green deployment.

The question I have is what command do I run on the old container to have it finish any active executions, but NOT take on any new ones. By the time I run this command, I will have pointed my load balancer to the new container, so no incoming webhooks should hit the old container any more.

Do I just need to find the process id (pid) of the “n8n start” command and send it a soft kill command, like …
kill -SIGTERM <pid>

Information on your n8n setup

  • n8n version: stable
  • Database: postgresdb (AWS RDS)
  • n8n EXECUTIONS_PROCESS setting: default
  • Running n8n via: AWS EKS
  • Operating system: OS in “n8nio/n8n:stable” container image (I assume Ubuntu)
1 Like

Hey @erockx
Welcome to the community!

I found a thread here on the forum that confirms that kill -SIGTERM is supposed to initiate a graceful shutdown in queue mode, allowing active executions to finish, respecting the N8N_GRACEFUL_SHUTDOWN_TIMEOUT variable (default 30 seconds).

You might want to tweak the default 30s if you have long running workflows.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.