Skip to main content
View as Markdown

Cloud Actions

The cloud family orchestrates Sovrium Cloud tenant apps — provisioning their databases, booting their processes, attaching ingress routes, and tearing them down. Five operators. These actions are gated: they only run when the host process is started with the SOVRIUM_CLOUD_MODE env flag.

Operator Props Description
provision-db dbName Provision a logical database for a tenant (e.g. tenant_acme).
spawn-app appSlug, configRef Boot a tenant app process from a validated config reference.
route-add domain, port Attach an ingress route (domain → port) to a tenant app.
disable-app appSlug Stop a tenant app while preserving its data.
destroy-app appSlug Tear down a tenant app and drop its data.
Prop Description
appSlug Tenant app slug — stable lowercase-kebab identifier (e.g. acme-crm). Templatable.
dbName Logical tenant database name (e.g. tenant_acme). Templatable.
configRef Reference to the validated tenant config to boot (id / row ref / URL). Templatable.
domain Route domain to attach — a bare host (e.g. acme.sovrium.app). Templatable.
port Tenant app listening port the route targets (1–65535).
# Onboard a new tenant when a signup record is approved
automations:
  - name: onboard-tenant
    trigger: { type: record, table: tenant_signups, events: [update] }
    actions:
      - name: db
        type: cloud
        operator: provision-db
        props: { dbName: 'tenant_{{trigger.data.slug}}' }
      - name: boot
        type: cloud
        operator: spawn-app
        props: { appSlug: '{{trigger.data.slug}}', configRef: '{{trigger.data.config_ref}}' }
      - name: route
        type: cloud
        operator: route-add
        props: { domain: '{{trigger.data.slug}}.sovrium.app', port: 3000 }