Cloud Run deployment

Hello everyone :smiley: Thank you for this amazing product.

I have cloned n8n repo in order to re-map the N8N_PORT to 8080, for the need to deploy it on Cloud Run. Although the deployment is successful, after building a new Docker image, I get the following message at the header’s top right: “Connection lost”.

I am not quite sure why this is happening. Any insights would be helpful!

Thanks a lot! Very happy that you like it!

Your problem looks like your reverse proxy has issues with EventSource which gets used to display new data while nodes render.

You should check this out. That was the same problem:

Hope it helps!

Hmm I am afraid this won’t be possible with Cloud Run :slightly_frowning_face:

Sorry, do not know Cloud Run so can not be much of a help here. Is there maybe some way to configure it to work with Event. Source?

Have you had a chance to get this working with Cloud Run on GCP?

This is a bit old but I have managed to set up the n8n on Cloud Run via Docker / Terraform.

Happy to share the TF templates etc.

I have so far had two issues;

  1. CloudRun will kill my Docker when it is not being utilized (obviously you are charged for running seconds so no requests mean that the docker gets taken down. I have managed to resolve it with Cloud Scheduler that triggers a keep-alive request every 60 seconds - to webhook with noOp.
  2. I’m using SQL Proxy (that GCP requires) for me to connect to Postgres that’s hosted on GCP. I couldn’t get MySQL working at all with n8n so I have given up.
  3. I’m having Memory Leak issues (currently maxing out at 4GB and crashing). Trying to figure out what might be causing it.
1 Like

Hey @lemining!

Thank you for sharing the information. May I know which version of n8n are you using? The memory leaks issue was solved by one of the community members in an earlier version. If you’re using the latest version, and still having Memory Leak issues, can you please share more details?

@harshil1712 - I have created an example repository that deploys n8n onto CloudRun. I’m using the latest docker image of n8n.

After changing the n8n_execution_process to main I seem to have resolved the issue with docker crashing. However, I have found another issue which I haven’t yet found the cause of.

Some of my webhook triggered workflows seem to be returning after a while of being active. This is even though they have been activated.

{"code":404,"message":"The requested webhook \"GET keep-alive\" is not registered.","hint":"The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)"}
1 Like