Wednesday, November 7, 2018

Schedule a workflow without the use of a scheduled script

Workflows can be scheduled to run every 30 minutes by through Scheduled Initiation in the Workflow Summary, and by specifying a saved search. In addition, a workflow can also be made to run on any schedule from a scheduled script deployment. However, this might be limiting for customers who are not familiar with SuiteScript and scheduled deployments.

There is a way to schedule workflows without the use of custom scripts. All that needs to be done is to create a custom field of type Date and incorporate it to the saved search that is fed to the workflow.

Here is an example of a workflow that emails overdue balance notices to customers every week using this approach:

1. Create a hidden custom field of type Date.

2. Next, create a Customer saved search with the following criteria:

3. The Date criteria needs to be set as follows:

4. Create the workflow and select the saved search that was just created:

5. Finally, here are the actions within the state:


The saved search returns customers with overdue balances who have not yet been sent notices previously, or those who have been sent notices a week ago or more. For each of those customers, the workflow sends out an email notice and updates the custom Date field afterwards.

After 30 minutes, the workflow will execute again and call the saved search. Since the custom Date field has already been updated to the current date, the customer who has been sent a notice 30 minutes earlier no longer becomes part of the search results, and therefore will not be sent another email until after a week.

No comments:

Post a Comment