Functions can be invoked synchronously or asynchronously. In asynchronous mode, FunctionGraph sends a response immediately after persisting a request. The request result cannot be known in real time. To retry when an asynchronous request fails or obtain asynchronous processing results, configure asynchronous settings.


Parameter |
Description |
|---|---|
Asynchronous Execution Notification Policy |
|
Success Notification |
Target Service: to which a notification will be sent if a function is executed successfully.
|
Failure Notification |
Target Service: to which a notification will be sent if a function fails to be executed.
|
For details about how to set the target for asynchronous invocation, see Table 2. The following shows an example:
{
"timestamp": "2020-08-20T12:00:00.000Z+08:00",
"request_context": {
"request_id": "1167bf8c-87b0-43ab-8f5f-26b16c64f252",
"function_urn": "urn:fss:xx-xxxx-x:xxxxxxx:function:xxxx:xxxx:latest",
"condition": "",
"approximate_invoke_count": 0
},
"request_payload": "",
"response_context": {
"status_code": 200,
"function_error": ""
},
"response_payload": "hello world!"
}
Parameter |
Description |
|---|---|
timestamp |
Time when the invocation starts. |
request_context |
Request context. |
request_context.request_id |
ID of an asynchronous invocation request. |
request_context. function_urn |
URN of the function that is to be executed asynchronously. |
request_context.condition |
Invocation error type. |
request_context. approximate_invoke_count |
Number of asynchronous invocation times. If the value is greater than 1, function execution has been retried. |
request_payload |
Original request payload. |
response_context |
Response context. |
response_context.statusCode |
Code returned after function invocation. If the code is not 200, a system error occurred. |
response_context.function_error |
Invocation error information. |
response_payload |
Payload returned after function execution. |