Stop an automation with a tag guide — Mailkoo Skip to content
Log in Live demo Get started
Create & send

Stop an automation with a tag

Take a contact out of an automation the moment they get a tag, such as JOINED, even while they are in a Wait step. You can also branch on a tag, remove a contact by hand, or remove them through the API.

Find it in: Automation → open an automation → click the Trigger card 12 steps

A follow-up automation should stop as soon as the contact does what you wanted: they signed up, bought, or booked a call. With an exit rule, you name one or more tags. When a contact gets one of those tags, they leave the automation straight away and get no more emails from it.

This works however the tag is added: from your website through the API, from a form, by hand, or by another automation. It also works while the contact is waiting. If they are two days into a Wait 6 days step, they do not wait the other four days. They leave at once.

This guide also shows three related tools: a Condition that checks a tag, the Remove from automation action for one contact, and the API request that does the same from your own software.

What you can do with Stop an automation with a tag

Exit on a tag

Name the tags that end the automation for a contact, for example JOINED.

Works during a Wait

A contact who is waiting leaves at once. The next email is never sent.

Branch on a tag

Use a Condition to send tagged and untagged contacts down different paths.

See who left

Statistics shows an Exited count, and each contact's history says why they left.

Remove one contact

Take a single contact out of the automation from the contacts table.

Remove through the API

Your website or app can remove a contact with one request.

Set an exit rule

The exit rule belongs to the automation's trigger, so it covers every step of the flow.

  1. Open the trigger

    Open the automation in the flow editor and click the Trigger card at the top of the flow.

  2. Add the exit tags

    In the side panel, find Exit rule (1). Type a tag, for example JOINED, and press Enter. Add more tags the same way. A contact leaves when they get any of them.

    Click Save (2).

  3. Check the trigger card

    The trigger card now shows Exits on: with your tags, so you can see the rule without opening the panel.

From now on:

  • A contact who gets an exit tag while in the automation leaves it at once, even in the middle of a Wait step.
  • A contact who already has an exit tag does not enter the automation.
  • Emails the contact already received stay received. Only the emails still to come are stopped.

To turn the rule off, remove the tags from Exit rule and save.

Send the tag from your website

If your website already adds a tag through the API when someone signs up or submits a form, you don't need to change anything. The exit rule reacts to that tag.

  1. Add the tag with the API

    This is the usual request for adding a tag to a contact. Replace SUBSCRIBER_ID with the contact's id and YOUR_API_TOKEN with your token:

    curl -X POST 'https://<your app address>/api/v1/subscribers/SUBSCRIBER_ID/add-tag' \
      -H 'Accept: application/json' \
      -d api_token=YOUR_API_TOKEN \
      -d tag=JOINED
    

    As soon as this request succeeds, the contact leaves every automation whose exit rule names JOINED.

Branch on a tag with a Condition

Sometimes you don't want to stop the automation, only to send different emails to tagged contacts. A Condition step can check a tag.

  1. Check a tag in a Condition

    Add a Condition step, or open one. Under The contact… choose Has a tag or Doesn't have a tag, and type the tag in Tag (1).

    Contacts who match go down the yes path; everyone else goes down no.

    If the condition only checks tags, empty the number under Wait this long before deciding (2). The contact is then checked the moment they reach the step. With a wait set, the check happens at the end of it.

See who left the automation

  1. Look at the Exited count

    Open the automation and click Statistics. The breakdown at the top has a Triggered: exited row: the contacts who left before the end.

  2. List the contacts who left

    In the contacts table, choose Exited in the status filter (1). Each of these contacts has the Exited status (2).

  3. See why a contact left

    Click Progress on a row. The history shows when the contact left and why:

    • Exited · got the tag JOINED — the exit rule removed them.
    • Exited · removed by hand — someone used Remove from automation.
    • Exited · removed via the API — your software removed them.

Remove one contact by hand

You can take a single contact out of an automation without a tag.

  1. Open the row menu

    In Statistics, find the contact in the contacts table (the Waiting filter helps). Click ⋯ at the end of the row and choose Remove from automation. The action is there only while the contact is still in the flow.

  2. Confirm

    Click Remove from automation to confirm. The contact's status changes to Exited and they get no more emails from this automation.

Hold run is different: it pauses the contact and keeps their place, so you can resume later. Remove from automation ends the run for good.

Remove a contact with the API

For developers. Use this when your software should stop an automation for a contact without adding a tag.

  1. Find the automation's uid

    Each automation has a uid. List your automations to find it:

    curl -X GET 'https://<your app address>/api/v1/automations' \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer YOUR_API_TOKEN'
    

    The answer lists every automation with its uid and name.

  2. Send the exit request

    Send the contact's email address to the automation's exit address:

    curl -X POST 'https://<your app address>/api/v1/automations/AUTOMATION_UID/exit' \
      -H 'Accept: application/json' \
      -H 'Authorization: Bearer YOUR_API_TOKEN' \
      -d email=jane@example.com
    

    Instead of email, you can send subscriber_uid or subscriber_id.

    The answer tells you what happened:

    {"success": true, "exited": 1, "message": "Subscriber removed from the automation"}
    
    Answer Meaning
    exited: 1 or more The contact was removed.
    exited: 0 The contact had no active run: they never entered, already finished, or were already removed.
    Status 404 The automation uid is wrong, or no contact with that address is in the automation's lists.
    Status 422 The request had no email, subscriber_uid or subscriber_id.

Common questions

The contact is in a Wait step. Do they still leave at once?

Yes. They leave the moment the tag is added, and the rest of the wait is cancelled. The next email is never sent.

What if the tag is added by a CSV import?

An import can add tags without starting the exit straight away. The automation checks the exit rule again before every step, so the contact is removed at their next step, before anything else is sent.

Does leaving an automation unsubscribe the contact?

No. The contact stays subscribed to your list and still receives your campaigns and other automations. Only this automation stops.

Can a contact who left come back?

Not on their own: a contact enters each automation once. If you want them to start over, remove the exit tag from the contact, then choose Delete trigger for them in the contacts table.

Does the exit rule work while the automation is paused?

Yes. Contacts who get an exit tag while the automation is paused are removed, so they don't continue when you activate it again.