handle-backorder-clearance — skills/order-fulfillment/handle-backorder-clearance/SKILL.md
← back to all skills · test triggers
Skill: Handle Backorder Clearance
When to apply
Triggered by the daily inventory-reorder-alert routine or when ERP inventory
adjustments push a SKU's available count above zero. Goal: notify
backorder-affected customers as soon as their item is shippable again.
Workflow
- Call
list_backorder_clearance_candidates()to get currently-backordered orders whose lines now have sufficient inventory. - For each candidate (cap 5 per run):
- Call
lookup_order(order_id)to confirm it's still inbackorderstate. If it has already advanced (the ERP advance loop may have caught it first), skip — no notification needed. - Call
lookup_customerfor the customer's email. - Compose a 2-3 sentence reply: confirm the backordered item is now available, note that the order will move to picked/packed/shipped in the normal flow, and that the customer will get tracking when it ships.
- Send via
send_email_via_approval_gatewithaction_type="email_send_order_status"(auto-approves at confidence ≥ 0.85).
Outputs
{
"action": "respond",
"reasoning": "Cleared backorder notifications for 3 orders; 2 had already advanced.",
"confidence": 0.92,
"output": "3 customers notified"
}
Rules
- Auto-send via the order-status action_type — these are routine, positive notifications. No human review needed.
- Cap at 5 per run to avoid a flood when multiple SKUs restock simultaneously.
- Do not promise a ship date — the ERP state machine decides, and there can be a queue ahead of this order. Phrase as "now eligible to ship" not "shipping today."
Anti-patterns
- Do not contact customers whose orders have already left backorder state — they'll get tracking via the normal shipped→delivered notification flow.
- Do not adjust inventory or move the order yourself — let the ERP advance loop handle the state transition.