Skip to content
Proud to collaborate with Microsoft for Startups

apphost.database.attach ​

Attach Orkestia AppData Postgres (the app's own instance on dbhost) as DATABASE_URL on a claimed AppHost site. Not Neon.

Attach the site's AppData Postgres instance as DATABASE_URL.

Overview ​

PropertyValue
Workflow typeDag
LibraryApp-apphost
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
site_uuiduuidYes—Claimed AppHost site (uses its identity app)

Output Schema ​

FieldTypeRequiredDefaultDescription
site_uuiduuidNo——
sitejsonNo——
provisionjsonNo——
credentialjsonNo——
syncjsonNo——
secretjsonNo——
ackjsonNo——
failure_reasonstringNo—Engine-stamped failure reason
failure_typestringNo—Stable failure classification
failed_actionstringNo—Action that failed
failed_at_statestringNo—State when the workflow failed
failed_stepjsonNo—Failed DAG step envelope
failed_layerjsonNo—Failed DAG layer envelope
errorstringNo—Engine-stamped exception message
error_typestringNo—Engine-stamped exception class name
compensation_triggerjsonNo——
comp_queuejsonNo——
comp_current_layerjsonNo——
comp_retry_countjsonNo——

DAG Layers ​

#LayerStepsCompensation
1resolveapphost.database.prepareapphost.web.ack
2provisionappdata.instance.provisionapphost.web.ack
3credentialappdata.credential.ensure-appapphost.web.ack
4applyk8s.manifest.syncapphost.web.ack
5secretkubernetes.secret.ensure—

Execution Flow ​

Compensation ​

When any layer fails, its compensation steps run in reverse order to roll back the work completed so far.

Sub-workflows ​

Sub-workflowStep name
apphost.database.preparesite
appdata.instance.provisionprovision
appdata.credential.ensure-appcredential
k8s.manifest.syncsync
kubernetes.secret.ensuresecret
apphost.web.ackack

Outcomes ​

OutcomeTypeDescriptionState Data Keys
attachedSUCCESSAppData DATABASE_URL applied in the site namespacesite, provision, credential, sync, secret
failedFAILUREApphost workflow failedfailure_reason

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "apphost.database.attach",
  "initial_data": {
    "site_uuid": "value"
  }
}