# Automations (https://docs.idra.zone/docs/admin/automations)

Daily rules for people who stop signing in or whose password is about to expire.

An automation runs once a day. It looks for active people in the groups you choose who meet its conditions, and acts on them. Find them under **Directory → Automations**.

## Conditions

- **Days without signing in**: from their last sign-in or session. Someone who never signed in counts from when their account was created, and someone you unsuspended or reactivated counts from then, so they aren't suspended again the next day.
- **Days to password expiry**: their password expires within this many days, under the password policy that applies to them.

With both set, both must be true. The inactivity period can't be longer than the System Log keeps events (**Settings → Account**), because sign-ins older than that are gone and everyone would look inactive.

## Actions

- **Send an email**: your subject and message, in the `Automation: notification` template. Someone gets it at most once in 30 days from one automation.
- **Change status**: suspend or deactivate.
- **Add to group** or **Remove from group**: groups managed in IdRa only. Removing only takes away a membership someone granted, because a group rule would just put them back. Adding doesn't change a membership they already have.

## Safety

- **Never administrators.** Anyone with an administrator role, and partner accounts, are left out of every automation.
- **Preview.** A new automation is saved inactive. Before activating, you see who it would change right now. You edit one only while it's inactive.
- **A limit per run.** A run that would change more people than the automation's limit changes nobody and turns the automation off. The list shows why. Activating is refused while the preview is over the limit.
- **System Log.** Everything it does is logged with the actor `Automation: <name>`. A run that changed someone logs `automation.run.complete`; one that stopped logs `automation.run.halt`.

A repeat run does nothing to someone it already handled. A failure for one person doesn't stop the others, and the next day's run picks them up.