I have created a workflow that will send an email to the person to whom task is assigned, on a date/time that was set in the task in the field called ‘Warning time’ - attached workflow_01.
The email will be sent when the warning = today - attached workflow_02
This does not work so I an email by using 'Only On Save" so that I can see the values of the variables in the workflow - attached workflow_03. The result is in attached workflow_04.
My server time - attached workflow_05.
It appears that the workflow module is using UTC. This causes the times to differ by two hours.
How can I resolve this?
My setup is as follow: SuiteCRM Version 7.10.7 Sugar Version 6.5.25 (Build 344)
Please try some time-based workflow that uses a normal, existing field, instead of your custom “warning time” field. This will let you determine if the problem is when saving your field, or if it is a problem for all workflows in your system.
Oh, and another thing: in Admin /Schedulers, when you enter the Workflow Job, do you see a “last ran successfully” time that is recent, and in the correct timezone?
So I ran the query on the due date. Same result. The workflow does not fire at all. If I then fire it by using the ‘Only on Save’, it does execute and the variables that is sent with the email, indicates the two hour time difference between the task and the workflow.
It appears that the workflow uses UTC0 against my timezone which is equal to UTC+2.
“On save” workflows are triggered from the web app, and use the web server’s version of PHP. The rest of the Workflows are triggered by the cron jobs, and might use a different CLI PHP. So it is common to see different timezones between these cases, when things haven’t been properly configured yet.
What I don’t understand is how the timezone seems to be set correctly in your CLI PHP and still doesn’t play well with the Workflows.
How exactly are you launching your cron jobs? Which user’s crontab are you using?
I think when you’re using a specific user’s crontab, you don’t include the user name. So this would work in the system-wide crontab (“crontab -e” or “nano /etc/crontab”)
In Admin /Schedulers, when you enter the Workflow Job, do you see a “last ran successfully” time that is recent, and in the correct timezone?
If so, then the cron set up is correct, only the individual Workflow conditions might be wrong. If not, the cron set up is broken, but I am running out of suggestions to get that right