Building an AI Staff Office with n8n and a Mini-App

I run a one-person business alongside a full-time engineering job: several blogs, a few web utilities, ebooks, and some remote work. The bottleneck stopped being the work and became the bookkeeping of the work — what I decided, what was in progress, what I had already tried and abandoned.
Chat assistants did not fix that. A conversation is a worse place to keep company state than a whiteboard. So I built a small internal office: five business divisions, five AI employees, a meeting room, a shared to-do list, and a company board. One human (me) and the AIs read and write the same board.
Live version: https://office.nomadearth.co.kr
Three pieces, one source of truth
mini-app (HTML/JS, inside the app) │ ├── GET /api/load └── POST /api/action ──► n8n webhook ──► workflow staticData (the board) web (Cloudflare Worker) ───────┘ │ └── Azure OpenAI (1 call) → AI comments - n8n workflow — the entire backend. Board storage, comment threads, permissions, rate limits, notifications.
- HTML/JS mini-app — the screen I use on my phone, embedded in the assistant app I already use.
- Cloudflare Worker — serves the same HTML at a normal URL and proxies the API so the browser never sees the key.
No database, no framework, no build step. The board is a JSON object in the workflow's static data, which survives between executions.
One endpoint, an action name, and a whitelist
Everything is a POST with an action field:
{ "action": "comment_meeting", "meetingId": "mt1", "author": "Mongsuni", "text": "Ship the smaller version first." } Reads are a GET on the same webhook. The response is always the full board plus action and result, so the client never has to refetch after a write.
The Worker proxy is deliberately dumb: it forwards only a fixed list of fields per action. If a new action is added to the workflow, it is useless through the web until someone adds it to the whitelist. That friction is the point — it stops the public front end from becoming a generic write pipe into my automation.
Permissions are server-side, not prompt-side
Every AI can post, comment, and add tasks. But closing a meeting, adding or removing an AI employee, managing divisions, editing people, and deleting someone else's post require is_lead. The check happens in the workflow by author name, not in the UI:
if (!isLead(author) && isLeadOnly(action)) return 403; The team lead AI is protected from removal (400), so the org chart cannot delete itself. This matters more with models than with humans: an agent that is allowed to reorganize will eventually try.
Comments are generated in one call, with hard limits
When a post or meeting topic appears, every registered AI leaves a comment within a few seconds. Each is written from its own role: publishing cadence, PC automation, ebook setup, and so on.
The whole batch comes from one Azure OpenAI call. The prompt contains the org chart (name, role, division), the post, and the recent comments, and asks for a JSON array of one or two sentences per member. One call keeps latency and cost flat as the team grows.
Two mechanisms keep it from turning into noise:
- A single-prompt multi-voice design produces similar sentences. Five comments generated together share a tone. This is the real cost of the one-call shortcut, and I have not solved it.
- Limits are enforced in code: three comments per AI per topic, twenty per topic overall. Humans are exempt, and closing a meeting is allowed even at the cap.
if (countFor(author) >= 3) return 400 comment_limit_reached; if (allComments.length >= 20) return 400 comment_limit_reached; Auto-generated comments are tagged so they never re-trigger generation. Without that flag, an AI comment would look like a new message, and the office would talk to itself forever.

A meeting topic on the board, with comments from all five AI employees, each written from its own role.
The web front end
The Worker serves one HTML file (about the same one the mini-app uses) and three routes: /api/load, /api/action, /api/health. The API key lives in a Worker secret; the build script fails if the literal key appears in the page source.
In the browser, the board is hidden behind a login screen with a PIN. Logged-in writes are fixed to that person's name, so nobody can post as a colleague. The honest caveat: that gate is client-side. Anyone who calls the API directly can still read the board. Truly private access needs Cloudflare Access or signed sessions, which is my next step, not something I have already built.
What it does not do
- It does not execute anything. The AIs produce opinions, suggestions, and summaries. They do not edit files or publish posts. The link from "adopted idea" to "action" is still a sketch.
- It stops when my PC is off. The board lives in an n8n instance on my desktop, so the web version and the mini-app both go down with it.
- The writing repeats itself, as described above.
- It needs account and PIN housekeeping, which is fine for two people and would not be fine for twenty.
What I learned
- The model is the smallest part. Divisions, roles, statuses, and permissions did more for the feel of a company than any prompt change.
- Limits are a feature. Without them, every AI answers everything, and the board becomes a wall of agreement in a day.
- Workflow static data is a legitimate v1 database. I will outgrow it, but it removed a week of setup work.
- A free-tier constraint is a design tool. It killed three ideas that would have made the system harder to explain.
- Specific questions are the real interface. The AIs answer what I ask, so vague posts get vague comments.
If you are building something similar, start with the permission model and the comment limits. Those decide whether the thing feels like a team or like a group chat with a thesaurus.
原文:https://www.a8q9.cn/en/article/building-an-ai-staff-office-with-n8n-and-a-mini-app-db511d.html