Scheduled Task
Scheduled Task
Let OBS do things on its own, on a schedule: send reminders, move records to the next status, run reports and SQL. All scheduled tasks are in the module Main scheduler.
Main schedulerShow next runRun jobFunctionsBefore you start
- Main scheduler is for administrators. Open it from Quick access: type Main scheduler.
- A task runs a function (what to do) with parameters (on what) at a time (when). Most functions need a name of a module, a column or an e-mail template: have them at hand.
- Every change of a task ends with Save and then Show next run. A task without a next run will not start.
I want to…
The list of tasks
| Icon | What it shows |
|---|---|
| Sliders | Show next run: when the task runs next. |
| Clock | Show job history: the last runs of this task, with status and error. |
Create a task
- 1In Main scheduler click Create.
- 2Fill in Name and Description: write what the task does and for whom.
- 3Choose the Function and type the Parameters (see Functions).
- 4Set the time: Time zone, Start, End, the number of runs and the regularity.
- 5Tick Active and click Save.
- 6Click Show next run: you must see a date and time.
The fields
| Group on the form | Field | What to enter |
|---|---|---|
| Description | Name, Description | What the task does. |
| Select a function and activate the task | Function | What OBS runs (see Functions below). |
| Parameters | The settings of the function, separated with |. | |
| Active | Only active tasks run. | |
| Select the time interval in which the task will be performed | Time zone | The time zone of Start, End and the hour, for example Europe/Sofia. |
| Start, End | From when until when the task may run. | |
| Specify how many executions will be performed | Count of executions (-1 = Unlimited) | How many times in total; -1 means no limit. |
| Task Regularity | Execute the task every … | A number and a unit: Seconds, Minutes, Hours or Days. |
| Day of the month | Or: run once a month on this day. | |
| At (Oclock) | The hour and minute of the run. | |
| Notifications | Send notification on execution | Send an e-mail after each run. |
| Recipients (delimiter ;) | The e-mail addresses, separated with ;. Some functions (RunReport) send their result to them. |
Examples of timing
| I want | Set |
|---|---|
| Every day at 08:00 | Execute the task every 1 Days, At 08 : 00, Count -1. |
| Every 15 minutes | Execute the task every 15 Minutes, Count -1. |
| On the 1st of every month at 06:00 | Day of the month 1, At 06 : 00, Count -1. |
Show next run
Click Show next run in the panel Functions on the left of the form, or the sliders icon in the list. For a few seconds, a message at the top right shows when the task runs next and how long until then.
Did it run?
Click Job execution log in the panel Functions of the form, or the clock icon in the list: the last runs of this task.
| Column | Meaning |
|---|---|
| Executed before | How long ago it ran. |
| Actual date and time of execution | When it ran. |
| Function, Parameters | What ran. |
| Status | 0 = no error. |
| Error | The error, if the run failed. |
History in the bar above the form opens the module Scheduler log: every run of every task.
Run job
Run job in the bar above the form asks for a confirmation and runs the task once, now.
Check in the execution log that the run really happened.
Functions
The functions used most, with their parameters. The parameters are separated with |; an empty place is left empty.
| Function | What it does | Parameters |
|---|---|---|
| SQLFunction | Runs an SQL function of OBS. The function gets the ID of the task. | function_name |
| RawSQL | Runs an SQL statement. | UPDATE tasks SET overdue = TRUE WHERE … |
| IssueProcessStep | Moves records from one status to another and runs what the new step does (for example its e-mail; Work Flow). | module|field|old step ID|new step ID|conditione.g. timesheets|status_id|1|2|status_id = 1 |
| SendReminderOverEmail | An e-mail some days before a date in a record. | below |
| SendReminderOverEmail_Alt | The same, to a fixed e-mail address. | below |
| SendReminderOverEmailWithPDF | The same, with a PDF of the record attached. | below |
| SendTheOutputOfFunctionToEmail | Runs an SQL function that returns the columns html, recipients and subject, and e-mails the result. | function_name |
| RunReport | Runs a saved report of a module, saves it as Excel and sends it to the Recipients. Own text: an e-mail template named automated_report_<task ID>. | the ID of the saved report (filter) |
| ProcessERPMailbox | Files e-mails to records (Email client). | empty, or mt940|TEXT |
| ProcessInvoicesMailbox | Makes expenses from PDF invoices in a mailbox (Email client). | the folder (empty = INBOX) |
| RunFCMNotifications | Push notifications to the phones (Notifications). | empty |
| SendChatMsg | Sends a chat message and a notification to the phone of the user. | |
| IssuePostRequest | Sends a POST request to an API address. | address|data |
| SQLView | Runs an SQL view and keeps the result in a table named after it. | the view name without v$ |
Reminders before a date
SendReminderOverEmail looks at a date column in a module and sends an e-mail from a template to the person in a column of the record, a number of days before that date. It is the usual way to remind about ends of contracts, probation periods, deadlines.
| Place | Parameter | What to enter |
|---|---|---|
| 1 | MODULE | The module (its name in the database), e.g. staff. |
| 2 | FIELD | The column with the recipient: a reference to Employees or Contacts, e.g. manager_id. |
| 3 | DATE | The date column, e.g. end_date. |
| 4 | DAYS | How many days before the date the e-mail goes out. |
| 5 | TEMPLATE | The name of the e-mail template (E-mail templates). |
| 6 | CONDITION | Optional: which records, e.g. status_id = 2. |
| 7 | POSTPROCESSING | Optional: what to change in the record after the e-mail, e.g. status_id = 3. |
A real example: 14 days before the last working day of an employee, e-mail the manager with the template staff_departure_notification:
staff|manager_id|end_date|14|staff_departure_notification||
-7 = a week after it.To a fixed address: SendReminderOverEmail_Alt
The same, but the second parameter is a fixed e-mail address instead of a column, e.g. the HR mailbox:
staff|[email protected]|probation_end_date|14|end_of_probation_period_14|
With a PDF: SendReminderOverEmailWithPDF
The same parameters, and a PDF of the record is attached. The recipient column may point to Contacts, Users or Employees, or be a module of groups (e.g. invoices_groups). A real example: on the issue date, send the invoices in status 5 with the template send_invoice, then set their status to 2:
invoices|invoices_groups|issue_date|0|send_invoice|status_id = 5|status_id = 2
Tasks that work in pairs
Bigger notifications are often two tasks: one prepares the e-mails (an SQL function writes drafts) and one sends them (IssueProcessStep moves the drafts to the status that sends). Their names say so, for example … Generation and … Sending, and tasks that belong together share the start of the name ("Suite").
- Keep both tasks active, and the sending one a few minutes after the preparing one.
- If the preparing task did not run, the sending one has nothing to send: check the first one.
- Example: the eSignature Automation Suite keeps electronic signatures in order (Digital Signature → Scheduled tasks).
FAQ
My task did not run.
I clicked Run job and now the task does not run any more.
I changed the hour, but it still runs at the old time.
Who gets Send notification on execution?
Where are the older pages Automated tasks and SendReminderOverEmail?
Related: Notifications · Email client · Work Flow · Custom Reports.



