Skip to content

Timer#

image27

The Timer task enables the possibility to have in a workflow different types of timers (sleep, timeout, repeated timer, cron job).

image29

Warning

This task is currently deprecated and will be removed in future versions.

Inputs#

Name Data Type IsTrigger Description
Interval Integer No Interval input for all timer types except for cronJob
Activate Boolean Yes Activate/Deactivate the timer configured in the Task

Note

Although the drawn Task box indicates the Activate input is of type any it will act based on the converted value to Boolean. The visual information will be fixed in a future version.

Outputs#

Name Data Type Description
timestamp DateTime Timestamp of the timer occurrence in UTC. Emitted on every timer occurrence
Success Boolean true value emitted when the internal timer is triggered on mode Timer, Sleep or CronJob
Error Error Error that occurred during the processing of this task or when the timeout occurs

Settings#

Name Data Type Values Default Description
Auto Activate Boolean true It is the timer of the Task to be active and start counting immediately when the workflow is activated (when the controller starts/restarts)
Timer Type enum Timer
Sleep
Timeout
CronJob
Timer Type of timer to use by the Task. Each type has its own set of configurations

Timer type Timer#

Name Data Type Values Default Description
Interval Integer 10000 Number of milliseconds to wait until the next activation of the timer
Working Mode UntilDeactivation
NumberOfOccurrences
UntilDeactivation How many times the timer will trigger while it is active
Number of Occurrences Integer 30 Number of triggers that will occur if WorkingMode is set to NumberOfOccurrences

image30

Timer type Sleep#

Name Data Type Default Description
Interval Integer 10000 Number of milliseconds to wait until the Task is activated. It will be automatically deactivated after this time

image31

Timer type Timeout#

Name Data Type Default Description
Interval Integer 10000 Number of milliseconds to wait until a timeout is achieved. It will be automatically deactivated after this time

image32

Timer type CronJob#

Name Data Type Values Default Description
Cron Expression String "* * * * * *" Expression that defines a specific date and time when the job will be triggered
Time Zone enum <timezones> UTC Time zone that is used for the job scheduling

image33

Behavior#

This task has four different modes of operation, however they will only trigger on one of the following conditions:

  • Auto Activate setting is set to true

  • Activate input is fed with a true Boolean value (or compatible, like 1, true, t, yes, y)

Timer#

Every interval milliseconds, both timestamp and Success outputs emit their respective values.

If the Task setting Working Mode is configured to UntilDeactivation it will never stop unless the Activate input is fed with a false Boolean value.

If the Task setting Working Mode is configured to NumberOfOccurrences, it will automatically stop after Number of Occurrences times.

Note

The first time the timer is triggered is after interval milliseconds.

Sleep#

Upon activation after interval milliseconds, both timestamp and Success outputs emit their respective values.

Timeout#

Upon activation after interval milliseconds and if it is not deactivated, both timestamp and Error outputs emit their respective values.

CronJob#

Upon activation when the date and time, specified by the cron expression, is reached, both timestamp and Success outputs emit their respective values.

Remarks#

if Activate input receives a false Boolean value, any active timer will be immediately deactivated.

When configured in mode Timeout, the Success output will never send any value.

If the task is reactivated, all internal definitions will be reset (especially CurrentNumberOfOccurrences).

This task uses a specific structure of context-based data called zone. More information on this topic can be read in the Zones page.