Updated on 2025-08-19 GMT+08:00

Overview

Introduction

Triggers are key mechanisms in FunctionGraph for initiating function execution. When other cloud services detect specific events as event sources, triggers automatically invoke the associated function based on predefined rules, enabling real-time event processing. For supported trigger events, see Supported Trigger Events.

When events reach the function, they contain only event data relevant to that trigger. This structured JSON data is converted by FunctionGraph into objects usable by the function. A single function can be configured with one or multiple triggers according to service needs. Each trigger can independently invoke the function.

Function Trigger Invocation Mode

Triggers can be invoked synchronously or asynchronously. For details about function invocation, see Invoking the Function.

  • Synchronous invocation: After a client invokes a function, FunctionGraph executes the function immediately and returns a response and execution result to the client.
  • Asynchronous invocation: After a client invokes a function, FunctionGraph queues the requests and directly returns responses to the client without waiting for the function execution result. FunctionGraph processes the queued requests one by one when the server is idle.
Table 1 Function trigger invocation

Trigger

Invocation Mode

API Gateway (dedicated)

Synchronous. You can change it to asynchronous. For details, see Configuring Asynchronous Invocation.

API Connect (APIC)

Synchronous. You can change it to asynchronous. For details, see Configuring Asynchronous Invocation.

Timer

Synchronous (default and cannot be changed)

Cloud Trace Service (CTS)

Asynchronous (default and cannot be changed)

Document Database Service (DDS)

Asynchronous (default and cannot be changed)

Data Ingestion Service (DIS)

Asynchronous (default and cannot be changed)

DMS (for Kafka)

Asynchronous (default and cannot be changed)

Kafka (Open-Source)

Asynchronous (default and cannot be changed)

DMS (for RabbitMQ)

Asynchronous (default and cannot be changed)

GeminiDB Mongo

Asynchronous (default and cannot be changed)

Log Tank Service (LTS)

Asynchronous (default and cannot be changed)

Simple Message Notification (SMN)

Asynchronous (default and cannot be changed)

EventGrid (EG)

Asynchronous (default and cannot be changed)

Supported Trigger Events

Table 2 lists the supported cloud services and trigger events for FunctionGraph. After an event source trigger is configured, the corresponding function is automatically invoked when an event is detected.

Table 2 Cloud service events supported by FunctionGraph

Cloud Service/Feature

Trigger Event

Timer

You can schedule a timer (timer example event) to invoke function code based on a fixed rate of minutes, hours, or days or a cron expression.

For details, see Using a Timer Trigger.

APIG

FunctionGraph functions are invoked over HTTP or HTTPS by defining REST APIs and endpoints on APIG. You can map each API operation (such as, GET and PUT) to a specific function. APIG invokes the relevant function when an HTTPS request (APIG example event) is sent to the API endpoint.

For details, see Using an APIG (Dedicated) Trigger.

APIC

With API operations such as GET and PUT mapped to specific functions, APIC can invoke corresponding functions to perform operations when receiving relevant HTTPS or HTTP requests.

For details, see Using an APIC Trigger.

DIS

DIS can ingest large amounts of data in real time. You can create a function to automatically poll a DIS stream and process all new data records, such as website click streams, financial transactions, social media streams, IT logs, and data tracking events (DIS example event). FunctionGraph periodically polls the stream for new data records.

For details, see Using a DIS Trigger.

DMS for Kafka

When a message is created in a Kafka topic, FunctionGraph consumes the message and triggers the function to perform other operations (Kafka example event)).

For details about how to use Kafka triggers, see:

DMS for RabbitMQ

When a DMS for RabbitMQ trigger is used, FunctionGraph periodically polls for new messages in a specific topic bound to the exchange of a RabbitMQ instance and passes the messages as input parameters to invoke functions (RabbitMQ example event).

For details, see Using a DMS (for RabbitMQ) Trigger.

GeminiDB Mongo

If you create a GeminiDB Mongo trigger for a function, any updates (GeminiDB Mongo example event) to the specified database table will trigger the function.

For details about how to use GeminiDB Mongo triggers, see Using a GeminiDB Mongo Trigger.

IoTDA

FunctionGraph can use IoTDA trigger to track device properties, message reporting, and status changes as well as analyze, sort out, and measure data flows (IoTDA example event).

For details, see Using an IoTDA Trigger.

SMN

Simple Message Notification (SMN) sends messages to email addresses, mobile phones, or HTTP/HTTPS URLs. If you create a function with an SMN trigger, messages published to a specified topic will be passed as a parameter (SMN example event) to invoke the function. Then, the function processes the event, for example, publishing messages to other SMN topics or sending them to other cloud services.

For details, see Using an SMN Trigger.

OBS

Create a function for processing OBS events, such as object creation or deletion (OBS example events). When an image is uploaded to a specified bucket, OBS invokes the function to read the image and create a thumbnail.

For details, see:

EG

EventGrid (EG) receives messages from event sources and passes the message payload as a parameter (EG example event) to invoke a function. Then, the function processes the events, for example, sending messages to other cloud services.

EventGrid supports the following event sources:

Trigger Event Examples