Create a workflow to delete contacts in a segment

Deleting a segment in Flexmail removes the filter, not the contacts in it. To permanently remove the actual contacts who belong to a specific segment, you need a workflow. This article shows you how to set one up safely, including how to exclude contacts who belong to other segments that should be preserved.

Attention  Deleting contacts from your database is permanent and cannot be undone. Test this workflow thoroughly before activating, and consider exporting the affected contacts first as a backup.


Example scenario

You have a segment called "Old collection". You want to delete all contacts in that segment, but only if they are not also in the segments "Clothing" or "Shoes", because those contacts are still active customers.


Prerequisites

  • The segment of contacts you want to delete exists in Contacts > Segments.
  • You have identified any exclusion segments, contacts who should be kept even if they appear in the deletion segment.
  • You have exported the affected contacts as a backup if needed.

Set up the workflow

  1. Go to Automation, then Workflows, and click Add new workflow.
  2. Name your workflow clearly, for example, "Delete contacts, Old collection", and select Custom workflow.

Start block

  1. Click the start block to open its settings.
  2. Set the trigger to "Contacts added to segment" and select your segment, in this example, "Old collection".
  3. Tick "Include all contacts that are already in this segment" so existing contacts are processed immediately, not just future additions.
  4. Click Save.


If/else block, check for exclusions

  1. Click + to add a block and select If/else.
  2. Set the condition to: Contact is in segment "Clothing" OR Contact is in segment "Shoes".
  3. On the Yes path (contact is in either Clothing or Shoes): add an End block. These contacts should not be deleted.
  4. Leave the No path open for the next step.


Contact action block, delete

  1. On the No path of the if/else block, click + to add an action
  2. Choose the contact action "Remove contact from list".
  3. Select the list 'All my contacts'
  4. Click Save.


Activate and monitor

Review the entire workflow before activating, check that the exclusion conditions are correct and the Yes/No paths are routed as intended. Once active, the workflow will immediately begin processing all existing contacts in your deletion segment.

Monitor the workflow results in the first hour to confirm it is routing and deleting as expected. Check the count of contacts processed on each path.


Pro tips

  • Always add exclusion conditions for any segment that contains contacts you want to keep. It takes an extra minute and prevents irreversible data loss.
  • If you're unsure which contacts will be affected, create the segment and review its contact list before building the workflow.
  • Export the contacts before activating. Go to the segment, open the Actions menu and click Export  all contacts. This gives you a recovery option if something goes wrong.

Common mistakes to avoid

  • Activating without first reviewing the exclusion logic. If the if/else condition is wrong, the wrong contacts get deleted permanently.
  • Forgetting to tick "Include all contacts that are already in this segment". Without it, the workflow only processes future additions to the segment, not the existing ones.
  • Using this pattern for bulk deletions without an exclusion check. Always add at least one if/else block to verify contacts before the delete action fires.

Next steps

Did this answer your question? Thanks for your feedback There was a problem submitting your feedback. Please try again later.

Didn't find what you were looking for? Contact Us Contact Us