Modules
Display conditions

Rate this page:

Scheduled trigger

The scheduledTrigger module repeatedly invokes a function on a scheduled interval. Each trigger is scheduled to start shortly after it is created, about 5 minutes after app deployment. It then runs based on the configured interval hour, day, or week.

Every time any changes are made to any scheduled triggers module, all scheduled triggers will be recreated and their start times reset.

Scheduled triggers run without a user context, which means the principal field of the context argument doesn't represent a user. If a function invoked from a scheduled trigger returns a value, it is ignored. If the function throws an error, nothing will happen, and the function invocation will not be retried. The function will be invoked the next time the schedule is due.

Apps can declare up to five scheduled triggers in the manifest.yml file.

Not all invocations for a single scheduled trigger will happen at once. To better improve overall performance, invocations will be distributed evenly across the interval specified on any given module. Distribution is done by installations, so not all installations of an app will have their triggers invoked together. This is however a consistent distribution, meaning that if an hourly trigger invokes at 1:10 for a particular installation, and at 1:20 for another, those installations will invoke again at 2:10 and 2:20 respectively.

There is a small chance of duplicated invocations, such scenarios should be handled in the apps code by the app developer.

See Extending your app with a scheduled trigger for step-by-step instructions on how to use this module type.

Properties

PropertyTypeRequiredDescription
key

string

Yes

A key for the module, which other modules can refer to. Must be unique within the manifest.

Regex: ^[a-zA-Z0-9_-]+$

functionstringYesA reference to the function module that defines the behavior.
interval'hour', 'day', 'week'YesThe interval at which to invoke the function.

Rate this page: