Georg Kalus
/

N8N in a Scaleway Serverless Container

Scaleway Serverless Container Product Illustration

What are the options for N8N on Scaleway?

I have a N8N workflow that I want to run once per day. As I am currently exploring Scaleway, I decided to use Scaleway infrastructure.

N8N comes in a handy Docker container. There seem to be three options for containers with Scaleway

A serverless container seems to be a natural choice, especially since I want to run my workflow only once per day. The rest of the day the infrastructure could be scaled to zero. Let’s explore this option.

Serverless containers cannot be attached to persistent volume

N8N requires a persistent volume to store workflows, executions, credentials, logs, etc. Most of the data is stored in a SQLite database actually, whose data file resides in the persistent volume.

For Scaleway Serverless Containers, this is not an option as we cannot mount a volume to the container.

PostgreSQL as an alternative?

N8N lets us use a PostgreSQL database instead of SQLite to store workflows, executions, credentials, etc.. But even then, the persistent volume is still needed for N8N to run properly. Without a volume, N8N will always start over unititialized when the serverless container is recreated.

Serverless Container and VPC

There is another limitation of serverless containers together with other services, such as the PostgreSQL database: serverless containers do not support private networks at the moment. There is a highly voted feature request for Serverless Container and Private Network that is being worked on. But as of now, we cannot put the Serverless Container and the PostgreSQL database in a private network. To be reachable by the serverless container, our database must be exposed to public internet. Furthermore, as a serverless container does not have a fixed IP, we cannot limit the whitelist to only that IP. What we can do, however, is to limit at least to the range given by Scaleway.

Conclusion

As of now, it is not a viable option to run N8N in a serverless container in Scaleway. The persistent volume is a must-have for N8N to function properly and the fact that the database would have to be exposed to public internet is at least not very good from a security point of view.

To top