Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparison with other Yandex Cloud services
    • Overview
      • Overview
      • Timer
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ

In this article:

  • Getting started
  • Create a timer
  • Check the result
  • What's next
  1. Getting started
  2. Creating a trigger
  3. Timer

Creating a timer that invokes a function

Written by
Yandex Cloud
Updated at May 13, 2025
  • Getting started
  • Create a timer
  • Check the result
  • What's next

Create a timer that invokes a Cloud Functions function every minute.

Getting startedGetting started

  1. Create a function to be triggered by timer. For example, you can create any function from this list.
  2. Create a service account that will be used to invoke the function and assign it the functions.functionInvoker role.

Create a timerCreate a timer

Note

The trigger is initiated within 5 minutes of being created.

Management console
CLI
API
  1. In the management console, select the folder where you want to create a timer.

  2. Select Cloud Functions.

  3. In the left-hand panel, select Triggers.

  4. Click Create trigger.

  5. Under Basic settings:

    • Enter the trigger name: timer.
    • In the Type field, select Timer.
    • In the Launched resource field, select Function.
  6. Under Timer settings, enter * * ? * * * or select Every minute.

  7. Under Function settings, select your function and specify:

    • Function version tag: $latest
    • Service account you created earlier
  8. Click Create trigger.

If you do not have the Yandex Cloud (CLI) command line interface yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To create a timer that invokes a function every minute, run this command:

yc serverless trigger create timer \
  --name timer \
  --cron-expression '* * ? * * *' \
  --invoke-function-id <function_ID> \
  --invoke-function-service-account-id <service_account_ID>

Where:

  • --name: Timer name.
  • --cron-expression: Function invocation schedule specified as a cron expression.
  • --invoke-function-id: Function ID.
  • --invoke-function-service-account-id: Service account ID.

Result:

id: a1s2aanidtep********
folder_id: b1gtmgn9gbvm********
created_at: "2023-03-03T12:18:15.707328472Z"
name: timer
rule:
  timer:
    cron_expression: '* * ? * * *'
    invoke_function_with_retry:
      function_id: d4eaic3se926********
      function_tag: $latest
      service_account_id: ajek1us5r79c********
status: ACTIVE

You can create a timer using the create API method.

Check the resultCheck the result

To make sure the timer is running properly, view the function logs. They should show that the function is invoked every minute.

Management console
CLI
  1. In the management console, select the folder containing your function.

  2. Select Cloud Functions.

  3. Click a function to view its runtime log.

  4. In the window that opens, go to Logs and specify the period for which you want to view logs. The default period is 1 hour.

To view the function logs, run this command:

yc serverless function logs <function_ID>

Result:

2023-03-03 12:44:12  INFO START RequestID: 5906fbf3-7ff5-4fe4-a0b2-b35c******** Version: d4efs25vm37e********
2023-03-03 12:44:12  INFO END RequestID: 5906fbf3-7ff5-4fe4-a0b2-b35c********
2023-03-03 12:44:12  INFO REPORT RequestID: 5906fbf3-7ff5-4fe4-a0b2-b35c******** Duration: 8.951 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 48 MB Queuing Duration: 0.066 ms Function Init Duration: 5.892 ms
2023-03-03 12:45:12  INFO START RequestID: e806a5c4-e06a-4a6f-b468-386d******** Version: d4efs25vm37e********
2023-03-03 12:45:12  INFO END RequestID: e806a5c4-e06a-4a6f-b468-386d********
2023-03-03 12:45:12  INFO REPORT RequestID: e806a5c4-e06a-4a6f-b468-386d******** Duration: 10.266 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 48 MB Queuing Duration: 0.054 ms Function Init Duration: 7.023 ms

What's nextWhat's next

  • Check out the concepts.
  • Learn how to create other triggers.

Was the article helpful?

Previous
Overview
Next
All guides
© 2025 Direct Cursus Technology L.L.C.