---
title: Set exit conditions on an automation
description: Close an enrollment early when the employee stops matching an audience you choose, so nothing further sends after they leave the team, country or lifecycle stage the flow is for.
sidebar:
  order: 2
area: flows
feature: automations
appPath: /flows/home
lastVerified: 2026-11-15
version: "2026-10-27"
audience: admin
screenshots:
  - id: flows-automations-exit-conditions
    caption: Exit conditions lists the audiences an enrolled employee must keep matching.
related:
  - flows/automations/set-the-audience
  - flows/automations/automation-and-enrollment-states
  - flows/automations/publish-an-automation
  - directory/employee-groups/how-audiences-match
---

The audience decides who is enrolled; an exit condition decides who stays enrolled. Each one is an audience the employee must keep matching for the rest of the sequence. The moment they fall outside any of them, Pyn completes the enrollment and cancels every step still to send. Use it to stop an onboarding sequence for someone who leaves before the end, or a regional flow for someone who moves country.

## Before you start

- You are a workspace admin.
- The automation has a trigger. On a **No trigger** automation the **Exit conditions** tab is switched off, like **Audience**.
- Groups come from **Directory** > **Employee Groups**; an exit condition uses the same lifecycle stages and groups as the audience. See [Set the audience for an automation](https://support.pyn.ai/flows/automations/set-the-audience/).

![Exit conditions lists the audiences an enrolled employee must keep matching.](https://support.pyn.ai/media/flows/automations/flows-automations-exit-conditions.png)

## Steps

1. In Pyn, open **Flows** in the left navigation, then **Automations**, and select the automation.

2. Select the trigger card at the top of the canvas, then the **Exit conditions** tab in the drawer. It opens with "Exit conditions close out an enrollment early, before all steps have sent. If the employee no longer matches any of these audiences, the enrollment completes and no further messages send."

3. Select **Add exit condition**. A new condition starts with **Current** ticked under **Lifecycle** and no groups.

4. Under **Exit when the employee no longer matches:**, set the audience the employee must keep matching. Under **Lifecycle**, tick the stages they must stay in. Under **Included**, pick the groups they must stay in ("The flow will exit for employees NOT in the included groups."). Under **Excluded**, pick the groups they must stay out of ("The flow will exit for employees in the excluded groups.").

5. Check **Audience Preview** below the fields: it lists who matches the condition today, so everyone listed would stay enrolled.

6. Add another condition for each separate rule, or select **Remove** beside one you no longer want.

7. Select **Publish**.

> **Note:** Exit conditions are part of the published version, so they apply to enrollments created from then on. To apply them to enrollments already running, move those enrollments to the new version when the **Update Enrollments** dialog opens after publishing, or later from **Update Active Enrollments**. See [Publish an automation](https://support.pyn.ai/flows/automations/publish-an-automation/).

## How Pyn evaluates them

Pyn checks the conditions again before each message or reminder sends, so nothing sends to someone who no longer matches. A condition with no lifecycle stage ticked is ignored rather than exiting everyone. The groups are matched the way an audience is: included groups under the same demographic match any one of them, different demographics must each match, and an exclusion wins. See [How audiences match](https://support.pyn.ai/directory/employee-groups/how-audiences-match/).

## What you should see

Under [Enrollments](https://support.pyn.ai/activity/enrollments/), an enrollment that exits moves to **Complete** and records the time it was stopped, the same as **Stop** from its panel. Its unsent steps are completed and their deliveries cancelled; a delivery already sending finishes. Employees who keep matching every condition are unaffected.

## Related

- [Set the audience for an automation](https://support.pyn.ai/flows/automations/set-the-audience/) for who is enrolled in the first place.
- [Automation and enrollment states](https://support.pyn.ai/flows/automations/automation-and-enrollment-states/) for what **Complete** and a stopped enrollment mean.
- [Publish an automation](https://support.pyn.ai/flows/automations/publish-an-automation/) to move running enrollments onto the version that carries the conditions.
- [How audiences match](https://support.pyn.ai/directory/employee-groups/how-audiences-match/) for the matching rule with worked examples.
