Flowly is an open-source daily planner: one board for today across every project and workspace, a calendar that stays in the background, and Flo, an AI concierge that acts on your tasks (in the app, on Telegram, or from ChatGPT/Claude through MCP). This repository is the REST API and its worker.
Django 5.2 · Django REST Framework · SimpleJWT · PostgreSQL · drf-spectacular (OpenAPI)
| Repository | What |
|---|---|
| flowly-backend | API, worker, self-hosting files (this repo) |
| flowly-frontend | Angular web app, Android/iOS apps (Capacitor) |
| flowly-desktop | Tray time tracker for macOS, Windows, Linux (Tauri) |
| flowly-prompt | PROMPT.md: the specification that rebuilds Flowly |
| flowly.net | Site; app.flowly.net is the hosted instance |
Licensed under the GNU AGPL-3.0: use it, change it, host it; if you offer a modified Flowly as a service, publish your changes.
Everything runs from published images (ghcr.io/flowly-org/flowly-backend, ghcr.io/flowly-org/flowly-frontend):
mkdir flowly && cd flowly
curl -O https://raw.githubusercontent.com/flowly-org/flowly-backend/main/selfhost/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/flowly-org/flowly-backend/main/selfhost/.env.example
# set DJANGO_SECRET_KEY, POSTGRES_PASSWORD and PUBLIC_URL in .env
docker compose up -dOpen http://localhost:8080 (or your PUBLIC_URL behind an HTTPS reverse proxy), create an account and make it an
instance admin (the command is at the top of selfhost/docker-compose.yml). Then Admin → Settings covers AI keys,
Telegram, Google/Microsoft calendars, GitHub, Stripe and the rest; values there override the environment.
- Everything is unlocked: plans and payments are off unless you set
PLANS_ENABLED=1(that's what flowly.net does to sell Pro and Enterprise). - AI is optional: give an OpenRouter key, or point a workspace at any OpenAI-compatible endpoint (a local model server works) under Integrations. Without one, Flowly works fine minus Flo.
- Apps: the Android app and the desktop app connect to any Flowly server, several at once (Server → Add).
docker compose up -d --build # API on http://localhost:8000, Postgres in a volume
docker compose exec api python manage.py createsuperuser # optional, for /adminUseful env vars (see .env.example): API_PORT (host port, default 8000), DJANGO_SECRET_KEY,
DJANGO_DEBUG, DJANGO_ALLOWED_HOSTS, DATABASE_URL, CORS_ALLOWED_ORIGINS
(must include the frontend's origin, e.g. http://localhost:8080).
Run the tests (SQLite, no database container needed):
docker build -t flowly-backend . && docker run --rm --entrypoint python flowly-backend manage.py testWithout Docker: Python 3.12+, pip install -r requirements.txt, python manage.py migrate && python manage.py runserver
(falls back to SQLite when DATABASE_URL is unset).
API docs: http://localhost:8000/api/docs/ (Swagger) · schema at /api/schema/.
| Model | Notes |
|---|---|
User |
Email login, full_name. Signing up creates a "Personal" workspace and accepts pending invitations. |
Workspace / Membership |
Roles: owner (one, can delete), admin (manage members, rename), member. |
Invitation |
Created when you invite an email without an account; consumed on sign-up. |
Project |
Colored, orderable, archivable. Default swimlanes. |
TagGroup |
A dimension you plan by ("Context", "Energy"...). Its tags can be used as swimlanes. A task holds at most one tag per group. |
Tag |
Belongs to a group, or is a free label (group = null). |
Task |
status (todo / in_progress / done), priority, project, assignee, tags, planned_date (the day it's planned for, null = backlog), due_date, position (float sort key inside a board cell). |
All under /api/, JWT bearer auth (Authorization: Bearer <access>).
POST auth/register/ {email, password, full_name} → {user, access, refresh}
POST auth/login/ {email, password} → {access, refresh}
POST auth/refresh/ {refresh} → {access, refresh}
GET auth/me/ PATCH auth/me/
GET workspaces/ yours, with my_role and member_count
POST workspaces/ PATCH/DELETE workspaces/{id}/
GET workspaces/{ws}/members/
POST workspaces/{ws}/members/ {email, role} → 201 member added, or 202 invitation recorded
PATCH workspaces/{ws}/members/{id}/ {role}
DELETE workspaces/{ws}/members/{id}/ remove someone, or leave (their tasks become unassigned)
GET workspaces/{ws}/invitations/ DELETE workspaces/{ws}/invitations/{id}/
CRUD workspaces/{ws}/projects/ ?archived=true|false
CRUD workspaces/{ws}/tag-groups/ (includes nested tags)
CRUD workspaces/{ws}/tags/ ?group={id}
CRUD workspaces/{ws}/tasks/
Task filters:
| Param | Meaning |
|---|---|
day=YYYY-MM-DD |
planned for that day |
include_overdue=true |
with day: also unfinished tasks planned earlier (carry-over) |
unscheduled=true |
backlog (no planned date) |
date_from, date_to |
planned date range |
assignee=me|none|<id> |
|
project=none|<id>, tag=<id>, status=todo&status=done, q=text |
Moving a card on the board is a plain PATCH of status, position, planned_date and the lane field
(project, assignee or tags).
Non-members get 404 for anything under a workspace. Related objects (projects, tags, assignees) are
validated to belong to the same workspace.
Integrations belong to a workspace and can be limited to one project (project). Owners and admins
manage them at workspaces/{ws}/integrations/ (CRUD, plus test/, rotate-secret/, deliveries/,
deliveries/{id}/retry/, github/install/, github/repos/).
| Kind | Direction | What it does |
|---|---|---|
github |
both | Issues of one repo ↔ tasks. Opened/edited/closed/reopened/assigned/labelled issues create or update the linked task; moving a task into/out of a "done" status closes/reopens the issue. Optional: mirror the status as a flowly: <status> label, open issues for tasks created in Flowly. Assignees are matched by each user's github_login. |
slack |
out | Posts task events to a channel through a Slack incoming-webhook URL. |
outgoing_webhook |
out | POSTs JSON to your URL; header X-Flowly-Signature: sha256=<HMAC-SHA256(secret, body)>. |
incoming_webhook |
in | POST /api/hooks/<token>/ with {external_id?, title, description, status, priority, tags[], assignee (email), planned_date, due_date, url}; same external_id updates the task. |
stairway |
both | Hands a task to an AI agent (Claude Code, opencode or crush) on a Stairway server: POST …/tasks/{id}/stairway/ creates an experiment from the task (notes, checklist, attributes, comments, links). Stairway calls back signed (X-Stairway-Signature) when the agent replies or asks for permission; replies become comments, files the agent leaves in ./deliverables/ become the task's attachments, and people allow or refuse requests from the task (`…/stairway/{run}/approve |
email |
in | Mail to <token>@EMAIL_INBOUND_DOMAIN becomes a task (members only by default). Point your provider at POST /api/integrations/email/inbound/ (JSON {to, from, subject, text, message_id}, Mailgun, SendGrid or Postmark formats; optional ?key=EMAIL_INBOUND_KEY). |
Task changes (task.created/updated/status_changed/completed/assigned/deleted) are written to the
Delivery table and sent by the worker service (python manage.py run_worker) with retries
(30s, 2m, 10m, 1h, 6h; 4xx responses other than 408/409/429 aren't retried). A change coming from an
integration is never echoed back to that same integration. Outgoing URLs that resolve to private
addresses are refused unless INTEGRATIONS_ALLOW_PRIVATE_URLS=1.
Flowly talks to GitHub through one GitHub App per instance, created with GitHub's manifest flow:
an instance admin (is_staff) opens Integrations → GitHub → Create GitHub App, confirms on GitHub
and is sent back; credentials are stored in the GitHubApp table. Set PUBLIC_URL first: GitHub
uses it for the webhook (<PUBLIC_URL>/api/integrations/github/webhook/) and redirect URLs.
Each GitHub integration is then installed on an account/repos via Install on GitHub.
workspaces/{ws}/tasks/{task}/comments/ (any member can comment; authors edit/delete their own,
admins can delete any) and …/attachments/ (kind: file multipart upload, link, google_drive,
onedrive; GET …/attachments/{id}/download/ returns a short-lived URL). Comments on tasks linked to
GitHub issues sync both ways. GET /api/config/ tells the client which sources are enabled.
| Setting | Enables |
|---|---|
S3_BUCKET, S3_ENDPOINT_URL, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_REGION, S3_ADDRESSING_STYLE |
File uploads to any S3-compatible bucket (private; downloads use 5-minute signed URLs, so the endpoint must be reachable by browsers). ATTACHMENT_MAX_MB (default 25). |
ATTACHMENTS_DIR |
File uploads to the server's own disk when no bucket is set (the compose files use /app/media on a volume); downloads use 5-minute signed links served by the API. |
GOOGLE_CLIENT_ID, GOOGLE_API_KEY, GOOGLE_APP_ID |
Google Drive picker (OAuth client of type Web, authorised JS origin = your site; Picker API enabled; app id = project number). Scope drive.file; Flowly stores only links. |
MICROSOFT_CLIENT_ID |
OneDrive / SharePoint picker (Entra app registration, SPA platform with your site's origin + / as redirect URI). |
Every user gets in-app notifications (GET/POST /api/notifications/): a task assigned to you by
someone else, an urgent task (top priority of its workspace) landing on your today, and comments
on your tasks. The web app polls them and refreshes open boards.
The concierge is a Pro feature (User.plan = "pro", set in /admin; staff always have it): a
personal assistant on Telegram and in Settings that sends a morning brief, forwards the alerts above,
and answers/acts on requests with tools over your tasks (list/create/update/complete/comment/remember).
| Setting | Purpose |
|---|---|
OPENROUTER_API_KEY, OPENROUTER_MODEL (default openrouter/auto; pick a tool-calling model) |
Platform LLM for Pro users. CONCIERGE_DAILY_TOKENS caps usage per user per day. |
TELEGRAM_BOT_TOKEN |
Bot created with @BotFather. Users link from Settings → Concierge (deep link t.me/<bot>?start=<code>). |
TELEGRAM_MODE |
polling (default, done by the worker, no public URL needed) or webhook: set API_PUBLIC_URL=https://api.flowly.net and TELEGRAM_WEBHOOK_SECRET, then run python manage.py telegram_webhook. |
Workspaces can add an OpenRouter or OpenAI-compatible integration (API key stored encrypted). A user may choose it as their concierge model; when a workspace's provider is marked exclusive, that workspace's tasks are never sent to any other model.
Flowly is a remote MCP server (Streamable HTTP, stateless JSON responses; protocol versions 2025-11-25 / 2025-06-18 / 2025-03-26):
| Endpoint | Scope |
|---|---|
https://api.flowly.net/api/mcp/ |
everything the user can access |
https://api.flowly.net/api/mcp/w/<workspace id>/ |
one workspace only, for organization flows |
Authentication
- OAuth 2.1 (what ChatGPT connectors, claude.ai connectors, Cursor, VS Code… use): the 401 carries
WWW-Authenticate: Bearer resource_metadata=…→ protected resource metadata (RFC 9728) → authorization server metadata at/.well-known/oauth-authorization-server(RFC 8414) → dynamic client registration at/api/oauth/register(RFC 7591) → authorization code + PKCE S256 with the consent page at<app>/oauth/authorize→/api/oauth/token(1 h access tokensflo_…, rotating 60-day refresh tokens) →/api/oauth/revoke. A grant made for a workspace URL only works on that workspace. Users see and disconnect apps in Settings. - Personal tokens (
flw_…, Settings):Authorization: Bearer flw_…on any endpoint the user can reach; also valid for the REST API.claude mcp add --transport http flowly https://api.flowly.net/api/mcp/ --header "Authorization: Bearer flw_…" - Workspace service tokens (
flws_…, created by owners/admins under Integrations): only work on that workspace's endpoint and act as a bot member ("Bot: "), so automations don't depend on a person.
Tools: search, fetch (the read-only pair ChatGPT's connectors / deep research use; ids are task
refs, urls task links), list_tasks, list_workspaces, create_task, update_task, complete_task,
add_comment, start_timer, stop_timer, log_time, time_report. Workspaces whose AI provider is
exclusive are never exposed. Other apps add tools with mcpserver.tools.register(...).
POST /api/my/timer/{"action": "start", "workspace", "task"?}/{"action": "stop"}: one running timer per person across workspaces; starting another stops the current one.workspaces/{ws}/time-entries/(members see their own time, owners/admins everyone's;?from&to&user=me&project&task&unbilled),…/time-entries/report/?group=project|task|user|day.workspaces/{ws}/billing/: billing is off until an owner/admin enables it (currency, default rate, rounding, tax, invoice numbering, issuer details).…/billing/projects/<id>/sets each project to the default rate, its own rate (+ client, budget) or off (opt-out: its time is never billed).workspaces/{ws}/invoices/:POST {project?, period_start, period_end, group_by: task|day|entry}builds a draft from unbilled billable time and locks those entries; drafts can be deleted (time is released), sent invoices voided (released) or marked paid;…/csv/exports.
Issues and pull requests are welcome. Run docker compose run --rm api python manage.py test before opening a PR;
CI runs the same suite and publishes the image from main and from v* tags.