Liking cljdoc? Tell your friends :D

dbos.query

Read-side of DBOS (list/status/steps), over both a DBOS instance and a DBOSClient via a protocol. Clojure maps in, Clojure maps out.

Read-side of DBOS (list/status/steps), over both a DBOS instance and a
DBOSClient via a protocol. Clojure maps in, Clojure maps out.
raw docstring

->list-workflows-inputclj

(->list-workflows-input m)

Build a ListWorkflowsInput from a map. Supported keys:

  • :workflow-ids - Collection of workflow UUIDs to query
  • :workflow-name - Filter by workflow function name
  • :statuses - Collection of status strings (PENDING, ERROR, etc.)
  • :status - Single status string
  • :queue-name - Filter by queue name
  • :executor-ids - Collection of executor IDs
  • :start-time - OffsetDateTime for created_at >= filter
  • :end-time - OffsetDateTime for created_at <= filter
  • :limit - Max results to return
  • :offset - Pagination offset
  • :sort-desc? - Sort by creation time descending
  • :load-input? - Include workflow inputs in result
  • :load-output? - Include workflow outputs in result
  • :workflow-id-prefix - Filter by workflow-id prefix
Build a ListWorkflowsInput from a map. Supported keys:
- :workflow-ids       - Collection of workflow UUIDs to query
- :workflow-name      - Filter by workflow function name
- :statuses           - Collection of status strings (PENDING, ERROR, etc.)
- :status             - Single status string
- :queue-name         - Filter by queue name
- :executor-ids       - Collection of executor IDs
- :start-time         - OffsetDateTime for created_at >= filter
- :end-time           - OffsetDateTime for created_at <= filter
- :limit              - Max results to return
- :offset             - Pagination offset
- :sort-desc?         - Sort by creation time descending
- :load-input?        - Include workflow inputs in result
- :load-output?       - Include workflow outputs in result
- :workflow-id-prefix - Filter by workflow-id prefix
sourceraw docstring

get-workflow-statusclj

(get-workflow-status queryable workflow-id)

Get the status map of a single workflow by its ID, or nil if not found. queryable is either a DBOS instance or a DBOSClient.

Get the status map of a single workflow by its ID, or nil if not found.
`queryable` is either a DBOS instance or a DBOSClient.
sourceraw docstring

list-workflow-stepsclj

(list-workflow-steps queryable workflow-id)

List the recorded steps of a workflow (by id) as a vector of maps, in execution order. queryable is either a DBOS instance or a DBOSClient.

Each step map has :function-id, :function-name, :output, :error, :child-workflow-id, :started-at, :completed-at, :started-at-epoch-ms, :completed-at-epoch-ms, and :serialization.

List the recorded steps of a workflow (by id) as a vector of maps, in
execution order. `queryable` is either a DBOS instance or a DBOSClient.

Each step map has :function-id, :function-name, :output, :error,
:child-workflow-id, :started-at, :completed-at, :started-at-epoch-ms,
:completed-at-epoch-ms, and :serialization.
sourceraw docstring

list-workflowsclj

(list-workflows queryable query-params)

Query workflows from DBOS with optional filters, returning a vector of status maps. queryable is either a DBOS instance or a DBOSClient — the same call works on both.

Example: (list-workflows client {:workflow-ids ["hello-123" "hello-345"] :workflow-name "bulk-create-opening-child-workflow" :statuses ["PENDING" "ERROR"]})

Query workflows from DBOS with optional filters, returning a vector of
status maps. `queryable` is either a DBOS instance or a DBOSClient — the
same call works on both.

 Example:
 (list-workflows client
                 {:workflow-ids ["hello-123" "hello-345"]
                  :workflow-name "bulk-create-opening-child-workflow"
                  :statuses ["PENDING" "ERROR"]})
sourceraw docstring

step-info->mapclj

(step-info->map si)

Convert a StepInfo record to a Clojure map, or nil for nil.

Convert a StepInfo record to a Clojure map, or nil for nil.
sourceraw docstring

workflow-status->mapclj

(workflow-status->map ws)

Convert a WorkflowStatus record to a Clojure map.

Convert a WorkflowStatus record to a Clojure map.
sourceraw docstring

workflow-treeclj

(workflow-tree queryable workflow-id)
(workflow-tree queryable workflow-id opts)

A workflow with its steps, and every child workflow expanded in place — the whole durable execution as one data structure, for debugging at the REPL. Returns nil when the workflow doesn't exist.

The result is a get-workflow-status map plus :steps. Each step keeps its :child-workflow-id and, when it started one, gains :child-workflow with that child's own tree — recursively, so grandchildren are expanded too.

Awaiting a child records a second DBOS.getResult step pointing at the same child, so each child is expanded once (at the step that started it); the awaiting step keeps just the :child-workflow-id.

Inputs and outputs come back as real Clojure data: DBOS deserializes them with the serializer the instance/client was built with.

Options:

  • :max-depth how deep to expand (default 10). Steps deeper than this keep :child-workflow-id but are not expanded.

This is one query per workflow in the tree, so it's a debugging tool — not something to call on a hot path.

(clojure.pprint/pprint (workflow-tree dbos "sync-user-john"))

A workflow with its steps, and every child workflow expanded in place — the
whole durable execution as one data structure, for debugging at the REPL.
Returns nil when the workflow doesn't exist.

The result is a `get-workflow-status` map plus `:steps`. Each step keeps its
`:child-workflow-id` and, when it started one, gains `:child-workflow` with
that child's own tree — recursively, so grandchildren are expanded too.

Awaiting a child records a second `DBOS.getResult` step pointing at the same
child, so each child is expanded once (at the step that started it); the
awaiting step keeps just the `:child-workflow-id`.

Inputs and outputs come back as real Clojure data: DBOS deserializes them
with the serializer the instance/client was built with.

Options:
- `:max-depth` how deep to expand (default 10). Steps deeper than this keep
  `:child-workflow-id` but are not expanded.

This is one query per workflow in the tree, so it's a debugging tool — not
something to call on a hot path.

  (clojure.pprint/pprint (workflow-tree dbos "sync-user-john"))
sourceraw docstring

WorkflowQueryablecljprotocol

Read-side of DBOS, satisfied by both a DBOS instance and a DBOSClient.

Read-side of DBOS, satisfied by both a DBOS instance and a DBOSClient.

-get-workflow-statusclj

(-get-workflow-status this workflow-id)

-list-workflow-stepsclj

(-list-workflow-steps this workflow-id)

-list-workflowsclj

(-list-workflows this input)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close