Workflow
A workflow does a task for you when something happens in WP ERP. For example, when an employee requests leave, a workflow can email the manager. You do not have to send the email yourself.
Each workflow has three parts:
- Trigger: the event that starts the workflow, for example Requested Leave.
- Conditions (optional): the workflow runs only when these conditions are true.
- Steps: what the workflow does, for example Send Email.
Before you start
- You must have WP ERP Pro with the Workflow extension turned on in WP ERP → Modules.
- You must be a WordPress administrator, or a manager of the module that you automate. An HR manager sees the HR events. A CRM or Accounting manager does not see them.
Step 1: Start a new workflow
- In your WordPress admin, go to WP ERP → Workflow.
- Click Add Workflow.

- At the top of the page, type a name for the workflow, for example Tell the manager about new leave requests.
Step 2: Choose the trigger
- In the Trigger panel, select the Module. For example, select HR.
- Select the Event. For example, select Requested Leave.
- Click Apply.

The events that you can use:
| Module | Events |
|---|---|
| General | Created User |
| HR | Created Employee, Deleted Employee, Published Announcement, Requested Leave, Confirmed Leave Request, Happened Birthday Today |
| CRM | Created Contact, Deleted Contact, Subscribed Contact, Unsubscribed Contact, Created Note, Created Task, Scheduled Meeting |
| Inbound Email | |
| Accounting | Created Customer, Deleted Customer, Created Vendor, Deleted Vendor, Added Sale, Added Expense, Added Check, Added Bill, Added Purchase Order, Added Purchase |
A module shows only when it is turned on. The CRM and Email events show only when the CRM module is on.
Step 3: Add conditions (optional)
Without conditions, the workflow runs for every event. To run it only for some events:
- Click the Only if card. It shows Runs for every event.
- Select For Any or For All.
- For Any: the workflow runs when one of the conditions is true.
- For All: the workflow runs only when all conditions are true.
- Click Add Condition.
- Select a field, an operator (for example is equal to), and type a value.
- Click Apply.

The fields come from the event. For Requested Leave, the fields are Reason, Start Date, End Date, and Policy.
Step 4: Add a step
- Click the + button below the cards.
- In the Add a step window, select a step.

| Step | What it does |
|---|---|
| Wait | Waits for a time after the event before the next steps run. |
| Send Email | Sends an email to the record of the event or to people that you select. |
| Trigger Action Hook | Runs a custom WordPress action hook. Developers use it to run their own code. |
| Update Field | Changes a field of the record. For HR, only Created Employee has this step. |
| Assign Task, Add Activity, Schedule Meeting | CRM steps. They show only for CRM events. |
| Send Invoice | Sends the invoice. It shows only for Added Sale. |
The window shows only the steps that the trigger allows. For HR events, you can use Wait, Send Email, and Trigger Action Hook.
Step 5: Set up the email
If you selected Send Email:
- Type the Subject.
- Select the people in To. Type a name to search for an employee.
- Type the Message.
- To add data from the event, click Insert field. For example, add [start_date] and [end_date] to the subject.
- Click Apply.

You can add more steps with the + button.
Step 6: Save the workflow
- Click Save & Activate to save the workflow and start it now.
- Click Save Only to save the workflow without starting it.

Manage your workflows
Go to WP ERP → Workflow to see all workflows. The tabs show All, Active, Paused, and Trash. The Runs column shows how many times each workflow ran.
- To change a workflow, click its name.
- To stop a workflow for a time, turn off its switch in the Active column. Turn the switch on to start it again.
- To remove a workflow, move it to the trash. You can restore it from the Trash tab, or delete it permanently.
What changed in 2.0
- The Workflow screens are new. You build a workflow on one page with cards: When this happens, Only if, and the steps.
- The delay before the actions run is now a Wait step.
- The HR module is called HR in the trigger list.
- HR events show only to administrators and HR managers.

