Skip to content

Conversation

leonardcser
Copy link
Collaborator

No description provided.

@leonardcser leonardcser self-assigned this Sep 30, 2025
Copy link

cloudflare-workers-and-pages bot commented Sep 30, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
dafthunk-web ffd5c0b Commit Preview URL Oct 07 2025, 08:15 AM

@leonardcser leonardcser linked an issue Sep 30, 2025 that may be closed by this pull request
@leonardcser leonardcser force-pushed the 162-use-durable-objects-to-store-workflows branch 3 times, most recently from 5f26fd9 to 56017c8 Compare September 30, 2025 16:08
@leonardcser
Copy link
Collaborator Author

leonardcser commented Sep 30, 2025

@bchapuis The individual ws implementation is complete but the api build fails. We would need to check the logs of the failed api build and enable maybe durable objects, or create the durable object in the cloudflare account. Otherwise, this PR is ready to merge

@leonardcser leonardcser marked this pull request as ready for review September 30, 2025 16:11
@leonardcser leonardcser force-pushed the 162-use-durable-objects-to-store-workflows branch from 56017c8 to 25e43bb Compare September 30, 2025 16:13
@bchapuis
Copy link
Contributor

@leonardcser Here is the log:

18:14:47.127 ✘ [ERROR] A request to the Cloudflare API (/accounts/ad4c9e9945d2de46a4dfe2bd179fdc63/workers/scripts/dafthunk-api/versions) failed.
18:14:47.127  
18:14:47.127 Version upload failed. You attempted to upload a version of a Worker that includes a Durable Object migration, but migrations must be fully applied by running "wrangler deploy". See https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#gradual-deployments-for-durable-objects for more information. [code: 10211]
18:14:47.127 To learn more about this error, visit: https://developers.cloudflare.com/workers/configuration/versions-and-deployments/gradual-deployments/#gradual-deployments-for-durable-objects
18:14:47.127  

Does this ring a bell?

@leonardcser leonardcser force-pushed the 162-use-durable-objects-to-store-workflows branch from 25e43bb to a5aa83c Compare September 30, 2025 18:22
@leonardcser
Copy link
Collaborator Author

leonardcser commented Sep 30, 2025

Does this ring a bell?

@bchapuis I think you have to run in apps/api pnpm wrangler deploy to create the migrations for the Durable Object as per the docs (https://developers.cloudflare.com/durable-objects/get-started/#7-deploy-your-durable-object-worker)

@leonardcser leonardcser force-pushed the 162-use-durable-objects-to-store-workflows branch 3 times, most recently from e28c5ca to eb56c0e Compare September 30, 2025 18:33
@leonardcser leonardcser force-pushed the 162-use-durable-objects-to-store-workflows branch from eb56c0e to e9c051f Compare September 30, 2025 18:34
@bchapuis
Copy link
Contributor

bchapuis commented Oct 1, 2025

@leonardcser I made some additional experiments in #172 and started implementing the monitoring of the execution with the websocket.

I encountered the following problems:

  • the ws cannot register a callback in the runtime and needs to poll the state out of the db (this is undesirable)
  • queues would be a good solution for this, but they don't provide a to filter the messages related to the workflow of a user
  • the documentation recommend pub/sub for this use case which now recommend actors which are implemented with durable object... 🤯

I'm now again of the opinion that we should use durable objects with actors for this particular use case. What do you think?

I suggest we build upon your last commit.

@leonardcser
Copy link
Collaborator Author

@leonardcser I made some additional experiments in #172 and started implementing the monitoring of the execution with the websocket.

I encountered the following problems:

  • the ws cannot register a callback in the runtime and needs to poll the state out of the db (this is undesirable)

  • queues would be a good solution for this, but they don't provide a to filter the messages related to the workflow of a user

  • the documentation recommend pub/sub for this use case which now recommend actors which are implemented with durable object... 🤯

I'm now again of the opinion that we should use durable objects with actors for this particular use case. What do you think?

I suggest we build upon your last commit.

@bchapuis It is still unclear for me if it is possible with this actors API, I need to do more exploring but in the meantime, it makes sense to commit to this pr.

@bchapuis bchapuis force-pushed the 162-use-durable-objects-to-store-workflows branch from 4e9a603 to 5346421 Compare October 4, 2025 22:30
@bchapuis bchapuis force-pushed the 162-use-durable-objects-to-store-workflows branch from 4a6596c to 32d81c4 Compare October 6, 2025 21:26
…d WebSocket execution updates, and enhance WorkflowSession class for better state management
@bchapuis bchapuis force-pushed the 162-use-durable-objects-to-store-workflows branch from 32d81c4 to 2eeec00 Compare October 6, 2025 21:27
@bchapuis
Copy link
Contributor

bchapuis commented Oct 7, 2025

@leonardcser Could you review these changes? we decide upon merging later this morning.

@bchapuis bchapuis force-pushed the 162-use-durable-objects-to-store-workflows branch from 167b876 to ffd5c0b Compare October 7, 2025 08:14
@bchapuis bchapuis merged commit 9f0b2c6 into main Oct 7, 2025
2 of 3 checks passed
@bchapuis bchapuis deleted the 162-use-durable-objects-to-store-workflows branch October 7, 2025 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use durable objects to store workflows

2 participants