Case Study · Independent · Automation Engineering

The Automation Platform — ~50 workflows in production

A self-hosted n8n instance that runs real businesses: a staged product pipeline, a unified AI gateway, media services, sales agents, scrapers, and a central alerter. Not demos — production workflows with execution history, failure rates, and things that break at 2am.

Most automation portfolios show one workflow. This is an operating system made of them.
n8n (self-hosted, Docker)Node.jsPostgreSQL PuppeteerAI GatewayCloudflare Tunnel
platform scorecard — measured on the live instancerunning
~50
unique workflows in production
447
production executions in the measured period
9.2%
failure rate — every failure alerted, not silent
50.8s
average run time per execution

These are figures read off my own running instance, not estimates. The failure rate is published deliberately: a platform that claims zero failures isn't measuring.

01Why Build a Platform Instead of Automations

Anyone can wire a webhook to a spreadsheet. The problem starts at the tenth workflow: two of them write the same field, one fails silently at 3am, a provider changes its quota, and nobody knows which run produced which row. At that point you no longer have automations — you have an unmanaged distributed system.

So I built it as a platform: staged pipelines with names, one database holding all state, one gateway for AI providers, one alerter for every failure, and configuration instead of edits.

02The Workflow Families

The staged product pipeline (PG-00 → PG-95)

A numbered chain where each stage owns one job: Scrape Dispatcher, Manual Intake, Content Factory, Media Factory, Knowledge Sync, Publisher, AI Gateway, Alerter. The numbering isn't cosmetic — it's the execution order and the debugging map.

Client deployment families

Per-client workflow sets (Product Intelligence, Media Assets, Content Generator, WooCommerce Publish, Operation Engine, page scrapers) — the same architecture instantiated per tenant with its own configuration and keys.

Conversational sales agents

Messenger and WhatsApp agents built and iterated through several versions, plus a GPT-4-backed Messenger bot handling text, image, and voice input — with knowledge synced from the product database so new products are sellable without retraining.

Scrapers & utilities

Google Maps lead scraper, supplier catalog scrapers, an automated resume-processing flow, a LinkedIn post generator, and a Dockerized video-render workflow — the long tail where automation actually pays.

03Architecture

Triggers
forms · webhooks · schedules
Pipeline Dispatcher
reads state from PostgreSQL · fires the right stage
Deterministic Services
pricing · state transitions · money
Unified AI Gateway
3 providers · fallback chain · per-call cost log
Node.js Media Service
rembg · sharp · ffmpeg · Puppeteer
Storefronts & Channels
WooCommerce · Meta · Messenger · WhatsApp
Central Alerter
every failure → Telegram
PostgreSQL holds all state · heavy work runs outside the automation engine · Cloudflare Tunnel exposes local services safely
SCREENSHOT SLOT
n8n canvas — the production workflow list
(blur credentials & keys)assets/n8n-workflow-list.png

04Engineering Decisions That Made It Survivable

One gateway, three providers: every AI call goes through a single contract over OpenAI, Gemini, and OpenRouter, with an automatic fallback chain on failure or quota limits — and per-call cost logging, so spend is a number rather than a surprise.
AI never touches money: language, description, and visual analysis are AI's job. Pricing, totals, and state transitions run in deterministic code — a whole class of unpredictable errors removed from the financial path.
Exit-checks, not optimism: each workflow ends by re-reading the database to verify what should have been written actually was. Nothing counts as success until it's proven — silent failures become immediate, visible ones.
Heavy work outside the engine: scraping, image, and video processing run in stateless Node.js microservices, so a slow render can't block the orchestration layer.
Configuration over code: provider, model, post counts, video templates, brand colors, margin tiers, shipping rates, publishing on/off — dozens of database settings drive behavior. Changing behavior edits a cell.
One alerter for everything: any failure anywhere pushes to Telegram. A 9.2% failure rate is only acceptable because every one of those failures is seen.

05Where It Runs

This platform isn't theoretical infrastructure — it's the engine underneath the other builds in this portfolio: the Al-Raky AI Commerce Operating System, the SalamaSons ad-intelligence loop, and the Jotia dropshipping platform. Same instance, same conventions, three different problems.

Ad-engagement analytics push AI recommendations to Telegram every 4 hours.
Per-product handling across the content chain dropped from hours to minutes.
Media processing runs locally at near-zero cost — only text calls carry a per-call price.

06What I'd Fix

Honest accounting: the instance carries duplicate workflow versions from heavy iteration — several "v2" copies and experimental drafts that were never cleaned up. It's the signature of fast experimentation, not of disciplined housekeeping, and it's the first thing I'd consolidate before handing this to a team.

07Skills Demonstrated

Workflow engineeringDistributed system design AI gateway / provider abstractionPrompt engineering Node.js microservicesWeb scraping PostgreSQL state modelingObservability & alerting Self-hosting & DockerSecrets management