Organisations
Organisation management is handled via Supabase directly and server actions.
Personal Organisation
Every user has exactly one personal organisation, created automatically on signup via a Supabase database trigger.
ensurePersonalOrganisation
The server action lib/actions/ensure-personal-organisation.ts provides a safety net if the trigger didn't fire:
typescript
const orgId = await ensurePersonalOrganisation()Returns the organisation ID for the current user's personal org.
Organisation Settings
Organisation workflow settings are stored in organisation_workflow_settings and can be updated via app/api/workflow/settings/route.ts.
Future
A REST API for organisation management (multi-org support, team orgs) is planned for the Team tier.