subscription.billing.workflow-retention.apply-downgrade ​
Apply a scheduled workflow retention billing downgrade after the downgrade cut window.
Apply a previously scheduled workflow-retention downgrade after the renewal cut window.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-subscription |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
retention_days | integer | Yes | — | — |
storage_gb | integer | No | — | — |
max_retained_workflow_storage_bytes | integer | No | — | — |
proration_behavior | string | No | — | — |
billing_cycle_anchor | string | No | — | — |
downgrade_effective_at | string | No | — | — |
downgrade_cut_days | integer | No | — | — |
apply_scheduled_downgrade | boolean | No | — | — |
scheduled_by_workflow_ref | string | No | — | — |
workflow_schedule_uuid | uuid | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | — |
subscription_uuid | uuid | No | — | — |
retention_days | integer | No | — | — |
storage_gb | integer | No | — | — |
included_storage_gb | integer | No | — | — |
paid_storage_gb | integer | No | — | — |
max_retained_workflow_storage_bytes | integer | No | — | — |
stripe_price_ref | string | No | — | — |
stripe_subscription_item_ref | string | No | — | — |
stripe_action | string | No | — | — |
workflow_storage_price_ref | string | No | — | — |
workflow_storage_subscription_item_ref | string | No | — | — |
workflow_storage_action | string | No | — | — |
proration_behavior | string | No | — | — |
billing_cycle_anchor | string | No | — | — |
downgrade_cut_days | integer | No | — | — |
downgrade_effective_at | string | No | — | — |
scheduled_workflow_ref | string | No | — | — |
workflow_schedule_uuid | uuid | No | — | — |
scheduled_downgrade | json | No | — | — |
billing_item_uuid | uuid | No | — | — |
workflow_storage_billing_item_uuid | uuid | No | — | — |
policy_uuid | uuid | No | — | — |
governance_schedule_uuids | json | No | — | — |
payment_confirmed | boolean | No | — | — |
stripe_checkout_session_ref | string | No | — | — |
status | string | No | — | — |
completed_at | string | No | — | — |
failed_at | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | apply_change | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | apply_change | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.billing.workflow-retention.apply-downgrade",
"initial_data": {
"organization_uuid": "value",
"retention_days": 123
}
}