이 페이지에서는 Cloud Scheduler를 사용하여 매주 월요일 오전 9시마다 또는 15분마다와 같은 특정 일정으로 워크플로를 실행하는 방법을 설명합니다. Google Cloud Console에서 또는 Google Cloud CLI를 사용하여 일정을 구성할 수 있습니다.
빈도 필드에서 unix-cron 형식으로 정의하는 시간 간격을 지정합니다.
예를 들어 워크플로가 5분마다 실행되도록 예약하려면 */5 * * * *를 입력합니다.
시간대 사용자가 제공한 일정을 해석하기 위해 Cloud Scheduler에서 사용되는 시간대를 선택합니다. 국가를 기준으로 검색할 수 있습니다.
계속을 클릭합니다.
실행을 구성합니다.
워크플로의 인수 필드에서 실행하기 전에 워크플로에 전달할 런타임 인수를 지정합니다. 인수는 JSON 형식이어야 합니다. 예를 들면 {"firstName":"Sherlock", "lastName":"Holmes"}입니다.
워크플로에 런타임 인수가 사용되지 않으면 기본값 {}를 사용하거나 필드를 비워 둡니다.
워크플로의 호출 로그 수준 목록에서 워크플로 실행 중에 적용할 호출 로깅 수준을 선택합니다.
지정되지 않음: 로깅 수준이 지정되지 않았습니다. 이 항목이 기본값입니다.
실행 로그 수준이 지정되지 않은(기본값) 한 실행 로그 수준이 워크플로 로그 수준보다 우선합니다. 이 경우 워크플로 로그 수준이 적용됩니다.
오류만: 포착된 모든 예외 또는 예외로 인해 호출이 중지된 경우를 로깅합니다.
모든 호출: 하위 워크플로 또는 라이브러리 함수에 대한 모든 호출과 결과를 로깅합니다.
로그 없음: 호출 로깅이 없습니다.
서비스 계정 목록에서 이전에 만든 서비스 계정을 선택합니다.
만들기를 클릭합니다.
기존 워크플로를 업데이트하는 경우 워크플로를 다시 배포할 필요가 없습니다.
이제 Cloud Scheduler 작업이 워크플로 세부정보 페이지의 트리거 탭에 나열됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Schedule a workflow using Cloud Scheduler\n\nThis page shows you how to use [Cloud Scheduler](/scheduler/docs) to\nrun a workflow on a particular schedule, such as every Monday at 9 AM or every\n15 minutes. You can configure the schedule either in the Google Cloud console or by\nusing the Google Cloud CLI.\n\nBefore you begin\n----------------\n\n1. If you do not already have a workflow that you want to schedule, [create and deploy one](/workflows/docs/creating-updating-workflow#creating_a_workflow).\n2.\n\n\n Enable the Cloud Scheduler API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=cloudscheduler.googleapis.com)\nOr, in a terminal, enter the following command: \n\n```bash\ngcloud services enable cloudscheduler.googleapis.com\n```\n\nSchedule a workflow\n-------------------\n\n1. Create a [service account](/workflows/docs/authentication)\n so that Cloud Scheduler can make requests to the Workflows API:\n\n ```bash\n gcloud iam service-accounts create SERVICE_ACCOUNT_NAME\n ```\n\n Replace \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_NAME\u003c/var\u003e with a name that is between 6 and 30\n characters. It can contain lowercase alphanumeric characters and dashes.\n After you create a service account, you cannot change its name.\n2. To allow the principal that will run your Cloud Scheduler\n commands the ability to act as an Identity and Access Management (IAM) service\n account,\n [grant a role that allows the principal to impersonate the service account](/iam/docs/service-account-permissions#roles).\n\n3. Grant your new service account the\n [workflows.invoker](/workflows/docs/access-control#roles) role so that the\n account has permission to trigger your workflow:\n\n \u003cbr /\u003e\n\n ```bash\n gcloud projects add-iam-policy-binding PROJECT_ID \\\n --member serviceAccount:SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com \\\n --role roles/workflows.invoker\n ```\n\n \u003cbr /\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n - \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_NAME\u003c/var\u003e: the name of the service account that you previously created.\n4. Create a Cloud Scheduler job that triggers your workflow, using the\n service account you previously created to authenticate.\n\n Note that if you are applying\n [call logging](/workflows/docs/log-workflow#call_logging), you must configure\n call logging through the **Workflows** page in the\n Google Cloud console. For details, refer to the following steps. \n\n ### Console\n\n 1. To schedule a workflow, go to the **Workflows** page in the Google Cloud console:\n\n\n [Go to Workflows](https://console.cloud.google.com/workflows)\n\n \u003cbr /\u003e\n\n 2. On the Workflows page, select a workflow to go to its\n details page.\n\n 3. On the **Workflow details** page, click\n *edit* **Edit**.\n\n 4. On the **Edit workflow** page, select **Add new trigger \\\u003e\n Cloud Scheduler**.\n\n The **Create a Scheduler job** pane opens.\n 5. Define the schedule:\n\n 1. In the **Name** field, enter a name for your Cloud Scheduler\n job. It must be unique across the jobs in the same region.\n\n 2. In the **Region** list, select an appropriate\n [region](/workflows/docs/locations); for example, **us-central1**.\n\n 3. In the **Frequency** field, specify a time interval that you define\n in a [unix-cron](/scheduler/docs/configuring/cron-job-schedules) format.\n For example, to schedule your workflow to execute every 5 minutes, type\n `*/5 * * * *`.\n\n 4. In the **Timezone** list, select the [time zone](/sdk/gcloud/reference/scheduler/jobs/create/http#--time-zone)\n that Cloud Scheduler should use to interpret the schedule you\n provide. You can search by country.\n\n 6. Click **Continue**.\n\n 7. Configure the execution:\n\n 1. In the **Workflow's argument** field, specify any [runtime arguments](/workflows/docs/passing-runtime-arguments)\n to pass to your workflow before execution. Arguments must be in JSON\n format. For example:\n `{\"firstName\":\"Sherlock\", \"lastName\":\"Holmes\"}`.\n If your workflow doesn't use runtime arguments, accept the default of\n `{}`, or leave the field blank.\n\n 2. In the **Workflow's call log level** list, select the level of\n [call logging](/workflows/docs/log-workflow#call_logging)\n that you want to apply during the execution of the workflow:\n\n - **Not specified**: no logging level is specified. This is the default. An execution log level takes precedence over any workflow log level, unless the execution log level is not specified (the default); in that case, the workflow log level applies.\n - **Errors only**: log all caught exceptions; or when a call is stopped due to an exception.\n - **All calls**: log all calls to subworkflows or library functions and their results.\n - **No logs**: no call logging.\n 3. In the **Service account** list, select the service account that\n you previously created.\n\n 8. Click **Create**.\n\n Note that if you are updating an existing workflow, you do *not* need\n to redeploy the workflow.\n\n The Cloud Scheduler job is now listed on the **Triggers**\n tab of the **Workflow details** page.\n 9. If you want to update or delete the job, you must edit the workflow:\n\n 1. On the **Workflow details** page, click *edit* **Edit**.\n 2. In the **Triggers** section, find the job you want to update or delete.\n 3. Click *edit* **Edit resource** or *delete* **Delete resource**.\n\n ### gcloud\n\n 1. Open a terminal and enter the following command:\n\n ```bash\n gcloud scheduler jobs create http JOB_NAME \\\n --schedule=\"\u003cvar translate=\"no\"\u003eFREQUENCY\u003c/var\u003e\" \\\n --uri=\"https://workflowexecutions.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/locations/\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e/workflows/\u003cvar translate=\"no\"\u003eWORKFLOW_NAME\u003c/var\u003e/executions\" \\\n --message-body=\"{\\\"argument\\\": \\\"\u003cvar translate=\"no\"\u003eDOUBLE_ESCAPED_JSON_STRING\u003c/var\u003e\\\"}\" \\\n --time-zone=\"\u003cvar translate=\"no\"\u003eTIME_ZONE\u003c/var\u003e\" \\\n --oauth-service-account-email=\"\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_NAME\u003c/var\u003e@\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e.iam.gserviceaccount.com\"\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eJOB_NAME\u003c/var\u003e: the name you are giving to your Cloud Scheduler job.\n - \u003cvar translate=\"no\"\u003eFREQUENCY\u003c/var\u003e: a time interval you define using a [unix-cron](/scheduler/docs/configuring/cron-job-schedules) format. For example, to schedule your workflow to execute every 5 minutes, type `*/5 * * * *`.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n - \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e: the region your Workflow is in, such as `us-central1`.\n - \u003cvar translate=\"no\"\u003eWORKFLOW_NAME\u003c/var\u003e: the name of the workflow you want to schedule execution of.\n - \u003cvar translate=\"no\"\u003eDOUBLE_ESCAPED_JSON_STRING\u003c/var\u003e: a JSON encoding of any arguments you are passing. The double quotation marks inside the quoted string are escaped using backslashes (\\\\). For example: `--message-body=\"{\\\"argument\\\": \\\"{\\\\\\\"foo\\\\\\\": \\\\\\\"bar\\\\\\\"}\\\"}\"`\n - \u003cvar translate=\"no\"\u003eTIME_ZONE\u003c/var\u003e: the [time zone](/sdk/gcloud/reference/scheduler/jobs/create/http#--time-zone) that Cloud Scheduler should use to interpret the schedule you provide. For example: `America/New_York`.\n - \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_NAME\u003c/var\u003e: the name of the service account that you previously created.\n 2. To list all jobs in a project:\n\n ```bash\n gcloud scheduler jobs list\n ```\n\n \u003cbr /\u003e\n\n 3. To delete a job:\n\n ```bash\n gcloud scheduler jobs delete JOB_NAME\n ```\n\n \u003cbr /\u003e\n\nYour workflow now executes according to the frequency you have defined.\n| **Note:** Each execution of a workflow incurs costs, as detailed in [Workflows pricing](/workflows/pricing). To stop incurring costs from a scheduled workflow, [delete the Cloud Scheduler job](/sdk/gcloud/reference/scheduler/jobs/delete).\n\nWhat's next\n-----------\n\n- [Use IAM to control access](/workflows/docs/use-iam-for-access)\n- [Pass runtime arguments in an execution request](/workflows/docs/passing-runtime-arguments)\n- [Tutorial: Schedule Workflows with Cloud Scheduler](/scheduler/docs/tut-workflows)"]]