psadri 1 day ago

Where is the state stored? In my own pg instance? Or is it stored somewhere in the cloud? Also, a small sample code snippet would be helpful.

1
KraftyOne 1 day ago

The state can be stored in any Postgres instance, either locally or in any cloud.

For code, here's the bare minimum code example for a workflow:

  class Example {
    @DBOS.step()
    static async step_one() {
      ...
    }

    @DBOS.step()
    static async step_two() {
      ...
    }

    @DBOS.workflow()
    static async workflow() {
      await Example.step_one()
      await Example.step_two()
    }
  }
The steps can be any TypeScript function.

Then we have a bunch more examples in our docs: https://docs.dbos.dev/.

Or if you want to try it yourself download a template:

    npx @dbos-inc/create

psadri 1 day ago

Are there any constraints around which functions can be turned into steps? I assume their state (arguments?) need to be serializable?

Also, what happens with versioning? What if I want to deploy new code?

KraftyOne 1 day ago

Yeah, the arguments and return values of steps have to be serializable to JSON.

For versioning, each workflow is tagged with the code version that ran it, and we recommend recovering workflows on an executor running the same code version as what the workflow started on. Docs for self hosting: https://docs.dbos.dev/typescript/tutorials/development/self-.... In our hosted service (DBOS Cloud) this is all done automatically.

CMCDragonkai 1 day ago

If you were to use cbor, you could support binary values more easily.