See Ash Code logo See Ash Code

Why the automation stack became six services

Ashlynn Antrobus
• • 2 min read

The automation stack ended up with six services: n8n, PostgreSQL, Flask, Express with Playwright, Ollama, and Qdrant.

I didn’t start by deciding that six containers would be an interesting number. I had jobs to run, and the jobs didn’t all fit in the same runtime or need the same lifecycle.

A dragon stands in a village square surrounded by six different workshops.

Illustration: separate workshops with different jobs.

The working extraction request was one example. n8n could make the HTTP request. The separate Express service could run Playwright and return the extracted result.

Python code still needed Python

I also had an HTML extraction function using Python’s jusText. The n8n Code-node setup I was using could work with external Node packages, but it didn’t give me arbitrary Python packages in the way I wanted.

Translating the function into JavaScript was one option I explored. Keeping Python work in a Flask service was another way to give that work an environment with its own dependencies.

That made the boundary an HTTP request instead of an attempt to make one process import every package I wanted to use.

The responsibilities in the stack

The resulting arrangement can be drawn by responsibility:

Automation
  [n8n: coordinate workflow steps]

Application services
  [Flask: Python API work]
  [Express + Playwright: browser extraction]

Data and model services
  [PostgreSQL: relational storage]
  [Ollama: local model serving]
  [Qdrant: vector storage]

Those are six services, not six required stops for every request. The extraction call already discussed takes a short path: n8n sends POST /extract to Express, Playwright does the browser work, and the response goes back to n8n. Other workflow steps can use the data or model services they require.

I don’t need to put a database or a model server in the path of a request that doesn’t use it.

Starting the processes separately

I rejected the suggestion to put Python and Node daemons together in one Dockerfile with an improvised startup arrangement. If one process stopped and the other stayed alive, I would need another mechanism to decide whether the container was healthy and what should restart.

Separate services let me inspect and restart the process responsible for a particular job. I can change the browser extractor without treating the database as part of the same process startup.

I also didn’t want nodemon or npm run dev to become the permanent startup plan merely because those commands were convenient during development. The self-hosted service needed an intentional entry point.

The split worked, but it added coordination work. Service names, request methods, mounted data, and dependency readiness still had to agree. The earlier GET/POST mismatch was a good example of a small interface disagreement between otherwise reachable containers.

AA

Written by Ashlynn Antrobus

Software developer, author, and builder. Sharing technical lessons learned from building tools like Ebook2Text, IndexedDict, and rag-mcp, and navigating life as a programmer with dyslexia.