The process of creating scheduled tasks involves common steps for all, regardless of the type of task and context in which they are to be executed. These initial steps include:
Creation
To create a scheduled task, go to the "Settings" menu and click on "Scheduled Tasks."
You will see the page with the list of Scheduled tasks, which will be empty on first access.
Click on the "New task" button to define:
-
Task name:
assign a name to the task you are creating; -
Context:
choose the Context in which the task will take effect: Database or Data tables; -
Database:
if you have selected the Database context, you will subsequently choose the target for the task you are creating; -
Task type:
select the type of task you want to configure.
Once you have defined the basic characteristics of the task, click the "Save" button at the top right to proceed with the configuration of the general settings of the scheduled task.
Configuration of general settings
The first step in creating a scheduled task, regardless of the chosen type, is to define the general settings.
Definition of basic information
From the "General" section, you can:
- Modify the Task name;
- Define the Task status:
The statuses of a task are:
- Staging: the task is in configuration phase;
- Production: the task is running;
- Paused: the task is stopped, on hold.
- Add notes and comments that will be visible only to other users of the platform.
Scheduling the execution
In the "Scheduling" section, plan the timing and recurrence of your activities.
To schedule and activate a task, it must be set to "In Production" status from the "General" section.
-
Execution, choose the mode and frequency of execution:
- On demand: the task is executed when requested or started manually;
- Monthly: the task is executed once a month. Select the day of the month and the time to execute the task.
- Weekly: the task is executed on the indicated day(s) of the week. Define on which days and at what time of the week to execute the task.
- Daily: the task is executed once a day. Define the time to execute the task.
-
Hourly: the task is executed with the indicated hourly frequency and/or within the specific time range indicated.
- In the "Execute every" field, define how many hours apart the scheduled task will be executed;
- Fill in the "Start Time" and "End Time" fields to set the time range during which the task will be executed every day. For example, the task will be executed every 2 hours between 9 AM and 6 PM. If nothing is indicated, the task will be executed between 0 and 24 hours.
-
When a file is present: the file will be searched in the indicated local FTP folder in "Data Source," and the task will start when a file with the specified extension is found.
We recommend uploading files with a temporary extension and renaming them after the upload is complete. This way, you will avoid processing incomplete files or causing execution to fail. -
Expected duration: enter the number of minutes you expect the execution to take to complete.
Outside the estimated interval, the execution will continue to run until its completion but you will receive a notification regarding the exceeding of your estimated time. - Maximum duration: enter the number of minutes you expect the execution to take to complete. At the end of the estimated interval, the execution will be suspended.
-
Allow parallel execution: choose to start more scheduled executions simultaneously.
Important note: it is not recommended to select this option as there is a risk that two or more executions may conflict with each other, canceling them out. - Use the user permissions: the task must always be executed with the permissions of a platform user. With this option, you choose the user from whom to "inherit" the permissions.
Create notification emails for the task
In the "Email notifications" section, you can create customized notification messages to communicate:
- The start of the task execution
- The end and the result (positive or negative) of the execution
- The current status of an execution (using specific placeholders).
In the Sender email field, enter the sender's email address (this will be the one displayed to those who will receive the communication).
In the Recipient email field, enter the list of notification recipients (one address per line).
By selecting the type of notification you wish to create, you will open the text editor for the message body.
You can modify the subject and the default message proposed for the recipients. If you want to create a notification informing you about the current status of execution, you will need to modify an existing one by inserting the necessary placeholders.
Execution of cascading tasks
In the "Post-execution tasks” section, you can ensure that once execution is complete, a subsequent task can automatically start, even if the execution of the scheduled task encountered an error.
Activate the Run a cascading task option, which will display the Task field and select the next action to execute.
- Perform a new scheduled task
- Call a REST Web service
- Start an automated flow
For the first option, specify which task among those in the "In production" status you want to start after the previous one ends.
For the second option, configure the REST Web service to use by defining the following parameters:
- URL: the address of the Webservice REST to call;
- HTTP Method: the HTTP method used for the request, selecting from GET, POST, PUT, HEAD;
- HTTP Header: to add additional headers sent in the request;
- Body of POST: in case of POST or PUT method, this is the data that will be sent to the server in the BODY of the request. You can use all placeholders for the end of execution notification emails;
- OAuth2 server digital certificate: if the name of the digital certificate is entered and a token is available, an "Authorization Bearer" header containing the token will be added. A ${access_token} placeholder that contains the value of the token will be available;
- Disable the validity control for SSL certificates: by enabling this option, you can call Web service with protocol https even without a valid SSL certificate;
- Perform the token refresh automatically: by enabling this option, the Oauth2 token to be used for the REST API Web service call will be automatically renewed.
For the third option, select the automated flow node to start, knowing that you can choose only automated flows with a active status and nodes of type Periodic Filter, with a frequency of On-Demand (from a scheduled task).