Time based scripts

Sometime it is import to create a script that runs on a timed trigger, such that can perform some housekeeping, validation or communication action in the platform. This script type, called a 'Horologist' is easy to configure

In yout script manifest.json file, set up a script definition such as:

{
"name":"THE_NAME_OF_YOUR_SCRIPT",
"description":"THE_DESCRIPTION_OF_YOUR_SCRIPT",
"type":"horologist",
"when": "cron_frequency",
"cron_frequency":"* * 0 * *",
"actions": "execute",
"handler": "NAME_OF_FUNCTION_EXPORTED_BY_JAVASCRIPT"
}

This will call your function according to the cron rules.

It is not recommended that you run a script any more frequently than once every 5 minutes, and ideally even less frequently as this can put strain on the system. One thing to note, is if you have a long running script, that you running, for example once a day, it might be necessary to extend the script timeout from it's default of 30 seconds

You can do this for all scripts for your app at the top of the script manifest.json file

{
  "version": "0.1",
  "name": "my scripts",
  "description": "My app Scripts",
  "platform": "nodejs12.x",
  "created_at": "2020-10-24",
  "updated_at": "2020-10-24",
  "timeout": 600,
  "enabled": true,
  "scripts":
  [
    {
    } 
 ]
}