Workflows

Workflows is a module for SuiteCRM allowing users to create custom workflow processes. Historically this module was called Advanced Open Workflow (AOW). It allows users to trigger various system actions based on conditions from any SuiteCRM module.

Creating a Workflow Process

You can create workflow processes by navigating to the 'Workflow' module within SuiteCRM. Click the 'Create Workflow' button within the action bar to start creating the process. The first panel allows users to set up the workflow process.

106Creating a workflow

This allows you to specify the following:

  • Name – Any name you want to give to the Workflow.

  • Assigned To - The assigned user of the Workflow process.

  • Workflow Module – A drop down list of all the modules found within the SuiteCRM instance. This is the module the Workflow is run against. For example, when an Account is created/edited.

  • Status – Active or Inactive. Only active processes will run, so you can use this field to deactivate a Workflow without having to delete it.

  • Run – This controls the way the Workflow is triggered.

    On Save

    The Workflow will run immediately for a given record when a save action occurs in the module specified.

    On Scheduler

    The Workflow will be started from the Scheduler Job Process Workflow Tasks, the next time the job runs, and will apply to every record in the module, restricted by the Run on property and by the Workflow’s conditions.

    Always

    The Workflow will run on both the situations described above.

  • Run On – This specifies the selection of records for which the Workflow will be executed.

    New Records

    The Workflow will run only for new records being created.

    Modified Records

    The Workflow will run only for records that were already created and are being changed.

    All Records

    - For On Save workflows, this means the Workflow will run for both new and modified records.
    - For On Scheduler Workflows, this means the Workflow will go through every record in the module, even old ones that weren’t changed.

    When setting On Scheduler, All Records Workflows, consider that they might cause very long operations if your module has many records. These operations will run in the background, but will still consume server resources, so it’s a good idea to run them after work hours.

  • Repeated Runs – Workflows keep track of each individual record that they have been applied to in the past. This allows you to control whether you want the Workflow actions to run only once for each record, or repeatedly, as the Worfklow is triggered again.

    Unchecked

    The Workflow will be blocked from running against any record that has already been handled by the current Workflow in the past.

    Checked

    The Workflow will run against every record, regardless of whether that record has already been handled by the current Workflow in the past.

    It is wise to consider whether there are enough restrictions in place so that this will not create excessive runs.
    For example, if one of the specified Actions negates (or will lead to the negation) of one of the specified Conditions; or if the Workflow is set to target individual records (On Save, New Records, Modified Records).

  • Description – useful to include a description of the process, its intended goals, and other notes to clarify what the current Workflow is all about.

Conditions

Adding Conditions

Once set up, you can add conditions to a workflow process using the conditions panel. This allows you to specify restrictive criteria so that only the records matching all these conditions will be affected by the Workflow’s Actions.

107Adding conditions

To add a Condition Line you must click Add Condition

You must select your Workflow Module on the first panel before adding a Condition Line.

206Add condition

You can have an unlimited amount of Condition Lines. To add another line click Add Condition again and it will appear. On the line you will have four fields; Field, Operator, Type and Value.

Field and Operator

Field is a drop down which automatically populates with all the fields found in the Workflow Module.

109Field box

The Field selected will determine the options available for Operator and Type. If the field type is not a number or date then the operators available will be 'Equal To' or 'Not Equal To'. For number and date fields you can also choose from additional logical operators; 'Less Than', 'Greater Than', 'Less Than or Equal To' or 'Greater Than or Equal To'.

110Operator box

Condition Types

You can specify workflow processes to trigger on different condition types. These are as follows:

  • Value – This is used to directly compare the Field to a value. The value type offered is dynamic to the field type of the Field selected. For example, if the field type is a drop down then the value field type will be the same drop down list.

111Value condition

  • Field – This is used to action a workflow process when one field is compared to another field in the record.

112Field condition

  • Multiple – This can be selected if the Field is a drop down/multiselect. This allows users to specify multiple values to action the workflow from.

113Multiple condition

  • Date – This allows you to specify the record to be selected for the Workflow after/before an amount of time from either another date field or 'Now'. For example, when the start date of a call is 'Now + 10 minutes'. This can only be used when the Field is a date field. The amount of time before or after the date can be specified in Minutes, Hours, Days, Weeks or Months.

114Date condition

Removing Conditions

You can remove Condition Lines by clicking - on the left-hand side of the condition.

115Removing conditions

Actions

Adding Actions

Actions are defined in the third panel. These specify what events should occur when the conditions have been met. You can add an Action by clicking the Add Action button.

116Adding actions

