scheduleTrigger Documentation
Overview
The scheduleTrigger is a core component of the Vantage analytics and data platform. This Logic node serves as an entry point to emit trigger metadata when a workflow is executed according to a defined schedule. It does not manage its own timing but relies on external scheduling mechanisms such as Vercel Cron or AWS CloudWatch, which interface via the /api/workflow/triggers/evaluate endpoint. When triggered, the node generates a single-row output containing vital scheduling information, including the time of the trigger, the type of schedule, applicable cron expressions, and timezone details.
Settings
Configuration Properties
The configuration of the scheduleTrigger component includes the following settings:
-
scheduleType
- Input Type: Dropdown (string)
- Description: Determines the type of schedule to be used. Accepts values such as "interval," "daily," "weekly," "monthly," or "cron." Changing this value alters how often and when the workflow runs.
- Default Value:
"interval"
-
intervalMinutes
- Input Type: Numeric (integer)
- Description: Specifies the interval in minutes at which the workflow should be executed when
scheduleTypeis set to "interval." Changing this value increases or decreases the frequency of workflow execution. - Default Value:
60
-
cronExpression
- Input Type: String
- Description: Defines a cron expression for scheduling when
scheduleTypeis set to "cron." A valid cron expression dictates specific timing rules, affording granular control over execution scheduling. Adjusting this parameter controls the precise timing of workflow executions. - Default Value:
""(an empty string)
-
timezone
- Input Type: String
- Description: Indicates the timezone in which the trigger operates. This setting affects how time-based triggers are calculated. Adjusting this can lead to differences in the timing of execution relative to the server's base timezone.
- Default Value:
"UTC"
-
timeOfDay
- Input Type: String (HH:MM format)
- Description: Specifies the time of day when the workflow should run for daily, weekly, or monthly schedules. Changing this affects the exact minute of the day that the workflow is executed.
- Default Value:
"09:00"
-
dayOfWeek
- Input Type: String
- Description: Used when
scheduleTypeis set to "weekly." Accepts a comma-separated list of integers (0 for Sunday through 6 for Saturday) that specify which days of the week the workflow should execute. Altering this changes the specific days on which executions occur. - Default Value:
""(an empty string)
-
dayOfMonth
- Input Type: Numeric (integer)
- Description: Used when
scheduleTypeis set to "monthly." Specifies which day of the month the workflow should be executed. Changing this will alter the specific date of execution within the month. - Default Value:
1
-
active
- Input Type: Boolean
- Description: Indicates whether the scheduled trigger is active (true) or inactive (false). When set to false, the trigger will not execute, regardless of the schedule parameters. Changing this setting allows users to quickly enable or disable triggers without altering other configuration settings.
- Default Value:
true
How It Works
When the scheduleTriggerNode is executed, it logs its activity for debugging purposes and initializes configuration parameters with default values if not explicitly set. Based on the schedule type, it constructs a human-readable description of the scheduled execution. The system determines whether the trigger was activated by an external schedule or manually initiated through the context.
Upon execution, it captures the current time and generates a payload with details encompassing:
- The ISO timestamp of when the trigger was executed.
- The type of schedule.
- A human-readable schedule description.
- Optional cron expressions or interval minutes corresponding to the scheduling type.
- Timezone and time of execution.
- The reason for the execution (scheduled vs. manual).
- The active status of the schedule trigger.
This payload is returned for downstream workflow processing.
Use Cases & Examples
Use Case 1: Regular Data Update
A business requires its sales data to be updated every hour to ensure that all analytics dashboards reflect the latest information. This can be achieved by configuring the scheduleTrigger with the following settings:
scheduleType: "interval"intervalMinutes: 60
Use Case 2: Weekly Report Generation
A weekly summary report needs to be generated every Monday at 9 AM:
scheduleType: "daily"timeOfDay: "09:00"dayOfWeek: "1"
Example Configuration for Weekly Report Generation
To achieve the weekly report generation use case, the following sample configuration might be used:
{
"scheduleType": "weekly",
"timeOfDay": "09:00",
"dayOfWeek": "1",
"active": true
}In this case, the workflow will be automatically triggered every Monday at 9 AM, ensuring that the weekly report is reliably generated without manual intervention.
Use Case 3: Monthly Billing Cycle Execution
A subscription-based service may require automated invoicing on the first day of every month. With the scheduleTrigger, this can be set as follows:
scheduleType: "monthly"dayOfMonth: 1timeOfDay: "00:00"
In this configuration, the service will trigger the invoicing workflow automatically at midnight on the first day of each month, ensuring a consistent billing cycle for customers.
Each of these use cases demonstrates the flexibility and utility of the scheduleTrigger component in automating recurring tasks within the Vantage platform.