This topic describes how to create a time trigger in the Function Compute console to trigger a function every 5 minutes.
Create a trigger
- Log on to the Function Compute console.
- In the top navigation bar, select a region.
- In the left-side navigation pane, click Service/Function.
- Locate the target function in the target service and click the function name.
- Click Triggers tab, and then click Create Trigger.
- Fulfill theCreate Trigger dialog box. and then click OK.
Parameter Action Example Trigger Type Select Time Trigger. Time trigger Trigger Name Enter a trigger name. my_trigger Version/Alias Enter the version of the trigger. Default value: LATEST. For more information, see Introduction to versions. LATEST Time Settings Select one of the following configuration modes as needed.
- Interval: Enter a positive integer n in this field. It indicates that the function will be triggered every n minutes.
- Cron Expression: Enter a Cron expression in this field to trigger the function at the specified time.
The standard Cron expression is in the following format: Seconds Minutes Hours Day-of-month
Note The Cron expression runs in Coordinated Universal Time (UTC). In other words, the time used in the Cron expression is the value obtained by subtracting 8 hours from the Beijing time.
Interval: 5 minutes Enable Trigger Turn on Enable Trigger. Turn on the switch Event Payload Enter custom parameters.
The Cron expression, Seconds Minutes Hours Day-of-month Month Day-of-week, is described as follows: