Skip to main content
III provides multiple ways to invoke functions, both synchronously (awaiting results) and asynchronously (fire-and-forget).

call()

Invoke a function and wait for the result.
string
required
ID of the function to invoke (e.g., 'users::create')
TInput
required
Input data to pass to the function
number
Optional timeout in milliseconds. Defaults to invocationTimeoutMs from init() options (120000ms / 2 minutes)
TOutput
The function’s return value

Example: Basic Call

Example: With Timeout

Example: Type-Safe Calls

callVoid()

Invoke a function asynchronously without waiting for a response (fire-and-forget).
string
required
ID of the function to invoke
TInput
required
Input data to pass to the function
callVoid() returns immediately and does not wait for the function to complete. Use this for background tasks, logging, notifications, etc.

Example: Fire-and-Forget

Example: Background Processing

trigger() / triggerVoid()

Aliases for call() and callVoid() for backward compatibility:

Error Handling

Function invocations can fail for various reasons. Always handle errors appropriately:

Common Error Messages

The function didn’t respond within the timeout period. Increase the timeout or optimize the function.
No worker has registered the requested function. Check the function ID and ensure the worker is connected.
The function threw an error. Check the error message for details.
The SDK is shutting down and all pending invocations are being rejected.

Distributed Tracing

All invocations automatically propagate W3C trace context for distributed tracing:
The trace context flows automatically:
  1. Service A starts a span
  2. Service A calls Service B
  3. Service B receives the trace context and creates a child span
  4. Both spans are linked in the distributed trace

Channel Passing

Pass channel references in invocation data for streaming:
See Channels API for details.

Performance Tips

Best Practices