How To Set Up Workflows with SugarCRM

Workflow is a term used to describe the tasks, procedures, steps, for organizations or people involved in processes that require inputting and outputting information, and the tools needed for each step in a business process.

In general, workflow management focuses on processes rather than documents. A number of companies make workflow automation products that allow a company to create a workflow model and components.

Overview of SugarCRM Workflows 

The SugarCRM Workflows are a feature found in the commercial editions of Sugar, enabling the user to automate repetitive tasks to help increase efficiency and ensure business processes are followed. With each workflow set up in Sugar, you can define a set of conditions to be met and any combination of alerts and actions to trigger once the conditions are satisfied.

With Sugar workflows you will be able to set up a workflow for when a status of a case changes, to notify the contact associated to the case that the status has changed and update a custom date field to track when that change occurred.

How Do Workflows Function?

Workflows trigger a based on a record being saved in Sugar. This save event can occur in a number of different ways:

  • Manual save by a user
  • Mass update
  • Import
  • Updates through the API (SOAP or REST)
  • Updates through the customer portal (Enterprise and Ultimate only)
  • Another workflow

The last bullet above is the most important when designing workflows. Any time a workflow triggers, even if it is just to send an email alert, the target record is re-saved to allow for evaluation by other workflows. If you have two workflows with very similar conditions and no actions to alter those conditions after the workflow triggers, you could end up with a record that loops through two or more workflows continuously.

Every workflow must have at least one condition established in order to trigger. Workflows can trigger in one of two ways:

  • Immediately upon saving the record
  • After a specified amount of time has elapsed from when the record was saved

As you become more familiar with workflows, you will learn that there are specific workflows that will require a time elapsed set up in order to function properly. Regardless of which style of workflow you are setting up, the conditions in that workflow are evaluated immediately when the record is saved. If the conditions do not validate, then no further action is taken for that workflow and additional workflows are evaluated if necessary. Lastly, it should be noted that in order for time elapsed workflows to function, you should have your scheduled jobs running. For information on setting up a scheduler, please review this article.

How Should I Design My Workflow?

You need to first determine the type of workflow you will need. Will it be a workflow that will be triggered when a record has been saved or after a period of time has elapsed? Before you start building a workflow, you will need to identify the following:

  • What is/are the condition(s) that need to be met in order for the workflow to execute?
  • Do you want the workflow to fire on new, existing or both types of records?
  • Once the condition is met, what action do you want the workflow to take?
  • Once the action occurs, do you want a notification email to go out to an external recipient(s) and/or user(s)?
  • Are you taking the proper precautions to ensure this workflow will not trigger other workflows in an unintended fashion?

It is best to map out your workflow processes before creating them in Sugar so you can understand the desired logic you want to achieve and identify any potential areas that will need safeguards to ensure your processes are performed as expected.

How Do I Set Up My Workflow?

Now that you have a basic understanding of how workflows function and your design is mapped out, proceed through the following steps to set up a workflow:

  1. Go to Admin > Workflow Management.
  2. Mouse over the ‘Workflow Definitions’ tab at the top and select ‘Create Workflow Definition’.
  3. Enter a name for the workflow and select the execution style, target module, processing order, and applicable record types. Then click ‘Save’.
  4. From the workflow detailview, you will be presented with three panels:
    1. Conditions – Set up all your workflow conditions here. All conditions you create must be met for a workflow to fire.
    2. Alerts – Create custom alerts to send out when the conditions are met.
    3. Actions – With actions, you can update fields in the target record, update fields in a related record, or create a new record related to the target record when the conditions of the workflow are satisfied.

You do not need to have an alert and action created for each workflow. Once a condition is set on the workflow and you at least have one alert or action, your workflow will be ready to go!