Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Configuring flexible time windows in EventBridge Scheduler

Focus mode
Configuring flexible time windows in EventBridge Scheduler - EventBridge Scheduler

When you configure your schedule with a flexible time window, EventBridge Scheduler invokes the target within the time window you set. This is useful in cases that do not require precise scheduled invocation of targets. Setting a flexible time window improves the reliability of your schedule by dispersing your target invocations.

For example, if you configure a 15 minute flexible time window for a schedule that runs every hour, it invokes the target within 15 minutes after the scheduled time. The following AWS CLI, and EventBridge Scheduler SDK examples use UpdateSchedule to set a 15 minute flexible time window for a schedule that runs once every hour.

Note

You must specify whether you want to set a flexible time window or not. If you do not want to set this option, specify OFF. If you do set the value to FLEXIBLE, you must then specify a maximum window of time during which you schedule will run.

Example AWS CLI
$ aws scheduler update-schedule --name lambda-universal --schedule-expression 'rate(1 hour)' \ --target '{"RoleArn": "ROLE_ARN", "Arn":"arn:aws:scheduler:::aws-sdk:lambda:invoke" "Input": "{\"FunctionName\":\"arn:aws:lambda:REGION:123456789012:function:HelloWorld\",\"InvocationType\":\"Event\",\"Payload\":\"{\\\"message\\\":\\\"testing function\\\"}\"}" }' \ --flexible-time-window '{ "Mode": "FLEXIBLE", "MaximumWindowInMinutes": 15} \
{
    "ScheduleArn": "arn:aws:scheduler:us-west-2:123456789012:schedule/lambda-universal"
}
Example Python SDK
import boto3 scheduler = boto3.client('scheduler') sqs_templated = { "RoleArn": "<ROLE_ARN>", "Arn": "<QUEUE_ARN>", "Input": "{}"} flex_window = { "Mode": "FLEXIBLE", "MaximumWindowInMinutes": 15} scheduler.update_schedule(Name="your-schedule", ScheduleExpression="rate(1 hour)", Target=sqs_templated, FlexibleTimeWindow=flex_window)
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.