AI Operations Control Room
A Telegram-first control plane for researching, drafting, approving and publishing financial content. AI drafts; a state machine decides; a human approves.
Agents where useful. Deterministic software where mistakes have consequences.
01Context
A small editorial operation publishes daily macro and forex content to public channels. The admin works from a phone, between other tasks.
02Problem
Use LLMs to research and draft — without ever letting a model publish something on its own.
03Constraints
- Publishing is irreversible and public
- Admin interface must be Telegram
- Must survive restarts without double-posting
- Single VPS, Docker only
04My role
What I personally built
- Router / worker / sender control-plane architecture
- Approval state machine with opaque tokens
- Outbox pattern — only the sender calls external APIs
- n8n workflows for LLM drafting
- One-command bring-up: Docker, migrations, workflow import, health checks
- Handoff and operations documentation
What others owned
Independent project — no team. Everything here is mine.
05Architecture
Architecture explorer
The business flow — what happens, in plain words.
01 / 04
Admin asks — A command from Telegram.
06Key decisions
Outbox pattern for every external side effect
- Because
- Exactly one component can publish; retries never double-post.
- Trade-off
- Extra table and a polling sender.
Deterministic state machine; LLM only drafts
- Because
- Consequential actions stay auditable and predictable.
- Trade-off
- Less 'magic' conversational UX for the admin.
07System
Telegram updates hit a webhook router. A worker advances a PostgreSQL-backed state machine and calls n8n for drafts. Messages are written to an outbox; a dedicated sender is the only component allowed to talk to Telegram or Postiz. Approval requires an explicit callback carrying an opaque token.
08Challenges
- No LLM auto-routing on free text — every transition is explicit
- Idempotent delivery across restarts
- Reproducible setup for a non-developer operator
09Outcome
MVP operational: draft macro post → approval callback → publish to a public Telegram channel, brought up with a single script.
10What I learned
The most important agent design decision is what the agent is not allowed to do.
11Stack
- Node.js
- Express
- PostgreSQL
- n8n
- Telegram Bot API
- Docker Compose
- OpenClaw
- Postiz
- Apify
- Webhooks
12Evidence
- Private repository — architecture walkthrough on request
- Related public repo: forex-bot-v2