salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.43k stars 2.07k forks source link

Better Workflow scheduling options #8292

Open pgorod opened 4 years ago

pgorod commented 4 years ago

Issue

This is a suggestion for a feature which comes form this discussion #3806, I think it shouldn't get lost as I often see requests for similar things in the Forums, and I believe this is relatively easy to implement.

The problem

Workflows job is typically executed once per minute. If you want to do something only once per hour, day, month, etc., you have to play with some field to store whether it has run already in the current period or not; and have a condition break the execution if it has. This is inefficient in terms of performance, and cumbersome and confusing to set up.

You can also just set up a custom scheduler job in PHP, but this is a show-stopper for users who are not programmers and want to stick to the Workflows UI.

The proposed solution

I have a suggestion for a design to solve this same problem, with a generic solution, and I believe it isn't too much work to develop:

image

image

This way the full possibilities of crontab settings could be applied to any specific Workflow.

Note that we already have a Process AOW Wokflow Scheduler job, but it runs all the Workflows, not a specific one.

pgorod commented 4 years ago

A slightly easier to make UI, although not as good, would be to just dump all the Workflows into the existing Job dropdown.

So in that version, there wouldn't be a second dropdown for the specific job selection, you would just add all existing Workflows in the job dropdown, after the others, with a Workflow: prefix, like this:

Job Dropdown: 
URL
Refresh Jobs
Check inbound Email accounts
(... all the other currently existing jobs ...)
Workflow: my daily task
Workflow: birthday reminder
Workflow: create weekly meetings
turtlemenace commented 3 years ago

This would be a powerful feature.