Scheduling Cronjobs

Scheduling Cronjobs

By: RalphC (WEM)

2019-10-03 08:23
last edited: 2022-05-04 12:08

Moderator

WEM has a serviceplan for job scheduling, which can be managed by persons in MyWEM with a technical role on projects in Workspaces that are assigned to their Company.

The jobs are scheduled and performed outside WEM infra, by EasyCron.

All jobs run in specific Timezone: Europe/Amsterdam, CEST.

If you are using Access Control Rules in your project (enforcing ip-restrictions, you need to add the EasyCron bot ip addresses as well. Or you can use the IpAddress() function to check in your flowchart if you only want your scheduled task flow to only be used by EasyCron

EasyCron Bot IP addresses:

198.27.83.222
192.99.21.124
167.114.64.88
167.114.64.21

Check https://www.easycron.com/ips for updates (last checked 2022-05-04)

The cronjob needs a url as a starting point, which you would typically create in WEM as a Navigation Item in the Invisible folder (so it does not appear on any of the visible user menus).

A flowchart used as cronjob, should only have 1 interaction node (full page, NOT overlay) at the end of the process. This interaction node will signal the EasyCron scheduler that the end of the process is reached, with http-200 success code AND any details placed on that interaction node will be available in the EasyCron logs, which can help to investigate issues, as long as you place some useful info on that page. But, this page can also be left blank or just show a titel or header.

Button exits or other actions that you would see/use as user in a browser will NOT be triggered in any way. A scheduled job is a 1-time http-request without further interactions between client (scheduler bot) and server (WEM portal).

You can test the flowchart yourself manually and see the result that the scheduler would receive, just enter the url used for the scheduler in the browser and see what happens without pushing any buttons (and not use on of the widgets that allows you to "automatically" follow an exit, because this does not work in the scheduler).

Any scheduled job must be a simple one-way flow from 1 starting point to 1 simple interaction node (with only basic readonly display of labels, text or values) and nothing in between that needs user interaction. No widgets allowed (well, they won't work).

Also, the execution of this flowchart needs to be WITHIN 60 seconds, if it takes longer, the firewall/loadbalancer will return a 504-Timeout expired message. If you have a job that takes longer, try to split it up so you can call the job multiple times where each time a batch/part of the job is executed while remaining within 60 seconds (30 seconds or less will definitely be better!)

The interaction node at the end is rendered but only as basic textual output, if there are elements on that page that would trigger new requests or POST actions (like an action flowchart), these will NOT be fired.

In near future, WEM Modeler will have the feature to make specific Action Flowcharts (without interaction nodes) that can be indicated as Task, so these flows will be available to Scheduling tools.

These Schedulable Tasks will be easier to manage and easier to run, as they will run in background on WEM servers, so the timeout limit will be no longer an issue.

Ralph - WEM Xpert since 2011

"I speak to machines with the voice of humanity"
-- Marillion, Man of a thousand faces --

Sort by

Re:Scheduling Cronjobs

By: Frank

2021-07-16 10:34

Looking forward to this feature!

'Failure is not an option'

Re:Scheduling Cronjobs

By: Ben

2021-07-18 10:01

That's great news. When will this feature be available? Thanks!

Ben

Re:Scheduling Cronjobs

By: David

2022-06-09 13:51

Where exactly can we schedule the cronjobs? I cannot find a section in my.wem.io
Do we go straight to EasyCron and set it up from there?

Re:Scheduling Cronjobs

By: Ben

2022-06-09 13:56

Hi Ralph, is there any news on Action Flowcharts (without interaction nodes) that can be indicated as Task, so these flows will be available to Scheduling tools? Thank you.

Ben

Re:Scheduling Cronjobs

By: RalphC (WEM)

2022-06-10 07:17

Moderator

Scheduling Cronjobs can be done in the WEM Partner Portal by your official WEM Partner.

The feature for native WEM Scheduled Tasks is still in development and will be available first on the Private Cloud environments (running on Kubernetes). We do not yet have a clear idea when it is ready.

Ralph - WEM Xpert since 2011

"I speak to machines with the voice of humanity"
-- Marillion, Man of a thousand faces --

wemscore 3,513 , 337 views, 5 replies

Direct link to this thread