Skip to content
Proud to collaborate with Microsoft for Startups

subscription.billing.workflow-retention.change ​

Change workflow state retention billing, storage cap, and governance policy.

Change workflow state/event retention, storage cap, and Stripe-backed tiers.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-subscription
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes——
retention_daysintegerYes——
storage_gbintegerNo——
max_retained_workflow_storage_bytesintegerNo——
payment_confirmedbooleanNo——
stripe_checkout_session_refstringNo——
proration_behaviorstringNo——
billing_cycle_anchorstringNo——
return_channeljsonNo——
agent_session_refstringNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidNo——
subscription_uuiduuidNo——
retention_daysintegerNo——
storage_gbintegerNo——
included_storage_gbintegerNo——
paid_storage_gbintegerNo——
max_retained_workflow_storage_bytesintegerNo——
stripe_price_refstringNo——
stripe_subscription_item_refstringNo——
stripe_actionstringNo——
workflow_storage_price_refstringNo——
workflow_storage_subscription_item_refstringNo——
workflow_storage_actionstringNo——
proration_behaviorstringNo——
billing_cycle_anchorstringNo——
downgrade_cut_daysintegerNo——
downgrade_effective_atstringNo——
scheduled_workflow_refstringNo——
workflow_schedule_uuiduuidNo——
scheduled_downgradejsonNo——
billing_item_uuiduuidNo——
workflow_storage_billing_item_uuiduuidNo——
policy_uuiduuidNo——
governance_schedule_uuidsjsonNo——
payment_confirmedbooleanNo——
stripe_checkout_session_refstringNo——
statusstringNo——
completed_atstringNo——
failed_atstringNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—change_retention—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingchange_retentioncompleted—
* (any state)failfailed—

Business Errors ​

CodeMessage Template
BILLING_AUTHORIZATION_REQUIRED
BILLING_OPERATION_INPUT_ERROR
BILLING_OPERATION_STRIPE_NOT_CONFIGUREDSTRIPE_SECRET_KEY is required for paid billing item changes
BILLING_OPERATION_PRICE_NOT_CONFIGUREDNo Stripe price is configured for {item_code}
BILLING_OPERATION_PLATFORM_SUBSCRIPTION_NOT_FOUNDNo active platform subscription found for organization
BILLING_OPERATION_PLATFORM_SUBSCRIPTION_NOT_BILLEDOrganization {organization_uuid} has an active platform subscription record with no Stripe subscription behind it — platform checkout must complete before paid add-ons can be purchased

API Usage ​

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

{
  "workflow_type": "subscription.billing.workflow-retention.change",
  "initial_data": {
    "organization_uuid": "value",
    "retention_days": 123
  }
}