I have multiple "children workers" that use HTMLRewriter() to change the HTML of response. What I am
I have multiple "children workers" that use HTMLRewriter() to change the HTML of response.
What I am trying to achieve is to trigger multiple workers with "parent worker".
I know you can use service bindings to bind another worker to it, but the problem I have is I need to run multiple workers and modify the responses accordingly.
For example: if I bind two child workers, one will change meta title (worker 1) and one meta description (worker 2).
What I need to achieve is firstly trigger worker1 with parent request, and then trigger worker 2 on response i get from worker 1, so i get all the HTML changes.
I have no problem getting response from worker 1, but I dont know how to combine worker 1 and worker 2 changes. What i tried is passing body of response from worker 1 to worker 2 fetch, like this:
But this does not seem to work.
Do you have any ideas what is wrong?
Any help would be greatly appreciated!
What I am trying to achieve is to trigger multiple workers with "parent worker".
I know you can use service bindings to bind another worker to it, but the problem I have is I need to run multiple workers and modify the responses accordingly.
For example: if I bind two child workers, one will change meta title (worker 1) and one meta description (worker 2).
What I need to achieve is firstly trigger worker1 with parent request, and then trigger worker 2 on response i get from worker 1, so i get all the HTML changes.
I have no problem getting response from worker 1, but I dont know how to combine worker 1 and worker 2 changes. What i tried is passing body of response from worker 1 to worker 2 fetch, like this:
But this does not seem to work.
Do you have any ideas what is wrong?
Any help would be greatly appreciated!

