Sure, I can share some pieces that I
Sure, I can share some pieces that I reckon is relevant. Appreciate your help. I did deploy the worker, yes.
wrangler.toml
types.ts
src/index.ts
./incoming-emails/forward-email-handler
./incoming-emails/workflow
8 Replies
You might be missing the
script_name
key from your wrangler.toml workflows section
[[workflows]]
...
script_name = "process-incoming-emails"Is the
script_name
not just needed when you want to reference a workflow from another worker?Ah yeah that might be it. I might have an older config. Theres a PR around clarifying that here
https://github.com/cloudflare/cloudflare-docs/pull/17770/files
GitHub
script_name by elithrar · Pull Request #17770 · cloudflare/cloudfla...
Clarify how script_name can be used.
Thanks! I'm sure I'm just doing something silly. When you deployed your first worker, did you just add the config to the wrangler.toml file or did you have to create it first with some wrangler cli command and then reference it in the toml file?
Maybe your workflow needs to have its run function defined?
export class ProcessIncomingEmailsWorkflow extends WorkflowEntrypoint<
Bindings,
Params
{async run(event: WorkflowEvent<Params>, step: WorkflowStep) { const done = await step.do('work', async () => { return true }); return done } } Yeah I just ran it with the cli tool and used the defaults npm create cloudflare@latest workflows-starter -- --template "cloudflare/workflows-starter" Id say try do it from scratch in an independent worker to get it setup first and then migrate what works into your existing hono app
Yeah, I think it has something to do with this command:
npm create cloudflare@latest workflows-starter -- --template "cloudflare/workflows-starter"
AFAIK, that just creates a new worker but uses the given template. Since I already had a worker, I did not run this command and just tried adding the workflow config to my existing worker. Maybe that command does more just scaffold the project structure locally.I don't think theres any extra scaffolding that it does, theres likely something very small off with your setup but I can't quite spot it
Thanks for help checking anyways