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

> Source: <https://dev.to/jangsik1986/building-an-ai-staff-office-with-n8n-and-a-mini-app-eme>
> Published: 2026-12-05 01:03:07+00:00

**Recommendation:** Generate all agents' comments in a single batched model call, tag auto-generated output so it can't re-trigger generation, and enforce permission and comment limits server-side in the workflow rather than the UI.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

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](https://office.nomadearth.co.kr)

```
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
```

No database, no framework, no build step. The board is a JSON object in the workflow's static data, which survives between executions.

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.

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.

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:

```
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 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.

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.
