Shopify Flow/Customer & Loyalty/Auto-Delete Stray Customer Profiles Not Linked to a Company
Customer RetentionMedium Difficulty

Auto-Delete Stray Customer Profiles Not Linked to a Company

This automation automatically removes individual customer profiles that weren't assigned to a company within three days, keeping your B2B customer list clean and focused.

The Problem

Managing a B2B storefront means your customer list should primarily comprise company-linked buyers. Stray individual accounts, often from test sign-ups or accidental D2C registrations, clutter your CRM, inflate marketing lists, and skew valuable B2B analytics. Manually sifting through and deleting these unassigned profiles is a repetitive drain on your team's time.

What This Automation Solves

This Shopify Flow streamlines B2B customer management by automatically handling new profiles. When a new `Customer created` event triggers the workflow, it `Waits` for three days. If, after this period, the customer `has not been assigned to a company` (e.g., `customer.company` is empty), the Flow will `Delete customer` to maintain a clean, B2B-centric database.

When to Use This Automation

  • Your store primarily serves B2B clients and requires all customers to be linked to a company.
  • You frequently encounter 'ghost' customer accounts from test sign-ups or incomplete B2B registrations.
  • You need to prevent accidental D2C sign-ups from cluttering your B2B customer segments and marketing efforts.

Workflow

  1. Trigger

    Step 1

    This workflow starts when a new customer is created

  2. Wait

    Step 2

    Wait for 3 days

  3. Condition

    Step 3

    Customer id is not empty and exists.

  4. Action

    Step 4

    Delete the customer

Step-by-Step Setup

  1. 1

    Start with the 'Customer created' trigger.

  2. 2

    Add a 'Wait' action, setting the duration to '3 days'.

  3. 3

    Insert a 'Condition' block. Configure it to check if `customer.company` is empty, or if a specific 'company-assigned' tag is missing from `customer.tags`.

  4. 4

    Add a 'Delete customer' action.

Related Questions

How does this Flow distinguish between a legitimate B2B customer and a stray profile?
The Flow waits three days for a new customer to be assigned to a company (via the `customer.company` object or a specific tag). Only if this assignment hasn't happened is the profile considered 'stray' and targeted for deletion.
What if a legitimate B2B customer profile is accidentally deleted?
If a valid customer is deleted, they'll need to re-register. To prevent this, ensure your B2B onboarding process guarantees immediate company association within the 3-day window, or consider a longer wait period.
Can I be notified before a customer is deleted?
While this Flow directly deletes, you can modify it to include an 'Send internal email' action *before* the deletion. This would send a notification to your team, allowing for manual review if needed.
My store has both B2B and D2C customers. How can I use this?
This specific Flow is best for B2B-only or strict hybrid models. For dual-purpose stores, you'd need a more complex condition, perhaps checking for a 'D2C' tag on customers *you want to keep*, and only deleting if *neither* 'company' nor 'D2C' tag is present.

Recommended Tools & Apps

Launch this automation

Open Shopify Flow and use this page as your setup blueprint.

Open Shopify Flow

Merchant Insight

To enhance this Flow, consider adding a 'Tag customer' action before deletion, e.g., 'deleted-by-flow'. This creates an audit trail if you need to review who was removed and why, without cluttering active profiles.

Related Automations