Skip to content

Conversation

@adrianlyjak
Copy link
Contributor

@adrianlyjak adrianlyjak commented Oct 21, 2025

This is very lacking still, but it runs a basic example

  • not a clear story for how to actually resume a DBOS workflow. I think adding an interface to the Workflow to start some sort of a worker process to resume workflows
  • the steps are not distributed, and can't be until the context undergoes further changes.

* add some refactoring notes

* Clarify / document plugin interface better

* debug mem leak

* ugly things to workaround leaks

* clean up from leak fix
* ugly leak fixes

* remove test files
@adrianlyjak adrianlyjak force-pushed the adrian/dbos branch 2 times, most recently from f96df50 to 82c5546 Compare October 22, 2025 18:34
@adrianlyjak adrianlyjak marked this pull request as ready for review October 22, 2025 18:36
and sent via DBOS.send, enabling durable orchestration.
"""

@DBOS.workflow()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make recovery fully work, DBOS workflows need to be registered statically upon start up (currently it registers workflows lazily upon the first run). Since Python functions may not always be serializable and DBOS workflow input must be serializable, one workaround is to maintain a {workflow name: function} definition map.

Then, this DBOS plugin statically registers a generic DBOS workflow function, say _dbos_control_loop, that takes in a "workflow function name" parameter, and within the control loop function it'll look up the actual workflow function to run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is the deadline for registration with dbos? Is basically it that the workflows must be registered before calling DBOS.launch?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, workflows need to be registered before DBOS.launch for the recovery thread and queue dispatching thread to find them.

with SetWorkflowID(run_id):
return await workflow_function(start_event, init_state, run_id)

wrapped_steps = {name: DBOS.step()(step) for name, step in steps.items()}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For steps to execute in distributed environment, they need to be DBOS workflows. Then the main run workflow can enqueue each step worker to distribute the work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The child workflows would need to be registered at startup time too, correct?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, all workflows should be registered at startup time.

@adrianlyjak adrianlyjak force-pushed the adrian/context-refact branch 2 times, most recently from 070fba2 to 862274b Compare October 28, 2025 17:31
Base automatically changed from adrian/context-refact to main October 28, 2025 18:32
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.

3 participants