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

# Flow recipes

> Worked examples that combine Circuly triggers with Shopify-native actions.

Each recipe below pairs one Circuly trigger with native Shopify Flow actions. Copy the structure into your own workflow and adapt as needed.

## Recipe 1 — Tag customers when payment fails

**Use case:** Build a "payment-failed" customer segment for a Klaviyo win-back flow or for a support follow-up list.

<Steps>
  <Step title="Trigger">
    Pick **Circuly: Invoice dunning** as the trigger.
  </Step>

  <Step title="Action">
    Add the **Add customer tags** action. Use the customer reference from the trigger. Tag with `payment-failed`.
  </Step>

  <Step title="Optional: notify support">
    Add a **Send internal email** action to email your support team with `{{customer.email}}` and `{{trigger.invoiceNumber}}`.
  </Step>
</Steps>

## Recipe 2 — Win-back when a contract is cancelled

**Use case:** Trigger a churn-recovery email series the moment someone cancels.

<Steps>
  <Step title="Trigger">
    **Circuly: Subscription cancelled**.
  </Step>

  <Step title="Condition">
    Add a condition: `{{trigger.cancelledBy}} == 'customer'` (skip merchant-initiated cancellations).
  </Step>

  <Step title="Action">
    Use **Add customer tags** with tag `churned-subscription`, and connect Klaviyo or your ESP to enroll them in a win-back series triggered by that tag.
  </Step>
</Steps>

## Recipe 3 — Notify warehouse when an asset is returned

**Use case:** Tell your fulfillment team to inspect and restock a returned rental unit.

<Steps>
  <Step title="Trigger">
    **Circuly: Asset returned**.
  </Step>

  <Step title="Action">
    **Send internal email** to `warehouse@yourcompany.com` with `{{trigger.assetId}}`, `{{customer.firstName}} {{customer.lastName}}`, and `{{trigger.condition}}`.
  </Step>

  <Step title="Optional: Slack">
    If you use the Slack connector for Flow, post the same payload to your `#warehouse` channel.
  </Step>
</Steps>

## Recipe 4 — Segment new subscribers by contract type

**Use case:** Apply different onboarding emails for Rental vs. Subscription customers.

<Steps>
  <Step title="Trigger">
    **Circuly: Subscription created**.
  </Step>

  <Step title="Branch on contract type">
    Add a condition on `{{trigger.contractType}}`. One branch handles `Rental`, the other handles `Subscription`/`Consumable`/`Digital`.
  </Step>

  <Step title="Action">
    On each branch, **Add customer tags** with `new-rental` or `new-subscription`. ESPs (Klaviyo, Mailchimp) can listen for those tags and trigger the right onboarding journey.
  </Step>
</Steps>
