A simple todo app that emits events to Atelier on every operation. Use it to see how external apps trigger agent workflows via Atelier's event system.
| Event | When | Payload |
|---|---|---|
todo.created |
A new todo is added | {id, title, description, priority, completed, created_at} |
todo.updated |
A todo is edited | {...todo, changes: {fields that changed}} |
todo.completed |
A todo is marked done | {id, title, description, priority, completed, created_at} |
todo.deleted |
A todo is removed | {id, title, description, priority, completed, created_at} |
# 1. Install dependencies
uv sync
# 2. Configure Atelier connection
cp .env.example .env
# Edit .env with your Atelier URL and API key
# 3. Run
≈| Variable | Description | Default |
|---|---|---|
ATELIER_URL |
Atelier backend URL | (empty — events skipped) |
ATELIER_API_KEY |
Your per-user API key from Atelier Config page | (empty — events skipped) |
- Todo app — a FastAPI app with an in-memory store and a single-file HTML frontend. CRUD operations on todos.
- Event integration (
integration.py) — a thinemit_event()helper that POSTs to Atelier's/api/v1/eventsendpoint with an event type and payload. Fire-and-forget: if Atelier is unreachable, the todo operation still succeeds. - Atelier side — in the Atelier UI, create a workflow that subscribes to
todo.* (or a specific event liketodo.completed). When the todo app emits a matching event, Atelier queues a run and your agent processes it.
In Atelier, create a workflow:
- Event type:
todo.completed - Agent: your agent
- Instructions: "When a todo is completed, send a congratulations notification to the user."
Now when you check off a todo in this app, Atelier's agent runs automatically.
The same server exposes todo operations as MCP tools at http://127.0.0.1:3001/mcp.
In Atelier, add an MCP connection:
- URL:
http://127.0.0.1:3001/mcp - Transport: Streamable HTTP
Available tools: list_todos, get_todo, create_todo, update_todo, toggle_todo, delete_todo.
This lets your Atelier agents manage todos directly — e.g., a workflow triggered by todo.completed can call list_todos to check if all are done, then create_todo to add a new one.
todo-app/
main.py # FastAPI app + HTML frontend + MCP mount
mcp_tools.py # MCP tool definitions
integration.py # Atelier event emitter
pyproject.toml # Dependencies
.env.example # Environment template
| Method | Path | Description |
|---|---|---|
GET |
/ |
HTML frontend |
GET |
/api/todos |
List all todos |
POST |
/api/todos |
Create a todo |
PATCH |
/api/todos/{id} |
Update a todo |
DELETE |
/api/todos/{id} |
Delete a todo |
POST |
/api/todos/{id}/toggle |
Toggle completed |