Removing Tags from Duplicate Orders/Drafts?

Topic summary

A merchant is experiencing issues with their order import system that tags orders as “Imported” to prevent duplicate processing. When staff duplicate orders for replacements (e.g., lost/damaged items), the “Imported” tag carries over, causing the import system to skip these replacement orders.

Attempted Solution:
The merchant tried using Shopify Flow to automatically remove the “Imported” tag when new orders are created. While the Flow successfully adds test tags (confirming it runs), it fails to remove the “Imported” tag.

Root Cause Identified:
A race condition exists between multiple systems (Flow, Admin, and the backend import app) running simultaneously when orders are created. The timing of when tags are added or removed is unpredictable—either the tag doesn’t exist when Flow runs, or it’s re-added afterward by the import system.

Current Resolution:
The merchant has opted for a short-term solution involving staff training to manually remove order tags when duplicating orders, rather than relying on automation. A better long-term approach might involve triggering the backend sync directly from Flow to avoid timing conflicts.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hi, our backend accounts/dispatch system imports orders from Shopify for processing and tags the order “Imported” once done, as a safeguard against double-importing orders. This works great normally but occasionally a staff member will need to re-send an order if it is lost/damaged etc.

To do this, they duplicate the original order and 100% discount, but this also brings over the tag from the original order, meaning our order import skips it and never processes the replacement - and this can easily be forgotten.

As this creates a duplicate order, it would seem that the best step is to use Flow to remove the tag “Imported” from any newly created order

Start When…

Order Created

Do this…

Remove order tags
Remove the following order tags: Imported
(and as a test, Add the following order tags: Test)

However, once the order is created (marked as paid), the flow runs, it ADDS the “test” tag (confirming the flow has been triggered and run) but doesn’t remove the “imported” tag

Anyone know what I’m missing here? I’ve also tried a flow on draft orders to remove the tag as soon as the duplicate is created as a draft order but with the same effect.

You have two different systems that are running when an order is created. Either the Admin and Flow or the app and Flow. So depending on which one runs first, you’ll get different behavior. This is called a race condition.

I suspect if you see “Imported” after Flow ran, that either the order did not have that tag when Flow ran, or that tag was added back after Flow ran (and it is likely in the downstream system).

There isn’t enough detail here to really know how to design this better. Ideally, you could initiate the sync with the backend system directly from Flow

1 Like

Thanks Paul, that makes sense of something that was confusing me at least.

I think our short-term answer is staff training to ensure they manually remove any order tags (or trigger a flow) when creating a duplicate order in the backend.