Flow to flag multiple failed payment attempts on single order

Topic summary

A merchant seeks to flag orders with multiple failed payment attempts using Shopify Flow, specifically wanting alerts only after three or more declines (not just one or two innocent mistakes like wrong CVV).

Initial Challenge:

  • Existing flows trigger on single failed payments using either “order created” or “order transaction created” triggers
  • Need to count multiple attempts on the same order before taking action

Working Solution:

  1. Trigger: “When order created”
  2. Condition: Check if at least one transaction has status “FAILURE” OR “ERROR”
  3. Action: COUNT all transactions on the order (order.transactions)
  4. Condition: Check if count is greater than or equal to desired threshold (e.g., 5 transactions = 4 declines + 1 success)
  5. Action: Add order tag, send email, cancel order, etc.

Key Considerations:

  • The count includes successful transactions, so adjust threshold accordingly
  • Use “greater than or equal to” (not “equal to”) to catch orders with many attempts
  • Manual review helps distinguish legitimate errors (same card, multiple tries) from fraud (multiple different cards)
  • Particularly useful for detecting stolen card testing attempts (sometimes 12+ cards)
Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

I’m not too familiar with how the transaction events come through. Are you seeing the workflow trigger 3 times using Order transaction created?

If so, you could store them in a metafield or tag each time they happen. And then check the metafield before sending that internal email.

You might also be able to use something like:

  • Every day
  • Get orders (using the financial_status field for the query)
  • For each order:
    • Check if it has 3 tries
    • If true
      • Send email
1 Like