Skip to content

Commit 64c0f6c

Browse files
authored
Update outbound-workers.mdx
Add note about required Outbound Worker parameters
1 parent 3ea68e6 commit 64c0f6c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/content/docs/cloudflare-for-platforms/workers-for-platforms/configuration/outbound-workers.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ export default {
8181
}
8282
```
8383

84+
:::note
85+
86+
When you define parameters for an Outbound Worker in your Wrangler file, you must provide a corresponding outbound object with those parameters in your `dispatcher.get()` call. If the outbound object or its parameters are missing, your User Worker will not run and an error will be returned.
87+
88+
:::
89+
90+
8491
4. The Outbound Worker will now be invoked on any `fetch()` requests from a user Worker. The user Worker will trigger a [FetchEvent](/workers/runtime-apis/handlers/fetch/) on the Outbound Worker. The variables declared in the binding can be accessed in the Outbound Worker through `env.<VAR_NAME>`.
8592

8693
The following is an example of an Outbound Worker that logs the fetch request from user Worker and creates a JWT if the fetch request matches `api.example.com`.

0 commit comments

Comments
 (0)