Better Workflow scheduling options #4130

Open
opened 2026-02-20 16:14:02 -05:00 by deekerman · 2 comments
Owner

Originally created by @pgorod on GitHub (Nov 22, 2019).

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:

  • in Workflows, add option Run as Only From Specific Scheduler Job

image

  • in Schedulers, add an option in Add Scheduler called Run Specific Workflow with parameter letting you choose existing Only from Specific Scheduler Job Workflows from Dropdown

image

  • in general workflow execution, ignore these Workflows when launched from the generic Scheduler job, and run them when run from the specific one

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.

Originally created by @pgorod on GitHub (Nov 22, 2019). ### 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: - **in Workflows**, add option `Run` as `Only From Specific Scheduler Job` ![image](https://user-images.githubusercontent.com/15945027/69418639-fe956f00-0d12-11ea-9f13-8b820cd651a2.png) - **in Schedulers**, add an option in `Add Scheduler` called `Run Specific Workflow` with parameter letting you choose existing `Only from Specific Scheduler Job` Workflows from Dropdown ![image](https://user-images.githubusercontent.com/15945027/69419806-2c7bb300-0d15-11ea-95a0-6c2b1c218e80.png) - in general workflow execution, ignore these Workflows when launched from the generic Scheduler job, and run them when run from the specific one 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](https://github.com/salesagility/SuiteCRM/blob/master/modules/Schedulers/_AddJobsHere.php#L807-L812), not a specific one.
Author
Owner

@pgorod commented on GitHub (Nov 22, 2019):

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
@pgorod commented on GitHub (Nov 22, 2019): 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 ```
Author
Owner

@turtlemenace commented on GitHub (Jul 1, 2021):

This would be a powerful feature.

@turtlemenace commented on GitHub (Jul 1, 2021): This would be a powerful feature.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4130
No description provided.