# Contact returns to campaign after was removed by campaign action

**URL:** <https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436>\
**Category:** Product Support\
**Created:** [August 11, 2021, 9:03am UTC](https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436 "2021-08-11T09:03:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pegasus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pegasus/32/511_2.png) [@Pegasus](https://forum.mautic.org/u/Pegasus)\
**Post date:** [August 11, 2021, 9:03am UTC](https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436/1 "2021-08-11T09:03:12Z")

</div>

**Your software**

My Mautic version is: 3.3.3  
My PHP version is: 7.4.9  
My Database type and version is: MySQL, mysqlnd 7.4.9

**Your problem**

When Contact removed from Campaign by Campaign action, after ‘Rebuild campaigns’ cron job triggered contact returned to campaign.

Assume we have one of the action in the campaign, which remove contact from the this campaign:

 ![Campaign-action](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d795ffea2c106e2746170da991e4bb23f1aef7b1.png)

After action is triggered, contact removed from campaign successfully. From contact events log:

 ![contact-removed](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/376c2db61999ac5fbbd2c9174b5240a270996522.png)

But, after sometime, contact returned back to the campaign. No one make this manually:

 ![contact-added-back](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/eb9f7e5a6aa4c731bd6f076bf3ddcad74c6dcf4b.png)

This event time suspiciously matches with time when ‘mautic:campaigns:rebuild’ cron job starts.

Code investigation shows that all leads which has ‘manualy\_removed = 0’ flag value will be added back to campaign. At the same time, “Remove action” just set Manually removed flag to true, so all looks fine, maybe bug somewhere deeper.

Please, confirm bug or provide us with right solution of this problem.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 11, 2021, 12:35pm UTC](https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436/2 "2021-08-11T12:35:13Z")

</div>

Hi,  
I have a theory, plz check it:

1. The source of your campaign is a Segment
2. Contacts are added because they are a member of a segment
3. You set the campaign so, that contacs can re-enter the campaign
4. Once you move them out by a campaign action, they are still member of the segment, so requalify and return into the campaign.

Either change segment membership or prohibit reendering the campaign.

---

<div class="post-metadata">

**Author:** ![Pegasus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pegasus/32/511_2.png) [@Pegasus](https://forum.mautic.org/u/Pegasus)\
**Post date:** [August 12, 2021, 12:02pm UTC](https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436/3 "2021-08-12T12:02:25Z")

</div>

Hi Joeyk,

Your theory proved to be correct, we had enabled the ‘re-entering the campaign’ option for testing purposes and that was causing the misbehaviour.

Thank you for your answer, it has been incredibly useful.

---

<div class="post-metadata">

**Author:** ![jeel.krivy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jeel.krivy/32/1751_2.png) [@jeel.krivy](https://forum.mautic.org/u/jeel.krivy)\
**Post date:** [August 13, 2021, 9:21am UTC](https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436/4 "2021-08-13T09:21:22Z")

</div>

Hey,

I am facing the issue that I created the campaign to send automation emails to the segment. But the campaign showing zero contacts.

Please help me.

1. [Screenshot by Lightshot](https://prnt.sc/1nwrtbi) (Campaign Flows)
2. [Screenshot by Lightshot](https://prnt.sc/1nwsgiz) (segment)

---

<div class="post-metadata">

**Author:** ![Pegasus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pegasus/32/511_2.png) [@Pegasus](https://forum.mautic.org/u/Pegasus)\
**Post date:** [August 19, 2021, 7:58am UTC](https://forum.mautic.org/t/contact-returns-to-campaign-after-was-removed-by-campaign-action/20436/5 "2021-08-19T07:58:42Z")

</div>

Hi,

My suggestion is to check cron jobs ([Cron jobs | Mautic](https://docs.mautic.org/en/setup/cron-jobs)):  
 → mautic:campaigns:rebuild (alias mautic:campaigns:update) is responsible for the association of contacts to campaigns.
