Skip to main content
Functions are the core building blocks of III applications. They can be called by other services, triggered by events, or exposed as HTTP endpoints.

registerFunction()

Register a function with a handler that executes when the function is invoked.
RegisterFunctionMessage
required
Function registration metadata
RemoteFunctionHandler<TInput, TOutput>
required
Async function that processes the input and returns output
FunctionRef
Reference to the registered function

Example: Basic Function

Example: Typed Function with Validation

registerHttpFunction()

Register an external HTTP function (Lambda, Cloudflare Worker, etc.) that the engine invokes via HTTP.
string
required
Function ID/path
HttpInvocationConfig
required
HTTP endpoint configuration
FunctionRef
Reference to the registered HTTP function

Example: Lambda Function

Example: Cloudflare Worker

Function Handler Context

All function handlers have access to a context object via getContext():
See Context API for full documentation.

Error Handling

Throw errors in function handlers to propagate them to callers:

Unregistering Functions

Unregister functions when they’re no longer needed:

Best Practices

Group related functions using :: separator: