# Serverless schedule

**URL:** <https://forum.serverless.com/t/serverless-schedule/10067>\
**Category:** Serverless Framework\
**Tags:** lambda\
**Created:** [December 14, 2019, 7:41am UTC](https://forum.serverless.com/t/serverless-schedule/10067 "2019-12-14T07:41:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![olegs](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@olegs](https://forum.serverless.com/u/olegs)\
**Post date:** [December 14, 2019, 7:41am UTC](https://forum.serverless.com/t/serverless-schedule/10067/1 "2019-12-14T07:41:18Z")

</div>

Hello,  
I am having a problem with 'schedule + cron" option. I had noticed it is not working at all (had never been picked up, looking at logs).  
The configuration is:

```auto
functions:
  cronWorker:
    handler: src/api/cronner.cronWorker
    name: be-lambda-cron-${self:custom.stage}
    description: BRANCH-DESC-HERE
    environment:
      ENV: ${self:custom.stage}
    events:
       - schedule: 
          rate: cron(30 22 * * ? *)
          enabled: true
          input:
            key: 'day1'

```

I had noticed that

```auto
- schedule:
          rate: rate(5 minutes)
          enabled: true
          input:
            key: 'min5'

```

works just fine, but I need a cron to execute at specific time and specific day (everyday).  
what am I doing wrong or could you please point me to detailed API doc.

> **[Serverless Framework - AWS Lambda Events - Scheduled & Recurring](https://serverless.com/framework/docs/providers/aws/events/schedule/#schedule)**
>
> Setting up Scheduled, Recurring, CRON Task Events with AWS Lambda via the Serverless Framework

is not enough.

Thank you in advance,

Oleg

---

<div class="post-metadata">

**Author:** ![khinester](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/khinester/32/315_2.png) [@khinester](https://forum.serverless.com/u/khinester)\
**Post date:** [December 17, 2019, 6:05am UTC](https://forum.serverless.com/t/serverless-schedule/10067/2 "2019-12-17T06:05:25Z")

</div>

try this:

```
events:
  - schedule: cron(30 22 * * ? *) # run at 2230 every day
```

---

<div class="post-metadata">

**Author:** ![olegs](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@olegs](https://forum.serverless.com/u/olegs)\
**Post date:** [December 17, 2019, 6:58pm UTC](https://forum.serverless.com/t/serverless-schedule/10067/3 "2019-12-17T18:58:08Z")

</div>

yes, I had tried 2 options:

1. 

```
functions:
  functionWorker:
       handler: worker.funcWorker
       events:
          - schedule: cron(30 03 * * ? *) # runs at 3:30 am

```

1. 

```
functions:
      functionWorker:
           handler: worker.funcWorker
           events:
              - schedule:
                    rate: rate(5 minutes)
                    enabled: true
                    input:
                      key: 'min5'
             - schedule:
                   rate: cron(30 03 * * ? *)
                   enabled: true
                   input:
                       key: 'day1'

```

in case #1 I simply see no logs, which means the function in AWS is not picked up at all.  
in case # 2, the 'rate (5 minutes) works fine (see in logs), however,  
rate: cron is not picked up.  
Which brings me to the question, maybe rate: cron is not supporting  
input:  
key:

I could not find exact docs about it.  
(that is all docs I found [https://serverless.com/framework/docs/providers/aws/events/schedule/](https://serverless.com/framework/docs/providers/aws/events/schedule/) )

---

<div class="post-metadata">

**Author:** ![olegs](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@olegs](https://forum.serverless.com/u/olegs)\
**Post date:** [December 18, 2019, 3:29am UTC](https://forum.serverless.com/t/serverless-schedule/10067/4 "2019-12-18T03:29:44Z")

</div>

for some unknown to me reasons, option 2 had started working on AWS

---

<div class="post-metadata">

**Author:** ![aastmo](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@aastmo](https://forum.serverless.com/u/aastmo)\
**Post date:** [December 2, 2020, 2:26pm UTC](https://forum.serverless.com/t/serverless-schedule/10067/5 "2020-12-02T14:26:06Z")

</div>

Bumping since this is the only topic I could find on this issue; the reason the above code works is the double tab.

```
foo:
    handler: src/foo.main
    name: bar
    events:
      - schedule: 
          rate: cron(25 14 2 12 ? *)
          input:
            key : value 

```

The above works, whereas the following:

```
  foo:
    handler: src/foo.main
    name: bar
    events:
      - schedule: 
        rate: cron(25 14 2 12 ? *)
        input:
          key : value 

```

Does not. Documentation seems wrong on this issue.
