How can I auto-tag orders based on specific conditions?

Hi there!

I’m attempting to automatically add a tag to an order based on the following condition:

  1. If the U.S. state of the shipping address is NOT California, OR
  2. If ANY of the order’s line items belong to a specific collection (“Collection X”)

I’m struggling to properly write that condition. See attached for my latest attempt.

Any advice/suggestions would be much appreciated!

1 Like

Why did you choose “none of” for “Order / LineItems”? I think you want “At least one of”

You’re running into one of the common limitations with Shopify Flow - combining order-level conditions (shipping address) with line-item / collection logic using OR conditions can get messy very quickly.

Conceptually, what you want is:

  • Condition A: Shipping province ≠ CA
    OR

  • Condition B: Any line item belongs to Collection X

Flow can technically do parts of this, but once you mix nested “any line item” checks with OR logic, it becomes hard to maintain and easy to break.

A lot of merchants solve this by using a rule-based tagging approach instead of Flow, where you define the conditions once and the tag stays in sync automatically for new orders and existing ones.

If helpful, I’m happy to share how we handle this pattern in production.