Scheduling a workflow to start on a timer
You can add a schedule when creating or updating a workflow.
Adding a schedule
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
View the description of the CLI command for updating a workflow:
yc serverless workflow update --help -
Get a list of workflows:
yc serverless workflow listResult:
workflows: - id: dfqdi6ic7c5j******** folder_id: b1g681qpemb4******** created_at: "2025-03-10T13:31:55.387059Z" name: workflow895 status: ACTIVE log_options: folder_id: b1g681qpemb4******** ... - id: dfqud9cbc4k5******** folder_id: b1g681qpemb4******** created_at: "2025-03-10T12:57:48.679682Z" name: workflow203 status: ACTIVE log_options: folder_id: b1g681qpemb4******** -
Add a schedule:
yc serverless workflow update <workflow_name_or_ID> \ --schedule-cron-expression "<cron_expression>" \ --schedule-timezone "<time_zone>"Where:
--schedule-cron-expression: Cron expression, e.g.,"0 * * * * *". Learn more about the cron expression format here.--schedule-timezone: Time zone, e.g.,Europe/Moscow.
Result:
id: dfqai557kgv0******** folder_id: b1g681qpemb4******** specification: spec_yaml: ... created_at: "2025-09-19T09:11:38.826207Z" name: cron-flow status: ACTIVE log_options: folder_id: b1g681qpemb4******** service_account_id: ajelprpohp7r******** schedule: cron_expression: 0 * * * * * timezone: Europe/Moscow
Use the Update REST API method for the Workflows resource or the workflow/Update gRPC API call. In the schedule field, provide the schedule and specify the time zone.
Removing a schedule
-
View the description of the CLI command for updating a workflow:
yc serverless workflow update --help -
Get a list of workflows:
yc serverless workflow listResult:
workflows: - id: dfqdi6ic7c5j******** folder_id: b1g681qpemb4******** created_at: "2025-03-10T13:31:55.387059Z" name: workflow895 status: ACTIVE log_options: folder_id: b1g681qpemb4******** ... - id: dfqud9cbc4k5******** folder_id: b1g681qpemb4******** created_at: "2025-03-10T12:57:48.679682Z" name: workflow203 status: ACTIVE log_options: folder_id: b1g681qpemb4******** -
Remove a schedule:
yc serverless workflow update <workflow_name_or_ID> \ --remove-scheduleResult:
id: dfqai557kgv0******** folder_id: b1g681qpemb4******** specification: spec_yaml: ... created_at: "2025-09-19T09:11:38.826207Z" name: cron-flow status: ACTIVE log_options: folder_id: b1g681qpemb4******** service_account_id: ajelprpohp7r********
Use the Update REST API method for the Workflows resource or the workflow/Update gRPC API call. In the schedule field, specify null.