Hi,
I’m new to the Cloudflare Workers so please bear with me.
I have a scheduled worker which is calling some third-party APIs. I want to split those requests into multiple fetch workers.
I read about Service Bindings in the docs, so I thought that’s the perfect solution to this.
Unfortunately, I can’t get it to work since the “scheduled” method does not seem to be passing any request prop so I have no way of calling the fetch method properly.
Here’s what I currently have:
const githubResponse = await env.GITHUB_WORKER.fetch(SOMETHING , {
method: "POST",
body: JSON.stringify({ tools }),
headers: {
"Content-Type": "application/json"
}
});
I have no idea what to put in place of “SOMETHING”. Don’t have any existing request object. new Request()
also does not seem to work as I don’t have the URL of the worker.
Any help would be appreciated.
Thanks