# Radius Delivery — Shopify Flow templates

Radius Delivery includes four Shopify Flow templates. They use Shopify's native triggers, conditions, and actions, so merchants don't need extra API scopes or a separate Flow connector.

## Five-minute setup

Installing Radius Delivery does not create workflow drafts in your store. A template is a starting point; a workflow is your store's configured copy. Workflows in our demonstration store were added separately.

Use a Radius template from the Shopify Flow library if available, or unpack the Radius Delivery Flow download and import each `.flow` file through Shopify Flow → Import. Import the `.flow` files, not the ZIP. Do not import a second copy if the workflow already exists. Library availability depends on Shopify's template approval; deployment alone does not confirm publication.

1. Install Shopify Flow.
2. Add or import template 1 and enter the exact local delivery and pickup titles used at checkout.
3. Add templates 2–4 and replace `delivery-team@example.com` with an internal staff address.
4. In template 3, replace `YOUR DELIVERY LOCATION` with the exact Shopify Location name that dispatches local orders.
5. Run Flow's test, place one controlled test order, and then activate the workflow.

Do not activate a template while an example value remains. Shopify Flow can't dynamically fill the recipient of a Send internal email action, so the staff email must be entered once by the merchant.

## Recommended activation order

1. Tag orders when local delivery or pickup is selected.
2. Notify the delivery team when a local order is paid.
3. Review fulfillment when a local order uses an unexpected location.
4. Escalate issues when a local delivery fulfillment is held.

The first workflow creates the classification tags used by the other three.

## Template 1: Tag orders when local delivery or pickup is selected

**What it does:** When an order is created, it checks the selected shipping method. Local delivery orders receive `RADIUS_LOCAL_DELIVERY`; pickup orders receive `RADIUS_LOCAL_PICKUP`. It also saves `custom.radius_delivery_type` and the initial delivery status.

**Merchant changes:**

- Replace `Local delivery` with the exact local delivery title shown at checkout.
- Replace `Local pickup` with the exact pickup title shown at checkout.

**Ready-made actions:**

- Adds the correct classification tag.
- Saves `custom.radius_delivery_type` as `local_delivery` or `local_pickup`.
- Saves `custom.radius_delivery_status` as `new` for local delivery.

**Quick test:** Create one local delivery order, one pickup order, and one standard shipping order. Only the first two should receive Radius Delivery tags.

## Template 2: Notify the delivery team when a local order is paid

**What it does:** When a tagged local delivery order is paid, it adds `RADIUS_PAID`, changes `custom.radius_delivery_status` to `paid`, and sends a route-planning email with the order, customer, city, and postal code.

**Merchant changes:** Replace `delivery-team@example.com` with the internal delivery-team address.

**Prerequisite:** Template 1 must be active so the order has the `RADIUS_LOCAL_DELIVERY` tag.

**Quick test:** Create a local delivery order with a test payment. Confirm that nothing happens before payment, then mark it paid and check the tag, metafield, email, and Flow run history.

## Template 3: Review fulfillment when a local order uses an unexpected location

**What it does:** When a local delivery fulfillment is ready, it checks the assigned Shopify Location. A correct assignment receives `RADIUS_READY_TO_DISPATCH`. An unexpected assignment receives `RADIUS_LOCATION_REVIEW`, is placed on hold, and triggers an alert.

**Merchant changes:**

- Replace `YOUR DELIVERY LOCATION` with the exact Shopify Location name used for local dispatch.
- Replace `delivery-team@example.com` in both email actions.
- If several locations can dispatch local orders, add them to the location condition with `OR`.

**Important:** The unexpected-location branch intentionally places the fulfillment order on hold. Test this workflow before activation.

**Quick test:** Run one order from an allowed location and one from another location. Confirm that the first is marked ready and the second is held and flagged for review.

## Template 4: Escalate issues when a local delivery fulfillment is held

**What it does:** When a local delivery or pickup fulfillment is placed on hold, it adds `RADIUS_ACTION_REQUIRED`, changes `custom.radius_delivery_status` to `on_hold`, and emails the hold reason and assigned location to operations.

**Merchant changes:** Replace `delivery-team@example.com` with the internal operations address.

**Prerequisite:** Template 1 must be active so the order has a Radius Delivery classification tag.

**Quick test:** Place a test local fulfillment on hold. Confirm the tag, metafield, email, and Flow run history. Repeat with a standard shipping order and confirm that no Radius Delivery actions run.

## Tags and metafields created by the templates

| Type | Value | Purpose |
| --- | --- | --- |
| Tag | `RADIUS_LOCAL_DELIVERY` | Classifies local delivery orders |
| Tag | `RADIUS_LOCAL_PICKUP` | Classifies pickup orders |
| Tag | `RADIUS_PAID` | Marks paid local delivery orders |
| Tag | `RADIUS_READY_TO_DISPATCH` | Marks a correct fulfillment assignment |
| Tag | `RADIUS_LOCATION_REVIEW` | Flags an unexpected fulfillment location |
| Tag | `RADIUS_ACTION_REQUIRED` | Flags a held local order |
| Metafield | `custom.radius_delivery_type` | Stores `local_delivery` or `local_pickup` |
| Metafield | `custom.radius_delivery_status` | Stores `new`, `paid`, or `on_hold` |

## Current limitation

These workflows classify the shipping method selected at checkout. They don't receive the matched Radius Delivery zone or raw geometry result. A future Radius Delivery Flow action could expose coverage and zone information directly.
