For the moment, we do not support `waitForEvent` steps or events as entrypoint (focus on the "for th
For the moment, we do not support
waitForEvent
steps or events as entrypoint (focus on the "for the moment" 😉 ). One way you could achieve the intended behaviour, would be store the humam action in a KV or D1, and periodically check for that action, sleeping between checks15 Replies
I was just experimenting with this myself - I was about to try opening a websocket to the Slack API in Socket Mode and try to wrap the
onmessage
handler with a promise that could be awaited in the step
https://api.slack.com/apis/socket-modeThat approach should work. The for loop should be outside the step, that way you will benefit from the persistancy of previous successful step executions, sparing on the API calls.
Recommendation. Give it a spin!
Okay, Thank you! But What about the maximum 256 steps? I will definitely have more than that. Does the paid tier have limits regarding the steps?
What is the function passed to
step.do
supposed to return? If I return anything at all from it, it causes the workflow to throw an exception after finishing successfully, every time, and I can't figure out what I'm doing wrongHello, I'm really excited to try Workflows. I tried to add a Workflow to a Remix application. I used the Remix example Framework guide in the Pages docs. Got this error on wrangler deploy: Any ideas on how to fix are appreciated!
My worker is built in a
functions/[[path]].ts
file that looks like: Project was started with https://developers.cloudflare.com/workers/frameworks/framework-guides/remix/
Cloudflare Docs
Remix | Cloudflare Workers docs
Create a Remix application and deploy it to Cloudflare Workers with Workers Assets.
noticing if you have a long output in the trace online it will go off screen (copy button disappears)
also, maybe I missed it, but I haven't figured out how to run a workflow that's been modified locally, as opposed to the one already deployed. Is this where we're at with the beta or did i miss how to?
Unknown User•3w ago
Message Not Public
Sign In & Join Server To View
1. Remix with Vite currently relies on Wrangler's getPlatformProxy() that uses miniflare under the hood. This setup means Remix is running on Node.js and accessing the Env through HTTP getPlatformProxy().
2. By following this PR, you can leverage more features specifically designed for Cloudflare Workers, remix with cloudflare pages will have bumpy journey ahead
3. Run the following commands to set up your development environment:
-
remix vite:dev
on port 3000
- wrangler dev --define "process.env.NODE_ENV:'production'" --log-level=info --port=3001 --test-scheduled app/worker.ts
Note: worker.ts
should be ESM-based for Cloudflare Workers. wrangler dev
enables you to develop queues, crons, and workflows within workerd
environment instead of NodeJS.
the error you're encountering is because getPlatformProxy()
doesn’t work with workflows. If you have [[workflows]]
in wrangler.toml, Miniflare will refer to it, resulting in the error
the development experience for a Vite-powered app has limitations, especially with newer features. This should improve once Vite v6 is released, and Wrangler is updated to support itYou will need to deploy a Worker with your Workflow; you can’t bundle it into your Pages (Remix) app.
I'm getting a
Type instantiation is excessively deep and possibly infinite.
in a step. I don't think it's a very complex type being returnedThanks for reporting it!
is there support for scheduling a workflow to run periodically, like a cron job?
or would I use a worker with a cron trigger to initiate a workflow?
oh the docs address this, yes, nvm
ok in that case
If you want to run it more often than once a minute, you could have your workflow schedule its next run rather than an external trigger. Would just need to jump-start it initially