Back to Step Functions

scheduleFlow

Advanced

Executes workflow steps at specific times or recurring intervals for time-based automation, monitoring tasks, and background processes.

overview

The scheduleFlow function enables Vibes to execute workflow steps at specific times or recurring intervals. This powerful function allows you to create time-based automation, set up monitoring tasks, and schedule background processes that run independently of user interactions.

Schedule a set of workflow steps to execute at a specified date/time, with optional recurring intervals for ongoing automation and monitoring.

Time-Based Automation: This function extends Vibes beyond real-time interactions, enabling sophisticated time-based workflows and monitoring systems that operate independently while maintaining access to your workflow context and global variables.

Key Capabilities

Scheduling Flexibility

  • One-time execution at specific dates/times
  • Recurring schedules with flexible intervals
  • Flexible time intervals (seconds to years)
  • Comprehensive timezone support

Workflow Automation

  • Complex step sequences with conditional logic
  • Database monitoring and alerting
  • Automated report generation and distribution
  • System maintenance and cleanup tasks

input_parameters

ParameterTypeRequiredDescription
stepsarrayArray of workflow steps to execute on schedule
start_date_timestringDate/time when execution should begin
start_date_time_formatstringFormat string for parsing the start_date_time
time_zonestringTimezone for schedule execution (e.g., "America/Chicago")
is_recurringbooleanOptionalWhether the schedule should repeat (default: false)
recurring_intervalstringOptionalTime unit for recurrence (required if is_recurring is true)
recurring_incrementnumberOptionalNumber of intervals between executions (required if is_recurring is true)

Return Format

The cancelScheduledFlow function returns a simple completion confirmation:

Scheduling Confirmation

Schedule Configuration

Supported Recurring Intervals

IntervalDescriptionExample Usage
secondEvery N secondsHigh-frequency monitoring
minuteEvery N minutesStatus checks, brief polls
hourEvery N hoursRegular data collection
dayEvery N daysDaily reports, maintenance
weekEvery N weeksWeekly summaries
monthEvery N monthsMonthly processing
yearEvery N yearsAnnual tasks

Date/Time Format Examples

Supported Formats

MM/DD/YYYY
12/25/2024
Month/Day/Year
DD/MM/YYYY
25/12/2024
Day/Month/Year
YYYY-MM-DD
2024-12-25
ISO date format
MM/DD/YYYY HH:mm
12/25/2024 14:30
Date with time (24-hour)
MM/DD/YYYY hh:mm A
12/25/2024 02:30 PM
Date with time (12-hour)

Common Timezones

America/New_York
Eastern Time
America/Chicago
Central Time
America/Denver
Mountain Time
America/Los_Angeles
Pacific Time
UTC
Coordinated Universal Time
Europe/London
Greenwich Mean Time
Asia/Tokyo
Japan Standard Time

One-time execution at specific dates/times

Holiday Reminder

Recurring Execution

Daily Report Generation

Scheduled Flow Context

Scheduled flows operate in an isolated context environment with specific restrictions that are important to understand:

Available Context

  • Global variables set during the original workflow
  • conversationContext from when the schedule was created
  • Variables created within the scheduled flow itself

Not Available

  • Step outputs from the original workflow
  • Real-time conversation updates
  • Current user session data

Context Inheritance Example

How to properly set up global variables for scheduled access:

Global Variable Scheduling

Important Context Note: Scheduled flows cannot access step outputs from the original workflow. Store all necessary data in global variables before scheduling.

Usage Examples

Database Monitoring with Alerts

Set up continuous monitoring with conditional alerting:

Risk Monitoring System

Weekly Report Generation

Automated weekly performance reports with HTML formatting:

Automated Weekly Reports

Maintenance Window Automation

Schedule monthly maintenance tasks during off-hours:

Monthly Maintenance Tasks

Working with Global Variables

Setting up configuration that scheduled flows can access:

Configuration via Global Variables

Best Practices

Scheduling Considerations

Plan schedules carefully considering timezones, precision, and testing requirements.

  • Always use appropriate timezone identifiers for your location
  • Consider server timezone vs. user timezone differences
  • Use absolute dates rather than relative dates for precision
  • Test scheduling with short intervals before deploying long-term schedules

Performance & Resource Management

Optimize scheduled flows for efficient resource usage and system performance.

  • Avoid very frequent recurring schedules (less than 1 minute intervals) unless necessary
  • Use cancelScheduledFlow to clean up completed one-time schedules
  • Monitor scheduled flow execution through the Scheduled tab in Vibes
  • Set reasonable timeouts for database and API operations within scheduled flows

Error Handling and Recovery

Implement robust error handling for reliable scheduled operations.

  • Include error handling steps in scheduled workflows
  • Set up notification systems for failed scheduled executions
  • Use conditional logic to handle edge cases and missing data
  • Implement retry logic with condition-based limits

Context Management

Properly manage workflow context and data access for scheduled execution.

  • Store all necessary data in global variables before scheduling
  • Avoid dependencies on real-time conversation data
  • Use global variables for configuration that scheduled flows will need
  • Remember that scheduled flows cannot access step outputs from the original workflow

Related Functions

These functions work together with scheduleFlow for comprehensive time-based automation and monitoring: