Annotation Interface ScheduledTrigger


@Retention(SOURCE) @Target(METHOD) public @interface ScheduledTrigger
Declares that the annotated function should be executed on a schedule.

This annotation can be used in combination with Function to define time-based triggers using cron expressions. It enables the generation of scheduled tasks for serverless platforms that support them (e.g. AWS EventBridge, GCP Cloud Scheduler).

Example


 @Function(name = "dailyTask")
 @ScheduledTrigger(cron = "0 0 * * *", timezone = "Europe/Berlin")
 public Void runDailyTask() {
     // perform daily task
     return null;
 }
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Constants representing attribute names of ScheduledTrigger.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    A cron expression defining when the function should run.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The IANA time zone in which the cron expression should be evaluated.
  • Element Details

    • cron

      String cron
      A cron expression defining when the function should run.

      Uses standard Unix cron syntax (e.g., "0 0 * * *" for daily at midnight).

      Returns:
      cron expression
    • timezone

      String timezone
      The IANA time zone in which the cron expression should be evaluated.

      Defaults to "UTC" if not specified.

      Returns:
      time zone ID (e.g., "UTC", "Europe/Berlin")
      Default:
      "UTC"