Durable async background support?
Hey,
It would be really cool if we could use the app in an async manner (e.g. switching to other apps in mobile while it is generating or closing the tab in the browser while it's working). It will enable features such as fire and forget and get an email upon completion, and would make mobile use much more intuitive (navigate somewhere else while it's working, come back after a few minutes to a completed state). Would also solve bugs related to managing the restoration checkpoints and edge cases. Currently the DO shuts down and starts from where the state machine left off. Could we continue running in the background even if no active connections are present? Maybe using something like cloudflare workflow?
Thanks!
Its certainly a nice idea. The practical consideration is about cost - having long running DOs and sandboxes associated would cost up a lot for the platform provider. But let me discuss with the team on this. Maybe like having an optional 'notify me when complete' functionality? But I cant promise anything here. On a sidenote, we are working on integrating Cloudflare workflows builder in this platform too.
Thanks for the answer! FWIW, If I understand the pricing model of workflows and durable objects correctly, moving the generation logic to workflow steps would reduce the costs associated with the platform substantially since its bills on CPU time (VS. DO’s duration based billing) and a lot of time goes on waiting for APIs and inference responses. So we get both durable, long running asynchronous execution and cost reduction (: OOC, how do you plan to use workflow inside the platform?
FWIW, If I understand the pricing model of workflows and durable objects correctly, moving the generation logic to workflow steps would reduce the costs associated with the platform substantially since its bills on CPU time (VS. DO’s duration based billing) and a lot of time goes on waiting for APIs and inference responses. So we get both durable, long running asynchronous execution and cost reduction (:
Yeah but code generation is only a part of it. Without running it on a sandbox and doing static analysis/runtime error tests, we would basically be having the LLM generate code without any feedbacks on wether the code is correct in the first place. Bugs and errors would accumulate; sandbox serves to 'ground' the LLM's output. And spawning a sandbox takes time too, so DOs need to be active for that duration. That being said, I can definitely look into maybe a different kind of 'event driven' architecture based coding agent. Let me see.
OOC, how do you plan to use workflow inside the platform?
Basically a new agent that can build workflows from prompts, just like current coding agent builds apps from prompts ;)
The new agent that can build workflows from prompts sounds awesome! Definitely looking forward to this one (:
Another use case that comes to mind for this is being able to completely replace the UI with different agent-native interfaces (e.g. MCP, slack, WhatsApp, iMessage etc.) Think an MCP that can plug into any client, receive prompts and return links to apps/agents/workflows etc. That’s nuts!! The more I think about it the more I like it (: