Ticket orders paid but not shipped in 24 hours
Open a Zendesk ticket when an order in MySQL was paid 24 hours ago and still isn't fulfilled. The clock is computed in the query, so the absence fires.
- MySQL
- Zendesk
- Slack
- Operations
- once per order
The trigger
One read-only SELECT against MySQL. Rowfire polls it for new rows, and the rule fires once per order.
SELECT o.id AS order_id,
o.customer_email,
o.total_amount,
o.paid_at,
o.paid_at + INTERVAL 24 HOUR AS overdue_at
FROM orders o
WHERE o.paid_at IS NOT NULL
AND o.fulfilled_at IS NULL
AND o.cancelled_at IS NULLNothing happens at hour 24 of a stuck order, so the application has nothing to emit. The query turns the absence into an event. Table and column names are a sketch; adapt them to your schema.
The clock is overdue_at, computed as 24 hours after payment, and the key is
order_id. The rule fires once per order.
The ticket
Order {{ order_id }} was paid at {{ paid_at }} ({{ total_amount }}) and hasn't shipped. Customer: {{ customer_email }}.
Send it to Zendesk as a ticket for operations, or to a Slack channel, or both, with one rule each on the same trigger.
The same pattern, a timestamp plus a delay, covers any “should have happened by now”: see escalate urgent tickets nobody has answered.
Questions
What if the order ships at hour 23?
Then fulfilled_at is set and the row no longer matches, so nothing fires. Only orders still unfulfilled when overdue_at passes reach the team.
Does it work on MariaDB?
Yes. MariaDB uses the same INTERVAL syntax, and a trigger names the data source it reads.