Available in Classic and VPC
Here is an example to help you understand how to add triggers that run actions. This example creates a trigger that updates user location and calls the hello action when the user location is updated. For learning this example, see the following guides:
- How to create an action
- Cloud Functions > Action > Create action
Create action
- Write source code that receives and outputs name and location.
function main(params) {
return {payload: 'Hello, ' + params.name + ' from ' + params.place};
}
- Create an action in the console using the source code written in step 1.

Add trigger
You can add a trigger that runs actions as follows:
- Go to action details by selecting the action named helloAction created in the console.

- Click [Add] in the trigger section.
- Select Create new for connection method and select API Gateway for type.

- Configure settings to create API Gateway endpoint that will call the action through API Gateway.

Check run results
You can run the trigger and check if the action runs properly. To check, take the following steps:
- Run the action by calling the API Gateway endpoint. For detailed run methods, see Run trigger in API Gateway trigger.
curl -X POST -H "Content-Type: application/json" https://func.apigw.ntruss.com/api/v1/hello?blocking=true&result=true -d '{"name": "Cloud Functions", "place": "NAVER Cloud"}'
- Check detailed information about run results in the Monitoring tab menu of the action details screen. Check if the action ran by viewing the most recent activation information and verify that the action triggered processes parameters correctly.