This will cause the Action Line to appear.

207Action line

From the Action Line you can Select Action and give it a Name. The actions available are; 'Create Record', 'Modify Record' and 'Send Email'. You can specify an unlimited amount of actions for each workflow process.

Create Record

If you select 'Create Record' you will be prompted to select a Record Type. This is the module type of the record you are looking to create.

208Create record

Once selected you can add fields or relationships to this record using the Add Field and Add Relationship buttons.

209Add field relationship1

When Adding fields the first drop down in the line will populate with all the fields from that module. The second drop down allows you to specify how the value for that field is going to be derived. For most cases the options are as follows:

  • Value – This will allow you to input the value directly using the same field type as the field selected.

  • Field – This will make the field the same value as a field found in the Workflow Module.

  • Date – Only selectable if the field is a date field. This will allow you to specify the value as an amount of time after/before another date field or 'Now'.

210Adding fields

Selecting the 'Assigned-To' field also gives you more options. As well as by value and field you can assign a user by:

  • Round Robin – This will select each user in turn.

  • Least Busy – This will select you with the least amount of records assigned to you for that module.

  • Random – This will select a random user.

For each of the above options you can choose if you want you to be selected from all users or users from a specific role. If you have the SecuritySuite module installed you can additionally choose if you want you to be selected from all users from a particular Security Group or all users from a particular security group with a particular role.

121Assigned field

When adding relationships you must select the related module from the drop down list then select the record that the new record should be related to.

212Add relationship

You must selected the related module using the arrow button – The auto completion on the text field is not currently developed.

Modify Record

This provides the same functionality as 'Create Record' but instead of creating a new record you are modifying the record which met the conditions of the workflow process. With this action you can modify any field found within the record or you can add a relationship to another record. This is completed in the same way as 'Create Record' except you are not required to specify the Record Type.

Send Email

The 'Send Email' action allows users to create workflow processes which will send an email based on an template to individuals.

The Email will be sent from the System Email Account. It is not possible to send from Emails specified in the User Profile, because Workflows sometimes run from a Scheduler job, without any user being logged on.

Using this action there are four different types of recipient.

  • Email – This will send an email to a specific email address. You must specify the email address and the email template.

213Send email to

  • Record Email – This will send an email to the primary email address specified on the record which actioned the workflow process. This can only be used if the record has an email field such as Accounts and Contacts. For this option you only need to specify the template.

image127

  • User – This will send the email to a specified Users email address. You must specify the recipient user and the template of the email.

214Send email to user

  • Related Field – This will send an email to the primary email address specified on a related modules record. In this case you must specify the related module (From a drop down list) and the email template.

215Email related field

Calculated Fields

If you select 'Calculate Fields' from the Action dropdown the Calculate Fields user interface will be loaded after a second and looks like the picture below.

216Calculate fields

There is a separate page with detailed documentation of the many possibilities of Calculated Fields in Workflows.

Process Audit

Advanced OpenWorkflow allows users to audit your processes. In the Detail View of each Workflow record there is a sub-panel called 'Processed Flows'.

image132

This lists all the workflow processes which have been actioned including details on the record which actioned the flow, its status and the date it was created.

image133

You can view this information at a higher level by clicking the 'View Process Audit' button within the module action bar. This will show all the processes that have run for all the Workflow records.

Examples

Customers to Target List

This tutorial will show you how to create a workflow process to add accounts who are customers to a Target-List when the record is created or modified. Set Up

  1. Start by navigating to the Workflow module and clicking 'Create Workflow' from the action bar.

  2. Give your workflow a Name such as 'Populate Target List'.

  3. Select Accounts as the Workflow Module.

  4. Ensure Repeated Runs is NOT selected and the Status is Active (this should be done by default). Optionally you can change the Assigned-To and add a Description.

Conditions

  1. Create a new Condition Line by clicking Add Condition.

  2. Select 'Type' from the Field drop down.

  3. Keep the Operator as 'Equals To' and the Type as 'Value'.

  4. From the Value drop down select 'Customer'.

Once these steps have been completed the Conditions panel should look like this:

134Conditions

Actions

Create a new Action by clicking Add Action.

  1. Select 'Modify Record from the Select Action drop down list.

  2. Using the Name field, give the action a name such as 'Add to Target List'

  3. Add a Relationship Line by clicking the Add Relationship button.

  4. A drop down will appear above the 'Add Relationship' button. Select the relationship from this drop down box. In this case we are looking for 'Target Lists: Prospect List'

  5. This will populate the rest of the line. Click the arrow button next to the relate field to select your target list.

