Skip to content
Proud to collaborate with Microsoft for Startups

apphost.site.set-mode ​

Switch a hosted site between active, redirect, and suspended serving modes

Switch how a hosted site is served (active | redirect | suspended).

Inputs:

  • site_uuid: the HostedSite (required)
  • mode: active | redirect | suspended (required)
  • redirect_target: absolute https URL, required iff mode=redirect

Behavior: updates hosted_site.mode (+redirect_target) and mirrors the mapping into the CloudFront KVS. mode=active is rejected when the site has no active release. Outputs: site_uuid, mode, url.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-apphost
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
site_uuiduuidYes—HostedSite UUID.
modestringYes—Target serving mode: active
redirect_targetstringNo—Absolute https URL; required iff mode=redirect.

Output Schema ​

FieldTypeRequiredDefaultDescription
site_uuiduuidNo——
modestringNo——
urlstringNo—Public serving URL for the site's slug.
redirect_targetstringNo—Absolute https URL when mode=redirect; otherwise omitted.
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepjsonNo——
failed_layerjsonNo——
errorstringNo——
error_typestringNo——
reasonstringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—executeMode change accepted; will validate and apply
completedNoYesYes—hosted_site.mode updated and KVS mapping written
failedNoYesNo—Mode change rejected or KVS write failed

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompletedValidate the request, update the row, mirror into KVS
* (any state)failfailedTerminal failure

Outcomes ​

OutcomeTypeDescriptionState Data Keys
mode_updatedSUCCESSHosted site serving mode updated and mirrored to CloudFront KVSsite_uuid, mode, url
failedFAILUREApphost workflow failedfailure_reason

API Usage ​

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

{
  "workflow_type": "apphost.site.set-mode",
  "initial_data": {
    "site_uuid": "value",
    "mode": "value"
  }
}