Scheduling Flows
Waveloom allows you to automate the execution of your flows by setting up schedules. Instead of running flows manually or via API calls, you can configure them to trigger automatically at specific times or intervals using standard CRON expressions.
Why Schedule Flows?
- Automation: Run tasks regularly without manual intervention (e.g., daily reports, hourly data checks).
- Consistency: Ensure processes run at specific times reliably.
- Efficiency: Automate periodic data collection, content generation, or system maintenance tasks.
- Batch Processing: Schedule flows to process data in batches during off-peak hours.
Accessing Schedule Settings
You can configure the schedule for a specific flow directly within the Flow Editor:
- Open the flow you wish to schedule.
- Look for a "Schedule" button or icon, often located in the toolbar near the "Run" and "Save" buttons.
- Clicking this will open the Schedule Panel (
schedule-panel.tsx
).
Configuring the Schedule
The Schedule Panel provides the following options:
-
Enable Scheduling:
- A master toggle switch (
isActive
inFlow
model) turns the schedule on or off for the flow. If disabled, the flow will not run automatically, even if a schedule is configured.
- A master toggle switch (
-
Schedule (CRON Expression):
- This is the core of the schedule, defined using standard CRON syntax.
- The panel provides:
- Visual Builder: Select frequency (Hourly, Daily, Weekly, Monthly) and time/day options to generate a CRON expression easily.
- Examples: Choose from common presets (e.g., "Every 15 minutes", "Every weekday at 9am").
- Manual Input: Directly edit the 5-part CRON expression (
minute hour day-of-month month day-of-week
).
- Validation: The panel typically validates the syntax and shows upcoming run times based on the expression.
- CRON Resources: For help with CRON syntax, refer to external resources like crontab.guru.
-
Timezone:
- Select the timezone in which the CRON expression should be interpreted. This ensures the flow runs at the correct local time, regardless of server location.
- A list of common and all standard timezones is provided (
timezonesList
). Your local timezone is often suggested as the default.
How it Works
- Saving: When you save a valid schedule configuration with "Enable Scheduling" turned on, Waveloom registers this schedule with its underlying task scheduling system (e.g., Trigger.dev via
FlowRunnerService.scheduleFlow
). A uniquescheduleId
might be stored in theFlow
model'sscheduleConfig
. - Triggering: At the scheduled time, the scheduling system triggers an internal job (
handle-workflow-schedule
). - Execution: This job then initiates a Flow Run for your flow, similar to clicking the "Run" button.
- Disabling/Changing: Saving the flow with the schedule disabled or changing the CRON expression updates or removes the corresponding schedule in the task system (
FlowRunnerService.deleteFlowSchedule
/scheduleFlow
).
Monitoring Scheduled Runs
Flow runs initiated by the scheduler appear in the Runs tab alongside manually triggered or API-triggered runs. You can inspect their status, node outputs, errors, and credit usage just like any other run. The trigger source might be indicated in the run details.
Use Cases
- Fetch news headlines every morning at 8 AM.
- Generate a social media post summary every 4 hours.
- Check website status every 15 minutes.
- Run a data aggregation report every Sunday night.
- Generate weekly performance summaries from stored data.
Considerations
- Credit Consumption: Scheduled runs consume credits just like manual runs. Ensure your Team has sufficient credits for frequently scheduled flows.
- Concurrency: Be mindful if scheduling flows very frequently. Depending on system limits, multiple runs might queue or overlap if the flow takes longer to execute than the schedule interval.
- Inputs: Ensure your flow is designed to run automatically. It shouldn't rely on inputs that are only available during manual runs unless those inputs are fetched dynamically (e.g., via an API Request node at the start). Often, scheduled flows read starting data from Storage or external APIs.
- Timezones: Double-check the selected timezone to ensure runs occur at the intended local time.
Next Steps
- Explore the Schedule Panel for one of your existing flows.
- Try setting up a simple daily or hourly schedule for a test flow.
- Learn more about CRON Syntax.
- Review how to monitor Flow Runs (Link TBD).