Accounting Pro

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:

  1. Trigger: the event that starts the workflow, for example Requested Leave.
  2. Conditions (optional): the workflow runs only when these conditions are true.
  3. 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

  1. In your WordPress admin, go to WP ERP → Workflow.
  2. Click Add Workflow.
The Workflow menu and the Add Workflow button
  1. 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

  1. In the Trigger panel, select the Module. For example, select HR.
  2. Select the Event. For example, select Requested Leave.
  3. Click Apply.
The HR module and its events in the Trigger panel

The events that you can use:

ModuleEvents
GeneralCreated User
HRCreated Employee, Deleted Employee, Published Announcement, Requested Leave, Confirmed Leave Request, Happened Birthday Today
CRMCreated Contact, Deleted Contact, Subscribed Contact, Unsubscribed Contact, Created Note, Created Task, Scheduled Meeting
EmailInbound Email
AccountingCreated 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:

  1. Click the Only if card. It shows Runs for every event.
  2. 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.
  3. Click Add Condition.
  4. Select a field, an operator (for example is equal to), and type a value.
  5. Click Apply.
A condition on the leave policy

The fields come from the event. For Requested Leave, the fields are Reason, Start Date, End Date, and Policy.

Step 4: Add a step

  1. Click the + button below the cards.
  2. In the Add a step window, select a step.
The Add a step window
StepWhat it does
WaitWaits for a time after the event before the next steps run.
Send EmailSends an email to the record of the event or to people that you select.
Trigger Action HookRuns a custom WordPress action hook. Developers use it to run their own code.
Update FieldChanges a field of the record. For HR, only Created Employee has this step.
Assign Task, Add Activity, Schedule MeetingCRM steps. They show only for CRM events.
Send InvoiceSends 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:

  1. Type the Subject.
  2. Select the people in To. Type a name to search for an employee.
  3. Type the Message.
  4. To add data from the event, click Insert field. For example, add [start_date] and [end_date] to the subject.
  5. Click Apply.
The Send Email panel with a subject, a recipient, and a message

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.
The Save Only and Save & Activate buttons

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.

Was this article helpful to you?

How can we help?