Order Flow

A sequential order pipeline: payment, inventory, shipment, confirmation. Demonstrates a strict dependency chain where each Step needs the previous one's output and a single goal pulls the whole plan together.

Scenario

Process orders through payment, inventory, shipment, and notification.

Flow Design

Goals: [send-confirmation]

Since each Step depends on the previous one, the planner will automatically include all upstream Steps (charge-payment, reserve-inventory, create-shipment) to satisfy the Goal.

Payment Step

  • Charge the customer’s payment method
  • Output: transaction_id

Inventory Step

  • Reserve items for the order
  • Needs: order_id, items
  • Output: reservation_id

Shipment Step

  • Create shipment with reserved inventory
  • Needs: order_id, reservation_id
  • Output: tracking_number

Notification Step

  • Send confirmation email
  • Needs: customer_email, tracking_number
  • Output: confirmation_sent

Attribute Flow

graph TD Init["order_id, customer, items,
payment_method (initial)"] A["charge-payment
(transaction_id)"] B["reserve-inventory
(reservation_id)"] C["create-shipment
(tracking_number)"] D["send-confirmation
(confirmation_sent)"] Init --> A A --> B B --> C C --> D

Key Points

  • The chain is strictly sequential because each Step needs the previous Step’s output
  • Payment runs first; if it fails, inventory and downstream Steps never start
  • Confirmation runs only after the shipment is created
  • No fan-out here, this is a pure dependency chain

For parallel work, see the Parallel Tasks example.