CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/Food Delivery & QSR

πŸ” Food Delivery & QSR Β· State Machine

Food Order Status State Machine

Every status of a food delivery order, from placed to delivered, including restaurant rejection, no rider and customer cancellation.

More Food Delivery & QSR templates

Drawing diagram…

What this diagram shows

  • Restaurant must accept within a few minutes or the order auto-cancels
  • Rider search can time out and be retried
  • Cancellation rules change once the food is being prepared

Prompt used

State machine for a food order: Placed, Paid, Sent to Restaurant, Accepted (or Rejected / Auto-cancelled if no response in 3 minutes, both refunded), Preparing, Rider Assigned (or Rider Search Timeout, retried), Ready for Pickup, Picked Up, Delivered. Customer cancellation is free before Preparing and charged after.

Mermaid code
stateDiagram-v2
  [*] --> Placed
  Placed --> Paid
  Paid --> SentToRestaurant
  SentToRestaurant --> Accepted
  SentToRestaurant --> Rejected: Restaurant declines
  SentToRestaurant --> AutoCancelled: No response in 3 min
  Accepted --> Preparing
  Accepted --> CancelledFree: Customer cancels
  Preparing --> RiderAssigned
  Preparing --> RiderSearchTimeout
  RiderSearchTimeout --> RiderAssigned: Retry
  Preparing --> CancelledCharged: Customer cancels
  RiderAssigned --> ReadyForPickup
  ReadyForPickup --> PickedUp
  PickedUp --> Delivered
  Rejected --> Refunded
  AutoCancelled --> Refunded
  CancelledFree --> Refunded
  Delivered --> [*]
  Refunded --> [*]
  CancelledCharged --> [*]

Related templates

C4 ArchitectureProFood Delivery & QSR

Food Delivery Platform Architecture

A Swiggy/Zomato-style food delivery platform: customer, restaurant and rider apps, and the services that match orders, riders and payments.

SequenceFood Delivery & QSR

Food Order to Doorstep Sequence

Everything that happens between a customer tapping Place Order and the food arriving: payment, restaurant acceptance, rider assignment, pickup and delivery.

FlowchartFood Delivery & QSR

Restaurant Kitchen Order Flow

How orders from dine-in, takeaway and delivery apps flow through a restaurant kitchen display system to the pass and out.

Database ERDFood Delivery & QSR

Food Delivery Menu and Orders Schema

A schema for a food delivery platform: restaurants, menus, items with add-ons, customers, orders, order items and riders.

DeploymentProFood Delivery & QSR

Food Delivery Peak-Hour Scaling

How a food delivery platform scales for lunch and dinner peaks: pre-scaling, autoscaling services, sharded databases and a surge-protected dispatch.

C4 ArchitectureProFood Delivery & QSR

Cloud Kitchen Operations Platform

A cloud kitchen that runs several virtual brands: orders from aggregators, a kitchen display system, inventory and dispatch.