FlyHR

AUTOMATION AND NOTIFICATIONS

Workflows

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.

Before you start

  • You must be a WordPress administrator or an HR manager.
  • The Workflow module must be on. See FlyHR Pro.
  • To send text messages, set up an SMS gateway first. See SMS Notifications.

Step 1: Start a workflow

  1. In the top menu, open More, then click Workflows.
  2. Click Add Workflow.

The Workflows page with the Add Workflow button

  1. At the top, type the name of the workflow in Enter Workflow Name.

Step 2: Choose the trigger

The trigger is the event that starts the workflow.

  1. Click the When this happens card.
  2. In the panel on the right, select the Module: General or HR.
  3. Select the Event.

A new workflow with the Trigger panel

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.

Step 3: Add conditions (optional)

Without conditions, the workflow runs on each event. To run it only in some cases:

  1. Click the Only if card below the trigger. It shows "Runs for every event" until you add a condition.
  2. Select For All (all conditions must be true) or For Any (one condition is enough).
  3. Select the Field, the operator, and type the Value. For example: Department is equal to Engineering.
  4. To add another condition, click Add Condition.
  5. Click Apply.

A workflow with a condition on the department

The Conditions panel

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.

Step 4: Add a wait (optional)

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.

Step 5: Add an action

  1. Click + below the last card.
  2. In the Add a step window, click the action.

The Add a step window

  1. Fill in the action in the panel on the right.

The Send Email action with a subject, a recipient, and a message

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.

Step 6: Save the workflow

  • Click Save & Activate to save the workflow and turn it on.
  • Click Save Only to save it without turning it on.

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.

See the run history

The Runs column shows how many times a workflow ran. Click the number to see the last runs.

Change or remove a workflow

Click the ⋮ menu of a workflow:

  • Edit: open the workflow. Click Update to save your changes.
  • Delete: move the workflow to the Trash tab. On the Trash tab, you can Restore it or Delete permanently.

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".