Read the current
Forward guide before implementing a Worker. It defines how Gateway invokes Workers on permitted HTTP traffic. Retrieve the relevant page below rather than copying setup, API payloads, or limits into the project from memory.
Use the published types and context reference for field names and availability. Treat a falsy identity (
) as anonymous and guard optional posture values. Call
or
await context.devicePosture()
only when needed. Both getters can reject. Catch lookup failures separately from missing values and decide how to handle each when the Worker depends on them. Use Gateway-provided identity rather than client-supplied identity headers.
Type-check against the installed Gateway types and test the named RPC entrypoint, including zero or one continuation call and the context values the Worker uses. Then test a permitted request through a scoped Gateway Forward policy. A direct request to a default
handler does not validate the Gateway path. Follow the chosen template's test procedure and the Forward guide's troubleshooting steps.
Check the
response and streaming rules: return a final status from
to
, return no body for HEAD requests or statuses
,
, and
, and stream bodies rather than buffering them.