Skip to main content

Request

Invoke a function that has been registered with the framework.

Response

The framework responds with an InvocationResult message.
string
Message type. Will be "invocationresult".
string
required
UUID that identifies this invocation. Matches the request’s invocation_id if provided.
string
required
The ID of the function that was invoked.
any
The successful result from the function. Omitted if the invocation failed.
object
Error details if the invocation failed. Omitted if successful.
string
W3C trace-context traceparent header, propagated from the request or generated.
string
W3C baggage header, propagated from the request.

Examples

Basic Function Invocation

Request:
Success Response:

Invocation with Custom ID

Request:
Success Response:

Invocation with Distributed Tracing

Request:
Success Response:

Error Cases

Function Not Found

Request:
Error Response:

Execution Error

Request:
Error Response:

Timeout Error

Error Response:

Notes

  • The invocation_id is used to correlate requests with responses
  • If no invocation_id is provided, one will be generated automatically
  • The result and error fields are mutually exclusive - only one will be present
  • For HTTP-based functions, the HTTP response body is returned as the result
  • For WebSocket-based functions, the worker must send an InvocationResult message
  • Distributed tracing headers follow the W3C Trace Context specification