Workflow bindings
Do anyone knows is there any way (or plans) how to integrate Zaraz custom components together with Workflows through bindings (without using the middle Worker)?
@Mackenly maybe you know something?
6 Replies
You can using Bindings in custom managed components. I haven't personally used it with Workflows though. I don't work for Cloudflare, so I'm limited to just my experience.
What's the use case?
Yes, I know about the Bindings in general, and I found out that through one of your GH repo examples.
I'm using the MC in more than one page and working on custom GA4, FB event processing and want to "remove" that functionality from the MC itself, instead sending and processing the events separately (which includes saving some events on D1 as well).
While exploring the Workflows I thought this might be a good use for them.
I ask this because I see that MC publishing uses the old 3.29 Wrangler version, which does not recognize the Workflows in wrangler.toml
Other way around is using http fetch of course, but..
So, I am reading here: https://developers.cloudflare.com/workflows/build/call-workflows-from-pages/#use-service-bindings
That Workflows can be triggered and connected as the Service Bindings.
I made a template Workflow without any modifications made (so the code is useless here).
I'm trying to get it alive as this:
I tried various ways, up there are few of what I tried.
The only thing that works is fetching.
What I get is the error:
This error is for whatever I try (except fetching).
Adding a note for this - for the SERVICE_WORKER_THAT_WORKS I have few more methods, that works at other cross-worker bindings, but with zaraz custom managed component I get the same error as above.
the Bindings in wrangler.toml
I tried with and without entrypoint.
Adding the [[workflows]] does not work also, as it throws warning, that it is not recognized and does not appear to bindings.
Cloudflare Docs
Call Workflows from Pages · Cloudflare Workflows docs
You can bind and trigger Workflows from Pages Functions by deploying a Workers project with your Workflow definition and then invoking that Worker using service bindings or a standard fetch() call.
@yo'av Sorry for disturbing you, but I believe you are one of few who can make some comments about this topic (and I hope you will).
For now, I think there is no better way than firing the http post request to the specific workflow.
Ok, I still hope for some updates. :/