This document describes the trigger types available in Cloud Functions and how to set them up.
Trigger is an event source to execute functions. Cloud Functions provide various triggers to allow you to call functions in multiple ways.
| Types | Descriptions | Built-in |
|---|---|---|
| HTTP | Execute a function via an HTTP request | Yes |
| Timer | Execute a function at a specified time or interval | No |
| API Gateway | Execute a function via API Gateway | No |
HTTP trigger is built-in when creating a function, and you can execute the function with an HTTP request.
https://{userdomain}/{function name}
curl -X GET "https://{userdomain}/{function name}?param1=value1¶m2=value2"
curl -X POST "https://{userdomain}/{function name}" \
-H "Content-Type: application/json" \
-d '{"key": "value"}'
[Note]
If you send a request with a disabled HTTP trigger, the function will not execute.
Timer trigger executes a function automatically at the specified time or cycle. You can set up the cycle by using the Cron expression.

Cron expression follows the format as below:
* * * * * *
│ │ │ │ │ │
│ │ │ │ │ └─ Day of week (0-6 or SUN-SAT, 0: sunday)
│ │ │ │ └─── Month (1-12 or JAN-DEC)
│ │ │ └───── Day of month (1-31)
│ │ └─────── hour (0-23)
│ └───────── minute (0-59)
└─────────── second (0-59)
| Field | Required | Allowed vale | Allowed special character |
|---|---|---|---|
| Seconds | Yes | 0-59 | * / , - |
| Minutes | Yes | 0-59 | * / , - |
| Hours | Yes | 0-23 | * / , - |
| Day of month | Yes | 1-31 | * / , - ? |
| Month | Yes | 1-12 or JAN-DEC | * / , - |
| Day of week | Yes | 0-6 or SUN-SAT | * / , - ? |
*
Indicate that all values in the field match. For example, using * in the 5th field (month) means all months.
/
Used to indicate the increment of a range. For example, using 3-59/15 in the 2nd field (minutes) means it will execute every 15 minutes starting at 3 minutes (3, 18, 33, and 48 minutes). For */... format, it matches first-last/... format and indicates that the increment for the largest range of the field. For N/... format, it indicates N-MAX/..., using increments starting from N to the end of the range. Once you go beyond the range, you won't go back to the beginning.
,
Used to separate items in a list. For example, using MON,WED,FRI in the 6th field (day of the week) means Monday, Wednesday, and Friday.
-
Used to define scope. For example, using 9-17 in the third field (hours) means all hours from 9 AM to 5 PM (inclusive).
?
You can use * instead of leaving the Day of month or Day of week field blank.
| Cron Expression | Description |
|---|---|
0 * * * * * |
Execute every minute (at 0 seconds) |
0 0 * * * * |
Execute every hour on the hour |
0 0 0 * * * |
Execute every midnight |
0 0 9 * * MON |
Execute every Monday at 9:00 AM |
0 0 0 1 * * |
Execute every 1st of every month at midnight |
0 */5 * * * * |
Execute every 5 minutes |
0 0 9-18 * * MON-FRI |
Execute every hour from 9:00 AM to 6:00 PM on weekdays (Mon-Fri) |
30 0 12 * * * |
Execute every day at 12:00:30 PM |
0 0 0 1 JAN * |
Execute every January 1st at midnight |

[Note]
The Month and Day of week field values are case-insensitive. "SUN", "Sun", "sun" are all recognized equally.
API Gateway triggers can execute functions by leveraging the API Gateway service in the same project. API Gateway enables more detailed API management and control.

https://{stageurl}/{path}
curl -X GET "https://{stageurl}/{path}?param1=value1¶m2=value2"
curl -X POST "https://{stageurl}/{path}" \
-H "Content-Type: application/json" \
-d '{"key": "value"}'

[Note]
Modifying an API Gateway trigger involves deleting the existing trigger within the API Gateway service and then creating a new one.
It results in deleting all plugins applied to the corresponding resource.
If you want to change the resource path to which the plugin is applied, we recommend adding a new trigger instead of modifying it.
Once you create an API Gateway trigger, you can configure additional settings in the API Gateway console.
For more details, please refer to the API Gateway Guide.
