# Send overdue paid orders to Slack

Post the IDs of paid orders still awaiting shipment after two business days. An empty result leaves the channel quiet.

[Use template](https://dashboard.fasthook.io/workflow/new?templateKey=cloudflare-d1-overdue-orders-to-slack&templateName=Send+overdue+paid+orders+to+Slack)

**Required accounts**

- Cloudflare D1
- Slack

## Send overdue paid orders to Slack

### 1. Trigger · Daily schedule

**Schedule**. Run automatically on the configured schedule.

### 2. Action · Find overdue paid orders

**Cloudflare D1**. Run a statement with bound values, or send a batch. Each row in the results uses the column names from your query.

### 3. Action · Post the overdue order IDs

**Slack**. Send text, Block Kit content, attachments, or a thread reply to a channel.

## Set up your workflow

1. **Check the order fields** Select the database containing orders. The query reads order\_id, paid\_at and shipped\_at. Map your column names in the SQL if they differ. Use UTC dates for payment and leave shipped\_at NULL while shipment is pending.
2. **Review when an order is overdue** The query counts Monday through Friday using UTC calendar dates. A payment made on Friday first appears on the following Wednesday if it still has no shipment date. The query returns no row when the backlog is empty.
3. **Choose the report time and channel** Set the daily schedule to a time your team monitors. Connect Slack, select the operations channel and invite the FastHook app if the channel is private.
4. **Check a report before relying on it** Use a test order paid more than two business days ago. Confirm its ID appears in Slack. Give it a shipment date and run again with no other overdue orders. The Slack step should be skipped.

## Related integrations

- [Schedule trigger](https://www.fasthook.io/docs/triggers/schedule)
- [Cloudflare D1 integrations](https://www.fasthook.io/apps/cloudflare-d1/integrations)
- [Slack integrations](https://www.fasthook.io/apps/slack/integrations)

## Related workflow templates

- [Send approaching origin certificate expirations to Slack](https://www.fasthook.io/templates/origin-ca-expiry-digest-to-slack.md): Check the zone each day and tell the operations channel which origin certificates are due for renewal within 30 days.
- [Archive a daily D1 SQL export in R2](https://www.fasthook.io/templates/cloudflare-d1-backups-to-r2.md): Export database schema and data as SQL and save a dated copy in the selected R2 bucket.
