CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/SaaS & Cloud

☁️ SaaS & Cloud · State Machine

SaaS Subscription Billing Lifecycle

The states of a SaaS customer's subscription: trial, active, past due with retries, paused, cancelled and expired.

More SaaS & Cloud templates

Drawing diagram…

What this diagram shows

  • Trials convert to paid when a payment method is added
  • Failed renewals retry for a grace period before access stops
  • Cancelled subscriptions keep access until the period ends

Prompt used

State machine for SaaS subscription billing: Trialing for 14 days, then Active when a card is added (or Expired if not). At renewal a payment failure moves to Past Due with retries over 7 days (dunning emails); success returns to Active, final failure to Suspended. Customers can Pause and Resume, or Cancel, which keeps access until period end and then becomes Ended. Suspended accounts can Reactivate by paying.

Mermaid code
stateDiagram-v2
  [*] --> Trialing
  Trialing --> Active: Card added
  Trialing --> Expired: Trial ends, no card
  Active --> PastDue: Renewal payment failed
  PastDue --> Active: Retry succeeds
  PastDue --> Suspended: Failed after 7 days
  Suspended --> Active: Customer pays
  Active --> Paused: Customer pauses
  Paused --> Active: Resume
  Active --> CancelScheduled: Customer cancels
  CancelScheduled --> Active: Undo cancel
  CancelScheduled --> Ended: Period ends
  Expired --> [*]
  Ended --> [*]

Related templates

DeploymentProSaaS & Cloud

Kubernetes Microservices Deployment

How a microservices app runs on Kubernetes in the cloud: ingress, namespaces, services with multiple replicas, managed databases and monitoring.

FlowchartSaaS & Cloud

CI/CD Pipeline Flowchart

A typical CI/CD pipeline from a pull request to production: build, tests, security scans, staging deploy, approval and a canary release.

SequenceSaaS & Cloud

OAuth 2.0 / OpenID Connect Login

The authorization code flow with PKCE used by most modern web and mobile apps to log users in through an identity provider.

C4 ArchitectureProSaaS & Cloud

Multi-Tenant SaaS Architecture

A B2B SaaS product serving many customer organisations from one platform: tenant-aware services, per-tenant data isolation, billing and admin.

DeploymentProSaaS & Cloud

AWS Three-Tier Web Application

The classic three-tier web app on AWS: CloudFront and a load balancer, an autoscaling app tier in private subnets, and a Multi-AZ database.

C4 ArchitectureProSaaS & Cloud

Event-Driven Architecture with Kafka

Services that talk through events instead of direct calls: an order service publishes events that inventory, payments, notifications and analytics react to.