Skip to main content
Use .effect(...) when a procedure implementation should run as an Effect. Handlers can be generator callbacks, Effect.fn(...) callbacks, or functions that return an Effect.
effect-procedure.ts
The handler receives the normal oRPC handler options, including input, context, errors, path, signal, and metadata.

Handler shape

handler-options.ts

Effect-returning handlers

Use a plain Effect-returning callback when you already have an Effect value, or when you want to keep a named Effect.fn(...) span inside the automatic procedure span.
effect-returning.ts

Mix with standard oRPC handlers

You can put standard oRPC procedures and Effect procedures in the same router.
mixed-router.ts
Use .handler(...) for plain synchronous or async procedures. Use .effect(...) when the handler needs Effect services, typed Effect failures, tracing, or fiber context.

Next steps

Last modified on June 15, 2026