Connecting trigger and action
- Print
- PDF
Connecting trigger and action
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Available in Classic and VPC
An example that may help with understanding connection method between trigger and action is introduced. This example creates a trigger that updates the user's location, and calls the hello
action when the user's location is updated. Refer to the following guide when learning the example.
- How to create actions
- Using Cloud Functions > Action > Basic action
- Using Cloud Functions > Action > Sequence action
- How to create triggers
- Using Cloud Functions > Trigger > Trigger
- How to run action or trigger
- Using Cloud Functions > Running action or trigger
Connecting trigger and action
The sequence for creating a trigger and action, and then connecting them is as follows.
- Create a basic trigger under the name
SampleTrigger
on the console.
- Create a source code that gets a name and place and prints them.
function main(params) { return {payload: 'Hello, ' + params.name + ' from ' + params.place}; }
- Use the source code created in Step 2 and create an action on the console.
- Connect it to the trigger created in Step 1 in the last step of creating the action.
- The trigger and action are enabled as soon as linked, so the response is immediately returned upon calling the trigger.
Check normal operation through trigger execution
You can check whether the trigger and action are successfully created and connected through executing the trigger. The checking sequence is as follows.
- Run the
SampleTrigger
trigger on the console.
- The
helloAction
action works with an event parameter every time a trigger is called. - The application priority of a trigger default parameter takes precedence over that of an action default parameter.
- You will receive ActivationId as the execution result.
- The
- Check the execution result details in the Monitoring tab menu page of the trigger and action.
- Trigger execution result
- Action execution result: Check information for the activation that occurred most recently for whether the action was run, and then check if the action run by the trigger processes parameters normally.
{ "payload": "Hello, Donald in Washington, D.C." }
- Trigger execution result
Was this article helpful?