Error with Astro + Workflows

I'm trying to integrate workflows with astro but getting this error:
Worker "workflows:workflows-starter"'s binding "USER_WORKFLOW" refers to service "core:user:" with a named entrypoint "MyWorkflow", but "core:user:" has no such named entrypoint
Worker "workflows:workflows-starter"'s binding "USER_WORKFLOW" refers to service "core:user:" with a named entrypoint "MyWorkflow", but "core:user:" has no such named entrypoint
using the following adapter: adapter: cloudflare({ platformProxy: { enabled: true, experimentalJsonConfig: true }, }),
1 Reply
martinklepsch
martinklepschOP2w ago
Something similar was asked here, which was the only google result I could find, no anwer unfortunately: https://www.answeroverflow.com/m/1301257946075758602 I realized I was missing this config:
"main": "./dist/_worker.js/index.js",
"assets": {
"binding": "ASSETS",
"directory": "./dist"
},
"main": "./dist/_worker.js/index.js",
"assets": {
"binding": "ASSETS",
"directory": "./dist"
},
The error message has gotten a lot more useful though:
Worker "workflows:workflows-starter"'s binding "USER_WORKFLOW" refers to service "core:user:ctxs-ai" with a named entrypoint "MyWorkflow", but "core:user:ctxs-ai" has no such named entrypoint.
Worker "workflows:workflows-starter"'s binding "USER_WORKFLOW" refers to service "core:user:ctxs-ai" with a named entrypoint "MyWorkflow", but "core:user:ctxs-ai" has no such named entrypoint.
So it looks like the issue is the missing MyWorkflow export in ./dist/_worker.js/index.js. Is that something that is possible with Astro? when running the astro build first and then running wrangler dev I get the following error:
✘ [ERROR] Your Worker depends on the following Workflows, which are not exported in your entrypoint file: MyWorkflow.

You should export these objects from your entrypoint, dist/_worker.js/index.js.
✘ [ERROR] Your Worker depends on the following Workflows, which are not exported in your entrypoint file: MyWorkflow.

You should export these objects from your entrypoint, dist/_worker.js/index.js.

Did you find this page helpful?