AUTOMATION AND NOTIFICATIONS
This feature is part of FlyHR Pro on the Agency plan.
A workflow does a task for you when something happens in FlyHR. For example, when an employee in Engineering requests leave, FlyHR sends an email to the Engineering lead. Each workflow has a trigger, optional conditions, an optional wait, and one or more actions.

The trigger is the event that starts the workflow.

| Module | Event | Starts when |
|---|---|---|
| General | Created User | A new WordPress user is made. |
| HR | Created Employee | You add an employee. |
| HR | Deleted Employee | You delete an employee. |
| HR | Requested Leave | An employee requests leave. |
| HR | Approved Leave Request | A leave request is approved. |
| HR | Birthday Today | It is the birthday of an employee. |
If you change the event later, FlyHR removes the conditions and the actions, because they use the fields of the old event.
Without conditions, the workflow runs on each event. To run it only in some cases:


The operators are: is equal to, is not equal to, is greater than, is less than, is greater than or equal, is less than or equal, contains, and does not contain.
To run the actions later, click +, then click Wait. Type the Delay and select Minutes, Hours, or Days. A delay of 0 runs the actions at once.


The actions that you can add depend on the event:
| Action | What it does | Events |
|---|---|---|
| Send Email | Sends an email to the employee, or to the people that you choose. | All events |
| Send SMS | Sends a text message to the mobile number of the employee, or of the people that you choose. People without a mobile number are skipped. | Created Employee, Approved Leave Request, Birthday Today |
| Update Field | Sets a field of the employee, for example the location. | Created Employee |
| Add User Role | Gives the user an extra WordPress role. | Created User |
| Trigger Action Hook | Runs a custom hook for your own code. The hook name must start with flyhr_workflow_custom_. |
All events |
In the subject and the message, click Insert field to add a value of the event, for example [first_name] or [start_date]. FlyHR puts in the real value when it sends the message.
On the Workflows page, use the switch in the Active column to turn a workflow on or off. Paused workflows show on the Paused tab.
The Runs column shows how many times a workflow ran. Click the number to see the last runs.
Click the ⋮ menu of a workflow:
If a workflow came from WP ERP and uses an action that FlyHR cannot run, the list shows "(never runs)" or the step shows "Skipped: FlyHR cannot run this action".