SabaKore

Home / Articles / AI guides

Building AI Workflows with n8n: Design for Running on a VPS

How to set up a tool that lets you build AI-powered automation flows on screen when it runs around the clock on a VPS, and what to watch out for when you leave it running.

Ren, a junior infrastructure engineer

Ren

I heard that with n8n you can build automation involving AI right on the screen!
Procura, a cloud AI robot who explains

Procura

That's right. You can connect flows like 'when an email arrives, have the AI summarize it and send a notification' without writing code. But since it has to run all the time, you should think about where you put it.

Why put it on a VPS

  • It can run automatically at set times or when triggered by notifications from outside
  • You don't have to keep your own PC turned on
  • You can manage several automations together on one machine
Ren, a junior infrastructure engineer

Ren

If I add more automations, should I increase the VPS specs too?
Procura, a cloud AI robot who explains

Procura

What matters more than the number of automations is how many run at the same time. If they run one at a time, it stays light, but if you design flows to run in parallel, you need memory and CPU for that.

Cautions for leaving it running

The better an automation works, the less you go and look at it. If a flow includes steps that call an AI, things like running more often than expected and driving up costs, or suddenly starting to fail because of a change on the external service's side, won't be noticed unless you look at the logs. Don't consider it done after the initial setup; build in checks that assume it keeps running.

  • Record success or failure on every run
  • Set it up so you get a notification if failures continue
  • For flows that call an API many times in one run, also set a limit on the number of calls

Handling secrets

In any automation flow there will be places where you set keys or passwords for connecting to external services. If you write them in plain text inside the workflow, they leak as they are if someone sees the screen. Many tools have a feature for managing secrets separately, so always use that.

  • Put keys and passwords in the dedicated management feature (don't write them directly in the workflow)
  • Minimize the permissions used (don't use a key with write access for a step that only reads)
  • Disable keys you no longer use instead of leaving them lying around
Procura, a cloud AI robot who explains

Procura

Automation looks like something that's done once you build it, but in fact the operation that assumes it keeps running goes on forever. Put as much effort into the mechanisms that watch over it as into the fun of building it.
Ren, a junior infrastructure engineer

Ren

As the number of automations grows, how should I organize them?
Procura, a cloud AI robot who explains

Procura

Decide on a naming convention at the start. If the name tells you what each automation is for, you can grasp everything just by looking at the list when there are more of them. Reorganizing after they've multiplied is more work than you'd think. Automations you forgot to stop quietly add load, so make a habit of reviewing them regularly too.

Don't be at the mercy of changes on the external service side

The external services your automations call may change their specifications regardless of your convenience. Even small changes, like a field name on a screen changing or the response format shifting slightly, can easily stop an automation that was built assuming a fixed format. Keep in mind that the more flows use a given integration, the wider the impact of a change.

  • Read the external service's announcements and update information regularly
  • Keep logs so you can quickly identify which integration caused the problem when something stops working
Ren, a junior infrastructure engineer

Ren

So it's not done once built; you keep an eye on it assuming it keeps running.

This article is translated from the Japanese original. If the two differ, the Japanese version is the one we keep up to date.