Once these steps have been completed your Actions panel should look like this:

218Add to target list actions

Cases Reminder

This tutorial will show you how to create a workflow process to notify the assigned user and then a particular manger user when an open Case has not been updated/modified within two days. Set Up

  1. Start by navigating to the Workflow module and clicking 'Create Workflow' from the action bar.

  2. Give your workflow a Name such as 'Case Escalation'.

  3. Select Cases as the Workflow Module.

  4. Ensure Repeated Runs is NOT selected and the Status is Active (This should be done by default). Optionally you can change the Assigned-To and add a Description.

Once these steps have been completed the first panel should look like this:

136Case Escalation

Conditions

Create a new Condition Line by clicking Add Condition.

Select 'Date Modified' from the Field drop down.

Change the Operator to 'Less Than or Equal To' and the Type to 'Date'

From the Value fields select 'Now', '-', '2', 'Days' in order.

Once these steps have been completed the Conditions panel should look like this:

137Conditions

Repeat step 1.

This time select 'Status' from the Field drop down.

Keep the Operator as 'Equals To' and change the Type to 'Multiple'.

From the Value multi-select field select any values which signify an open case

Once these steps have been completed the Conditions panel should look like this:

138Conditions.png

Actions

  1. Create a new Action by clicking Add Action button.

  2. Select 'Send Email' from the Select Action down down list.

  3. Give the action a Name such as 'Assigned User Reminder'

  4. On the Email Line select 'Related Field' from the first drop down, 'Users: Assigned To' from the second drop down and a email template from the third drop down.

Once these steps have been completed the Actions panel should look like this:

219Assigned user reminder actions

Repeat steps 1, 2 and 3 but change the name of this action to 'Manager Escalation Email'. 2. On the Email Line select 'User' and then select you who should receive the email. Select an email template from the third drop down. 3. When you are finished click Save to create your workflow. Once these steps have been completed the Actions panel should look like this:

220Double action

Follow Up Web Leads

This tutorial will show you how to create a workflow process to assign web Leads to a particular user from a particular role within SuiteCRM. This user will be chosen by round robin. The workflow process will also set a follow up call for one day after the Lead is created.

You can change the Sales role to any role found in your own system.

Set Up

  1. Start by navigating to the Workflow module and clicking 'Create Workflow' from the action bar.

  2. Give your workflow a Name such as 'Web Lead Assignment and Follow Up'.

  3. Select Leads as the Workflow Module.

  4. Ensure Repeated Runs is NOT selected and the Status is Active (This should be done by default). Optionally you can change the Assigned-To and add a Description.

Once these steps have been completed the first panel should look like this:

141Set up

Conditions

  1. Create a new Condition Line by clicking Add Condition.

  2. Select 'Lead Source' from the Field drop down.

  3. Keep the Operator as 'Equals To' and the Type as 'Value'

  4. From the Value drop down select our condition, 'Web Site'

Once these steps have been completed the Conditions panel should look like this:

142Conditions

Actions

  1. Create a new Action by clicking Add Action.

  2. Select 'Modify Record' from the Select Action down down list.

  3. Using the Name field, give the action a name such as 'Assign to Sales'

  4. Add a Field Line by clicking Add Field.

  5. Select 'Assigned-To' from the new drop down box that has appeared above the Add Field button.

  6. Change the middle drop down box from 'Value' to 'Round Robin'

  7. Change the third drop down box from 'ALL Users' to 'ALL Users in Role'

  8. Select from forth drop down box on the line 'Sales'.

Once these steps have been completed the Actions panel should look like this:

221Assign to sales action

  1. Now create a new Action by repeating step 1.

  2. This time select 'Create Record' from the Select Action down down list.

  3. Using the Name field, give the action a name such as 'Create Follow Up Call'.

  4. From the Record Type drop down select 'Calls'.

  5. Click the Add Field button to add a new field:

  6. Select 'Subject' from the first drop down box. Leave the second drop down box as 'Value' then type the desired subject into the text field at the end.

  7. Add another field, this time selecting the 'Start Date' from the first drop down box.

  8. Change the second drop down box from 'Value' to 'Date'.

  9. In the third drop down box select 'Now'. In the fourth drop down box on the line select '+'.

  10. In the text box type '1' and in the drop down next to it select 'Days'.

  11. Add another field, this time select 'Assigned-To', 'Field', 'Assigned-To' – This will relate the assigned User of the Lead to the Call.

  12. You can add any other fields that you wish to include in the call at this stage. To finish click Save.

Once these steps have been completed the Actions panel should look like this:

222action

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.