Skip to content

Organization Management Guide 🟑 BETA

Create and scope organizations from their real sources, and prove that a name change in the cloud does not silently rename Drive bots.

Admin guide Β· organization runbook

When to use Before you start Steps Verify Roll back
Signup, onboarding a tenant, resolving a Drive/cloud mismatch DB and Vault access Query org, branch and workspace rows One verified owner per scope Restore the previous row from backup

When to use

Use this runbook when a tenant is created, when a workspace appears in Drive but not in the cloud, or when an organization is renamed.

Before you start

  • An organization is created by signup or by the New Workspace API. A .gborg uploaded directly into Drive is discovered by the drive monitors and gets bots, but it has no cloud_workspaces row until it is created there.
  • Renaming a workspace row does not rename the bots in Drive. The two namespaces are separate.
  • Products are seeded by branch_id; in global SaaS admin mode the scope is the nil UUID. Each signed-up organization gets its own scoped set.
  • Products are not CRM entities: they share the scope but have no foreign key to CRM.

Steps

# 1. Resolve the organization and its branch from the database.
psql -h localhost -U postgres -d botserver -c \
  "SELECT id, name, branch_id FROM cloud_workspaces ORDER BY name;"

# 2. Inspect Drive buckets for the same tenant (credentials from Vault).
source <(grep -E '^VAULT_' "${WORKSPACE}/.env")
export VAULT_ADDR="$VAULT_ADDR"
export VAULT_CACERT="${WORKSPACE}/botserver-stack/conf/system/certificates/ca/ca.crt"
export VAULT_TOKEN=$(cat /tmp/vault-token-gb 2>/dev/null || echo "$VAULT_TOKEN")
VAULT_BIN="${WORKSPACE}/botserver-stack/bin/vault/vault"
DRIVE_ACCESSKEY=$($VAULT_BIN kv get -field=accesskey secret/gbo/drive)
DRIVE_SECRET=$($VAULT_BIN kv get -field=secret secret/gbo/drive)
DRIVE_PORT=$($VAULT_BIN kv get -field=port secret/gbo/drive)
/tmp/oc alias set local "http://127.0.0.1:${DRIVE_PORT}" "$DRIVE_ACCESSKEY" "$DRIVE_SECRET" --api s3v4
/tmp/oc ls local/

# 3. If Drive has the org but the cloud does not, create the cloud workspace
#    through the documented surface; do not rename a row to fix the mismatch.

Verify

Check Surface Pass condition
Workspace row cloud_workspaces query one row with a unique branch_id
Drive tree /tmp/oc ls local/ .gborg / .gbai prefixes match the org
Product scope seeded products by branch_id org sees its own set
Isolation cross-org read with a session refused
Rename cloud name vs Drive bot names change is understood to be independent

Roll back

πŸ”΄ Restore the previous cloud_workspaces row from a pre-change dump and re-run the table. A Drive tree is never renamed to repair a cloud row; use restore backup runbook for data damage and incident response for an exposure.