You need to enable JavaScript to run this app.
Volcano Engine Function as a Service

Volcano Engine Function as a Service

Copy page
Download PDF
Trigger management
Trigger event message structure
Copy page
Download PDF
Trigger event message structure
Triggers pass message data in JSON format as the event input parameter to your function. This triggers function execution. The message data structure varies based on different triggers. This topic describes the event message structures for all triggers that are integrated with veFaaS.​
tip​
  • The event parameter may slightly differ based on the runtime language. The actual result shall prevail.​
  • The event parameter for the Golang runtime has been defined and can be obtained and used from the Golang event definition.​
Timer trigger​
The structure of the Timer trigger event message is as follows:​
​
// Sample event​
{​
"id": "9cab1030-dccf-4b61-ae07-542bffef****",​
"source": "/faas/event/timer/{timer_id}",​
"specversion": "1.0",​
"time": "2022-11-22T04:28:07.945838513Z",​
"type": "faas.timer.event"​
"datacontenttype": "application/octet-stream",​
"data": "Hello Volcengine",​
​
}​
​
​
Parameter​
Type​
Description​
id​
string​
cloudevent field: request id. Each request has a unique id.​
source​
string​
cloudevent field: For Timer triggers, the value is /faas/event/timer/{timer_id}.​
specversion​
string​
cloudevent field: cloudevent version.​
time​
string​
The time when the message is triggered, which is in the ISO 8601 format.​
type​
string​
cloudevent field: the event type. For Timer triggers, the value is faas.timer.event.​
datacontenttype​
string​
cloudevent field: message type. The value is always application/octet-stream.​
data​
string​
The message content.​
​
APIG trigger​
The structure of the APIG trigger event message is as follows:​
​
// Sample event​
{​
"httpMethod": "GET",​
"path": "/",​
"pathParameters": {​
"path": "value"​
},​
"queryStringParameters": {​
"foo": "bar"​
},​
"headers": {​
"Host": "10.243.***.***:9001",​
"User-Agent": "curl/7.79.1",​
"Accept": "*/*",​
"Accept-Encoding": "gzip",​
"X-Faas-Request-Id": "b7e5ac05-cf6a-466a-86d4-093b24c3****"​
},​
"body": "{\"hello\": \"veFaaS\"}"​
}​
​
​
Parameter​
Description​
httpMethod​
The HTTP request method, including POST, GET, PUT, DELETE, HEAD, and OPTIONS.​
path​
The HTTP request path.​
pathParameters​
The parameters of the HTTP request path.​
queryStringParameters​
The query parameters of the HTTP request path.​
headers​
The HTTP request header. For the descriptions of sub-parameters, see the following headers parameter descriptions.​
body​
The HTTP request payload.​
​
The headers parameters are described as follows:​
​
Parameter​
Description​
Host​
The address of the function instance, which is in the format of instance IP:port.​
User-Agent​
The browser identifier string.​
Accept​
The file types acceptable to the browser.​
Accept-Encoding​
The encoding methods acceptable to the browser.​
X-Faas-Request-Id​
The unique identifier of the function request.​
​
For Kafka triggers​
The structure of the Kafka trigger event message is as follows:​
​
// Sample event​
{​
"id": "cb57fdb4-1c12-490d-b556-b8c70054****", ​
"source": "/faas/event/kafka/{trigger_id}", ​
"type": "faas.kafka.event", ​
"specversion": "1.0", ​
​
"datacontenttype": "application/octet-stream", ​
"time": "2022-04-26T08:55:36.723908863Z", ​
"data": "user data", ​
​
"extensions": {​
"topic": "test_topic", ​
"partition": "9", ​
"consumergroup": "test_topic_xw****", ​
"offset": "34", ​
​
"key": "" ​
}​
}​
​
​
Parameter​
Type​
Description​
id​
string​
cloudevent field: request id. Each request has a unique id.​
source​
string​
cloudevent field: For Kafka triggers, the value is /faas/event/kafka/{trigger_id}.​
type​
string​
cloudevent field: event type. For Kafka triggers, the value is faas.kafka.event.​
specversion​
string​
cloudevent field: cloudevent version.​
datacontenttype​
string​
cloudevent field: message type. The value is always application/octet-stream.​
time​
string​
The time when the message is triggered, which is in the ISO 8601 format.​
data​
string​
The message content.​
extensions​
-​
The extension information of the event. For the descriptions of sub-parameters, see the following extensions parameter descriptions.​
​
The extensions parameters are described as follows:​
​
Parameter​
Type​
Description​
topic​
string​
The Topic of the message source.​
partition​
string​
The partition of the message source.​
consumergroup​
string​
The consumer group of the message source.​
offset​
string​
The consumer offset.​
key​
string​
The message key.​
​
BMQ trigger​
The structure of the BMQ trigger event message is as follows:​
​
// Sample event​
{​
"id": "cb57fdb4-1c12-490d-b556-b8c70054****", ​
"source": "/faas/event/bmq/{trigger_id}", ​
"type": "faas.bmq.event", ​
"specversion": "1.0", ​
​
"datacontenttype": "application/octet-stream", ​
"time": "2022-04-26T08:55:36.723908863Z", ​
"data": "user data", ​
​
"extensions": {​
"topic": "test_topic", ​
"partition": "9", ​
"consumergroup": "test_topic_xw****", ​
"offset": "34", ​
​
"key": "" ​
}​
}​
​
​
Parameter​
Type​
Description​
id​
string​
cloudevent field: request id. Each request has a unique id.​
source​
string​
cloudevent field: For BMQ triggers, the value is /faas/event/bmq/{trigger_id}.​
type​
string​
cloudevent field: event type. For BMQ triggers, the value is faas.bmq.event.​
specversion​
string​
cloudevent field: cloudevent version.​
datacontenttype​
string​
cloudevent field: message type. The value is always application/octet-stream.​
time​
string​
The time when the message is triggered, which is in the ISO 8601 format.​
data​
string​
The message content.​
extensions​
-​
The extension information of the event. For the descriptions of sub-parameters, see the following extensions parameter descriptions.​
​
The extensions parameters are described as follows:​
​
Parameter​
Type​
Description​
topic​
string​
The Topic of the message source.​
partition​
string​
The partition of the message source.​
consumergroup​
string​
The consumer group of the message source.​
offset​
string​
The consumer offset.​
key​
string​
The message key.​
​
RocketMQ trigger​
The structure of the RocketMQ trigger event message is as follows:​
​
// Sample event​
{​
"id":"2372345f-950e-432f-b6bf-6293dd36****",​
"source":"/faas/event/rocketmq/{trigger_id}",​
"type":"faas.rocketmq.event",​
"specversion":"1.0",​
​
"datacontenttype":"application/octet-stream",​
"time":"2022-10-10T03:13:47.085293242Z",​
"data":"DATA SENT BY THE PRODUCER", ​
​
"extensions":{​
"topic":"MQ_INST_85bcoh8hirzg_****%topic-zero", // [instance-id]%[topic-name]​
"queueid":"6",​
"consumergroup":"MQ_INST_85bcoh8hirzg_****%GID_group_3", // [instance-id]%[group-name]​
"offset":"18183",​
​
"msgid":"0A41C2EB12F50000000030c216100006", ​
"tags": "abc" ​
}​
}​
​
​
Parameter​
Type​
Description​
id​
string​
cloudevent field: request id. Each request has a unique id.​
source​
string​
CloudEvent field: For RocketMQ triggers, the value is /faas/event/rocketmq/{trigger_id}.​
type​
string​
cloudevent field: event type. For RocketMQ triggers, the value is faas.rocketmq.event.​
specversion​
string​
cloudevent field: cloudevent version.​
datacontenttype​
string​
cloudevent field: message type. The value is always application/octet-stream.​
time​
string​
The time when the message is triggered, which is in the ISO 8601 format.​
data​
string​
The message content.​
extensions​
-​
The extension information of the event. For the descriptions of sub-parameters, see the following extensions parameter descriptions.​
​
The extensions parameters are described as follows:​
​
Parameter​
Type​
Description​
topic​
string​
The Topic of the message source.​
queueid​
string​
The queue id of the message source.​
consumergroup​
string​
The consumer group of the message source.​
offset​
string​
The consumer offset.​
msgid​
string​
The message id.​
tags​
string​
The message tags.​
​
TOS trigger​
The structure of the TOS trigger event message is as follows:​
​
//Sample event​
{​
"specversion":"1.0",​
"id":"1124807578fd9936307578f-ac17****",​
"source":"/faas/event/tos/{bucket_name}",​
"type":"faas.tos.event",​
"datacontenttype":"application/octet-stream",​
"time":"2022-08-25T11:06:29.043768218Z",​
"data":{​
"events":[​
{​
"eventName":"tos:ObjectCreated:Put",​
"eventSource":"tos",​
"eventTime":"2022-08-25T11:05:51Z",​
"eventVersion":"1.0",​
"tos":{​
"bucket":{​
"trn":"trn:tos:::test",​
"name":"test",​
"ownerIdentify":"200000****"​
},​
"object":{​
"eTag":"cd163b393cf54d961f9959842ff1****",​
"key":"build.sh",​
"size":188,​
"versionId":"57CE0809CDADB97E****"​
},​
"tosSchemaVersion":"1.0",​
"ruleId":"303436663662383932300ee348075767****",​
"region":"cn-beijing",​
"requestParameters":{​
"sourceIPAddress":"192.160.**.***:*****"​
},​
"responseElements":{​
"requestId":"1124807578fd9936307578f-ac17****"​
},​
"userIdentity":{​
"principalId":"trn:iam::200000****:root"​
}​
}​
}​
]​
}​
}​
​
​
Parameter​
Type​
Description​
specversion​
string​
cloudevent field: cloudevent version.​
id​
string​
cloudevent field: request id. Each request has a unique id.​
source​
string​
cloudevent field: For TOS triggers, the value is /faas/event/tos/{bucket_name}.​
type​
string​
cloudevent field: event type. For TOS triggers, the value is faas.tos.event.​
datacontenttype​
string​
cloudevent field: message type. The value is always application/octet-stream.​
time​
string​
The time when the message is triggered, which is in the ISO 8601 format.​
data​
string​
The specific content of the TOS event notification. For detailed descriptions, see TOS events.​
​
TLS trigger​
The structure of the TLS trigger event message is as follows:​
​
// Sample event​
{​
'id': 'f42307b3-5cd6-4d92-9dc7-b4559175****', ​
'source': '/faas/event/tls/4o3f****', ​
'type': 'faas.tls.event', ​
'specversion': '1.0', ​
​
'datacontenttype': 'application/octet-stream', ​
'time': '2024-07-09T15:41:01.977924767Z', ​
'data': {​
'__path__': '/var/log/emlmsobj/0.log', ​
'__source__': '192.**.**.**', ​
'__tag____client_ip__': '192.**.**.**', ​
'__tag____receive_time__': '1720539661666', ​
'content': '[FaaS System] Stopping function...', ​
'function_id': 'emlm****', ​
'function_name': 'TLSProducer2', ​
'log_type': 'stdout', ​
'pod_name': 'emlmsobj-v2nv5z3yv9-69b9bb7487-*****', ​
'revision_number': '1', ​
'timestamp': '2024-07-09T15:41:00.086897178Z'​
}, ​
​
'extensions': {​
'consumergroup': 'tls-trigger-consume-2_4o3fw1qf', ​
'key': '', ​
'maxretrynum': '3', ​
'offset': '43', ​
'partition': '0', ​
'retriesforbadstatusrequests': '0', ​
'topic': 'out-ba109ccd-7edc-4a6d-9095-8cdcb1f0****'​
},​
}​
​
​
Parameter​
Type​
Description​
id​
string​
cloudevent field: request id. Each request has a unique id.​
source​
string​
cloudevent field: For TLS triggers, the value is /faas/event/tls/{trigger_id}.​
type​
string​
cloudevent field: event type. For TLS triggers, the value is faas.tls.event.​
specversion​
string​
cloudevent field: cloudevent version.​
datacontenttype​
string​
cloudevent field: message type. The value is always application/octet-stream.​
time​
string​
The time when the message is triggered, which is in the ISO 8601 format.​
data​
json​
The TLS log message content. Among them, __path__, __source__, __tag____client_ip__, and __tag____receive_time__ are TLS fields. Others are user-defined fields in the output log.​
extensions​
json​
The extension information of the event. For the descriptions of sub-parameters, see the following extensions parameter descriptions.​
​
The extensions parameters are described as follows:​
​
Parameter​
Type​
Description​
topic​
string​
The Topic of the message source.​
partition​
string​
The partition of the message source.​
consumergroup​
string​
The consumer group of the message source.​
offset​
string​
The consumer offset.​
key​
string​
The message key.​
retriesforbadstatusrequests​
string​
The number of retries for the message. n indicates the nth retry.​
maxretrynum​
string​
The maximum number of retries for the message.​
​
​
Last updated: 2026.08.19 14:06:06