> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiveku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow Recipe: Auto-Request Reviews After Purchase

> Send a review request email a few days after each customer purchase

Happy customers usually don't leave reviews unless you ask. This recipe automatically sends a friendly ask a few days after delivery — enough time to actually use the product, not so long that they've forgotten.

<Info>
  Before you start: your `orders` table needs a status column plus a delivery or fulfillment timestamp, and you need a [configured email service](/how-tos/send-emails).
</Info>

## The Flow at a Glance

<CardGroup cols={3}>
  <Card title="Delivery" icon="truck">
    Order marked 'delivered'
  </Card>

  <Card title="3 days" icon="clock">
    Let them actually use it
  </Card>

  <Card title="Ask" icon="star">
    One clear review request
  </Card>
</CardGroup>

## Step 1: Create the Workflow

<Steps>
  <Step title="Open Workflows">
    Go to **Workflows > New Workflow**. Name it `Review Request`.
  </Step>

  <Step title="Add a Database trigger">
    Click **Add Trigger > Database**. Listen for **row updated** on the `orders` table, filtered to runs where `status` changed to `delivered` (or `completed`).

    <Tip>
      Triggering on update-to-delivered is better than a schedule — it fires once per order, naturally, and handles backorders and delayed shipments correctly.
    </Tip>
  </Step>
</Steps>

## Step 2: Wait for the Product to Land

<Steps>
  <Step title="Add a Delay action">
    Click **+ Add Action > Delay**. Set to **3 days**.

    Why three days: long enough that they've unboxed and tried it, short enough that it's still top-of-mind.
  </Step>

  <Step title="Re-check the order status">
    Add a **Condition** step:

    ```
    {{trigger.status}} == 'delivered' OR {{trigger.status}} == 'completed'
    ```

    If the order was returned or canceled in those 3 days, skip the rest.
  </Step>
</Steps>

## Step 3: Send the Review Request

<Steps>
  <Step title="Add a Send Email action">
    * **To:** `{{trigger.customer_email}}`
    * **Subject:** `How's your {{trigger.product_name}}?`
    * **Body:** Friendly and short. One clear ask.
  </Step>

  <Step title="Write the body">
    ```
    Hey {{trigger.customer_name}},

    Hope you're enjoying your {{trigger.product_name}}. If you have 30 seconds, 
    we'd love to hear what you think:

    [ Leave a review ] → https://yoursite.com/reviews/new?order={{trigger.id}}

    Honest feedback is how we get better. Thanks!

    — The Acme team
    ```
  </Step>

  <Step title="Mark the request as sent">
    Add a **Database Update**:

    ```sql theme={null}
    UPDATE orders SET review_request_sent_at = now() WHERE id = '{{trigger.id}}'
    ```

    Prevents duplicates if the trigger fires twice.
  </Step>
</Steps>

## Step 4: Optional 7-Day Nudge

If they didn't leave a review, a single gentle follow-up often doubles response rates.

Add a second Delay (7 days), then a Condition to check no review was submitted yet:

```sql theme={null}
SELECT COUNT(*) FROM reviews WHERE order_id = '{{trigger.id}}'
```

If count is 0, send a short nudge: "Still enjoying it?" with a single-click star rating. Don't send a third email — at that point they've decided.

## Integrating with Your Reviews Page

The review link can go to several places:

* **Your own reviews page** — `/reviews/new?order={{trigger.id}}` prefills the product
* **Google Business Profile** — direct link to your public review form
* **Trustpilot / Yotpo** — pass the order ID as a URL parameter
* **Embedded form in email** — simplest for customers, but limited formatting

Start with your own page (so you control what happens with a bad review), then syndicate the good ones to Google.

## Incentivizing Responses — Carefully

Small thank-yous help response rates:

* 10% off the next purchase
* Early access to new products
* Entry into a monthly drawing

<Warning>
  Never offer an incentive contingent on a *positive* review. That violates Google, Yelp, Amazon, and Trustpilot guidelines and can get your listings removed. Always frame the ask as "honest feedback welcome."
</Warning>

## Deduping Across Customers

If a customer buys frequently, you don't want weekly review requests. Dedupe by customer, not order:

```sql theme={null}
-- Before sending, check the customer's last request
SELECT MAX(review_request_sent_at) AS last_sent
FROM orders
WHERE customer_id = '{{trigger.customer_id}}'
```

If `last_sent` is within 30 days, skip.

## Verify It Worked

1. Mark a test order as delivered in the database
2. Temporarily shorten the delay from 3 days to 5 minutes for testing
3. Check that the email arrives at the test customer address
4. Click the review link — it should open your review form with the order prefilled
5. Confirm `review_request_sent_at` is populated

Restore the 3-day delay before enabling for production.

## Troubleshooting

<AccordionGroup>
  <Accordion title="No email is being sent">
    Check the trigger — is the `orders` table actually updating to `delivered`, or is your fulfillment flow using a different status? Open **Workflows > Runs** and look for trigger events. If none are firing, the status transition isn't happening, or you've filtered too tightly.
  </Accordion>

  <Accordion title="One customer received multiple requests">
    `review_request_sent_at` isn't being set, or you're not filtering on it. Add a condition at the top of the workflow:

    ```
    {{trigger.review_request_sent_at}} IS NULL
    ```
  </Accordion>

  <Accordion title="Customer complained about too many emails">
    You're deduping by order, not by customer. A frequent buyer gets one email per order — which adds up. Switch to per-customer deduping with a 30-day minimum gap.
  </Accordion>

  <Accordion title="Review link shows a blank form">
    The `order` URL parameter isn't being read. Check that `/reviews/new` pulls the order ID from the query string and uses it to prefill the product. Test manually by opening the link in a browser.
  </Accordion>

  <Accordion title="Emails arriving too late (weeks after delivery)">
    The workflow is queued up behind other runs. Go to **Workflows > Runs** and check for backed-up executions. If your workflow runner is overloaded, split high-volume workflows to separate runners or move scheduling to a dedicated queue.
  </Accordion>
</AccordionGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="Customer Testimonials" icon="quote-left" href="/how-tos/add-testimonials">
    Display your new reviews on the site as social proof
  </Card>

  <Card title="Workflows Basics" icon="diagram-project" href="/how-tos/workflows">
    How triggers, actions, and runs fit together
  </Card>
</CardGroup>
