# EventBridge Scheduler

Source: /aws/services/scheduler/

## Introduction

EventBridge Scheduler is a serverless scheduler that lets you invoke AWS services on a schedule.
You can create one-time schedules that run at a specific time, and recurring schedules that run at a fixed rate or on a cron expression.
Each schedule delivers a payload to a target, such as an SQS queue, a Lambda function, or a Step Functions state machine.

LocalStack allows you to use the Scheduler APIs in your local environment to create and manage schedules and schedule groups.
LocalStack runs your schedules and delivers them to their targets, and provides an endpoint to fire a schedule immediately for testing.
The supported APIs are available on our [API Coverage section](#api-coverage), which provides information on the extent of EventBridge Scheduler's integration with LocalStack.

## Getting started

This guide is designed for users new to EventBridge Scheduler and assumes basic knowledge of the AWS CLI and our [`lstk aws`](/aws/developer-tools/running-localstack/lstk/cloud-and-iac-commands/#aws) command.

Start your LocalStack container using your preferred method.
The following steps show you how to create a schedule that sends a message to an SQS queue, fire it immediately, and receive the message.

### Create an SQS queue

You can create a new SQS queue using the [`CreateQueue`](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_CreateQueue.html) API.
Run the following command to create a queue that receives the scheduled messages:

```bash
lstk aws sqs create-queue --queue-name local-notifications
```

```bash title="Output"
{
    "QueueUrl": "http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/local-notifications"
}
```

You can fetch the Queue ARN using the [`GetQueueAttributes`](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_GetQueueAttributes.html) API.
Run the following command to fetch the Queue ARN by specifying the Queue URL:

```bash
lstk aws sqs get-queue-attributes \
    --queue-url http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/local-notifications \
    --attribute-names QueueArn
```

```bash title="Output"
{
    "Attributes": {
        "QueueArn": "arn:aws:sqs:us-east-1:000000000000:local-notifications"
    }
}
```

Save the Queue ARN for later use.

### Create an execution role

EventBridge Scheduler assumes an [execution role](https://docs.aws.amazon.com/scheduler/latest/UserGuide/setting-up.html#setting-up-execution-role) to deliver to the target.
Create a file named `trust-policy.json` that allows the `scheduler.amazonaws.com` service principal to assume the role:

```json title="trust-policy.json"
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "scheduler.amazonaws.com"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}
```

Run the following command to create the role using the [`CreateRole`](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) API:

```bash
lstk aws iam create-role \
    --role-name scheduler-role \
    --assume-role-policy-document file://trust-policy.json
```

```bash title="Output"
{
    "Role": {
        "Path": "/",
        "RoleName": "scheduler-role",
        "RoleId": "AROAQAAAAAAAGNRMDKSAO",
        "Arn": "arn:aws:iam::000000000000:role/scheduler-role",
        "CreateDate": "2026-10-07T10:00:00.000000+00:00",
        "AssumeRolePolicyDocument": {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Principal": {
                        "Service": "scheduler.amazonaws.com"
                    },
                    "Action": "sts:AssumeRole"
                }
            ]
        }
    }
}
```

:::note
This role has a trust policy but no permissions, which is enough while [IAM policy enforcement](/aws/developer-tools/security-testing/iam-policy-enforcement/) is disabled (the default).
With `ENFORCE_IAM=1`, `CreateSchedule` rejects a role that EventBridge Scheduler cannot assume, and the role needs permission to call the target, such as `sqs:SendMessage`, as on AWS.
:::

### Create a schedule

You can create a new schedule using the [`CreateSchedule`](https://docs.aws.amazon.com/scheduler/latest/APIReference/API_CreateSchedule.html) API.
Run the following command to create a one-time schedule that sends a message to the queue on January 1, 2030:

```bash
lstk aws scheduler create-schedule \
    --name sqs-schedule \
    --schedule-expression 'at(2030-01-01T00:00:00)' \
    --target '{"RoleArn": "arn:aws:iam::000000000000:role/scheduler-role", "Arn": "arn:aws:sqs:us-east-1:000000000000:local-notifications", "Input": "Hello from EventBridge Scheduler"}' \
    --flexible-time-window '{"Mode": "OFF"}'
```

```bash title="Output"
{
    "ScheduleArn": "arn:aws:scheduler:us-east-1:000000000000:schedule/default/sqs-schedule"
}
```

### Trigger the schedule

Instead of waiting for the scheduled time, you can fire the schedule immediately using the LocalStack [trigger endpoint](#triggering-a-schedule).
Run the following command to trigger the schedule:

```bash
curl -X POST \
    http://localhost.localstack.cloud:4566/_aws/scheduler/schedules/arn:aws:scheduler:us-east-1:000000000000:schedule/default/sqs-schedule/trigger
```

```bash title="Output"
{"ScheduleArn": "arn:aws:scheduler:us-east-1:000000000000:schedule/default/sqs-schedule", "ExecutionId": "1f7c0d5e-6f2b-4a5e-9d63-2b1c4e8f0a7d"}
```

### Receive the message

You can receive the message that the schedule delivered using the [`ReceiveMessage`](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) API:

```bash
lstk aws sqs receive-message \
    --queue-url http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/local-notifications
```

```bash title="Output"
{
    "Messages": [
        {
            "MessageId": "6c1f5b0e-3a4d-4b8e-9f0a-2d7e1c9b8a63",
            "ReceiptHandle": "...",
            "MD5OfBody": "908bf5b73d416d19188915bdd7f4eb26",
            "Body": "Hello from EventBridge Scheduler"
        }
    ]
}
```

### List all schedules

You can list all schedules using the [`ListSchedules`](https://docs.aws.amazon.com/scheduler/latest/APIReference/API_ListSchedules.html) API.
Run the following command to list all schedules:

```bash
lstk aws scheduler list-schedules
```

```bash title="Output"
{
    "Schedules": [
        {
            "Arn": "arn:aws:scheduler:us-east-1:000000000000:schedule/default/sqs-schedule",
            "CreationDate": "2026-10-07T10:00:05.123000+00:00",
            "GroupName": "default",
            "LastModificationDate": "2026-10-07T10:00:05.123000+00:00",
            "Name": "sqs-schedule",
            "State": "ENABLED",
            "Target": {
                "Arn": "arn:aws:sqs:us-east-1:000000000000:local-notifications"
            }
        }
    ]
}
```

### Tag a schedule group

EventBridge Scheduler supports tags on schedule groups, not on individual schedules.
Run the following command to create a schedule group using the [`CreateScheduleGroup`](https://docs.aws.amazon.com/scheduler/latest/APIReference/API_CreateScheduleGroup.html) API:

```bash
lstk aws scheduler create-schedule-group --name my-group
```

```bash title="Output"
{
    "ScheduleGroupArn": "arn:aws:scheduler:us-east-1:000000000000:schedule-group/my-group"
}
```

You can tag the schedule group using the [`TagResource`](https://docs.aws.amazon.com/scheduler/latest/APIReference/API_TagResource.html) API:

```bash
lstk aws scheduler tag-resource \
    --resource-arn arn:aws:scheduler:us-east-1:000000000000:schedule-group/my-group \
    --tags Key=Name,Value=Test
```

You can view the tags associated with the schedule group using the [`ListTagsForResource`](https://docs.aws.amazon.com/scheduler/latest/APIReference/API_ListTagsForResource.html) API:

```bash
lstk aws scheduler list-tags-for-resource \
    --resource-arn arn:aws:scheduler:us-east-1:000000000000:schedule-group/my-group
```

```bash title="Output"
{
    "Tags": [
        {
            "Key": "Name",
            "Value": "Test"
        }
    ]
}
```

## Supported targets

LocalStack delivers to the following [templated targets](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-templated.html):

- Amazon SQS
- Amazon SNS
- AWS Lambda
- Amazon EventBridge
- Amazon Kinesis
- AWS Step Functions
- Amazon Data Firehose
- Amazon ECS
- AWS CodePipeline

LocalStack also delivers to [universal targets](https://docs.aws.amazon.com/scheduler/latest/UserGuide/managing-targets-universal.html).

:::note
LocalStack does not yet deliver to CodeBuild, SageMaker, or Amazon Inspector templated targets.
LocalStack accepts schedules with these targets, but logs a warning and delivers nothing when they fire.

ECS and CodePipeline targets require a plan that includes [ECS](/aws/services/ecs/) and [CodePipeline](/aws/services/codepipeline/).
Without it, LocalStack logs a warning and delivers nothing when these schedules fire.
:::

## Triggering a schedule

LocalStack provides the `/_aws/scheduler/schedules/<schedule-arn>/trigger` endpoint to fire a schedule immediately, without waiting for its scheduled time.
This is useful in tests, where the minimum rate of one minute would otherwise slow down your test suite.

Send a `POST` request with the full ARN of the schedule:

```bash
curl -X POST \
    http://localhost.localstack.cloud:4566/_aws/scheduler/schedules/arn:aws:scheduler:us-east-1:000000000000:schedule/default/sqs-schedule/trigger
```

The endpoint delivers to the target before it responds, and returns the ARN of the schedule and the ID of the execution:

```bash title="Output"
{"ScheduleArn": "arn:aws:scheduler:us-east-1:000000000000:schedule/default/sqs-schedule", "ExecutionId": "1f7c0d5e-6f2b-4a5e-9d63-2b1c4e8f0a7d"}
```

The trigger endpoint behaves as follows:

- It fires the schedule even if the schedule is disabled.
- Triggering a one-time schedule consumes its single firing, so the schedule does not fire again at its scheduled time.
- Triggering a recurring schedule does not change when it fires next.
- If the delivery fails, the endpoint still returns `200` and includes an `Error` object with the `Code` and `Message` of the failure.
  If the target has a dead-letter queue, LocalStack also sends the failed request there.
- For a target that LocalStack does not deliver to, the endpoint returns `200` without an `Error` object and delivers nothing.
  Check the LocalStack logs for the warning.
- It returns `400` for an invalid ARN, and `404` if the schedule does not exist.

## Current Limitations

- LocalStack ignores the `FlexibleTimeWindow` and fires every schedule at its exact scheduled time.
- LocalStack makes a single delivery attempt and does not retry a failed delivery.
  A failed delivery goes to the dead-letter queue right away, with the `RETRY_ATTEMPTS` attribute set to `0`.
- LocalStack accepts cron expressions that use `#` in the day-of-week field or `W` in the day-of-month field, but such schedules never fire.
- LocalStack does not replay recurring firings missed while it was stopped or while the host was asleep.
  The schedule resumes at its next occurrence.
- A one-time schedule whose time passed while LocalStack was stopped fires once when LocalStack starts or loads the saved state.
  A one-time schedule that already fired does not fire again.

## API Coverage


### EventBridge Scheduler API coverage

Source service: `scheduler`. 12 of 12 tracked operations are implemented.

Service documentation: /aws/services/scheduler/
License availability: available starting with the Hobby plan. See /aws/licensing/ for current plan details.

| Operation | Status |
| --- | --- |
| CreateSchedule | Implemented |
| CreateScheduleGroup | Implemented |
| DeleteSchedule | Implemented |
| DeleteScheduleGroup | Implemented |
| GetSchedule | Implemented |
| GetScheduleGroup | Implemented |
| ListScheduleGroups | Implemented |
| ListSchedules | Implemented |
| ListTagsForResource | Implemented |
| TagResource | Implemented |
| UntagResource | Implemented |
| UpdateSchedule | Implemented |
