# Tag customer after N orders

Automatically adds a tag to a customer when they reach a specified number of orders.

Canonical URL: https://templates.jsworkflows.com/templates/tag-customer-after-n-orders/

## When to use this template

This template is built for Shopify stores using the JsWorkflows app.

Use this template when you want a ready-made workflow for this use case: Automatically adds a tag to a customer when they reach a specified number of orders.

It is designed for Shopify customer operations and gives you a production-ready starting point instead of building the automation from scratch.

This workflow uses the Shopify webhook trigger model and starts from the "Order created" trigger. It includes setup fields for merchant-facing values, so you can configure the workflow before installing it.

## Metadata

- Category: Customers
- Trigger: Order created
- Workflow type: Shopify webhook
- Complexity: easy
- Usage class: starter-friendly

## Connected services

- None

## Additional Shopify scopes

- None

## Setup fields

- Order count threshold (`ORDER_COUNT_THRESHOLD`)
  - Type: number
  - Storage: config
  - Required: yes
  - Description: Minimum number of Shopify orders required before the customer tag is added.
- Customer tag (`CUSTOMER_TAG`)
  - Type: text
  - Storage: config
  - Required: yes
  - Description: Exact Shopify customer tag to add when the threshold is reached.

## Setup guide

## Before you start

This template listens for new orders and adds a customer tag once the customer's Shopify order count reaches your configured threshold.

## How it works

- Trigger: `orders/create`
- The workflow skips guest checkouts with no attached customer
- It waits briefly, loads the customer's current Shopify order count, and applies the tag once the threshold is reached
- If the customer already has the tag, nothing else happens

## Configure in setup

- `Order count threshold`: minimum Shopify order count required before the tag is added
- `Customer tag`: the exact tag to add, such as `vip`, `repeat-buyer`, or `wholesale-lead`

## Notes

- Shopify order count comes from the customer record, so historical orders are included
- The workflow is safe to re-run because it checks whether the tag already exists before trying to add it

