Check below how to call an argument:
The first example (Code tab) depicts how you can enable the use of args by using event.args.<ARG_CREATED> . The second example (Args tab) represents the use of JSON parameters by internal code functions.
Code tab
async function handleRequest(request, v) { return new Response(v, { headers: new Headers([ ["X-Custom-Header", "something defined on JS"], ]), status: 200, }); } addEventListener("fetch", (event) => { event.respondWith(handleRequest(event.request, event.args.value)); });Args tab
{ "value": "hello_world"}How it works
Arguments are key-value pairs you define alongside the function and read at runtime through event.args. In the Code tab, the fetch handler passes event.args.value into handleRequest, which returns it in the body of a new Response along with a custom header set via new Headers([...]) and an explicit status: 200. The Args tab shows the matching JSON object, where the value key supplies the data the function reads. This lets you reuse the same code across instances while changing behavior purely through configuration, with no code edits or redeploy.