Help Center/ FunctionGraph/ User Guide/ Configuring Functions/ Configuring Triggers/ Simple Message Notification (SMN) Trigger
Updated on 2025-08-19 GMT+08:00

Simple Message Notification (SMN) Trigger

This section describes how to create an SMN trigger on the FunctionGraph console to trigger function execution when a message is published.

For details about the SMN event source, see Supported Event Sources.

Video Tutorial

This video shows how to use an SMN trigger to trigger a function execution.

Notes and Constraints

  • SMN triggers are supported in all regions except AP-Jakarta, ME-Riyadh, and AF-Johannesburg. You can check whether the trigger type is supported on the console.
  • SMN triggers cannot be disabled and can only be deleted.

Prerequisites

  • You have created a function.
  • You have created an SMN topic, for example, smn-test. For details, see Creating a Topic.

Creating an SMN Trigger

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Triggers and click Create Trigger.

    Figure 1 Creating a trigger

  4. Set the following parameters:

    • Trigger Type: Select Simple Message Notification (SMN).
    • Topic Name: Select a topic, for example, smn-test.

  5. Click OK.

    After the SMN trigger is created, a subscription is generated for the corresponding topic on the SMN console.

Publishing a Message to Trigger the Function

On the SMN console, publish a message to the smn-test topic. For details, see Publishing a Text Message. After the message is published, the function is automatically triggered.

Table 1 describes the parameters required for publishing a message.

Table 1 Parameters required for publishing a message

Parameter

Description

Subject

Enter SMN-Test.

Message Format

Select Text.

Message

Enter {"message":"hello"}.

Viewing the Execution Result

  1. Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click a function to go to the function details page.
  3. Choose Monitoring > Logs to query function running logs.

Helpful Links

Manage function triggers through APIs. For details, see Function Trigger APIs.