Skip to content

Instantly share code, notes, and snippets.

@apoliakov
Created December 23, 2025 04:29
Show Gist options
  • Select an option

  • Save apoliakov/9aa6693d7e1cf030ca9527b40061c416 to your computer and use it in GitHub Desktop.

Select an option

Save apoliakov/9aa6693d7e1cf030ca9527b40061c416 to your computer and use it in GitHub Desktop.
Counting DBOS Actions
WITH daily_workflows AS (
SELECT
DATE_TRUNC('day', TO_TIMESTAMP(created_at / 1000)) AS day,
workflow_uuid
FROM dbos.workflow_status
)
SELECT
dw.day,
COUNT(DISTINCT dw.workflow_uuid) AS workflow_count,
COUNT(oo.workflow_uuid) AS step_count,
COUNT(DISTINCT dw.workflow_uuid) + COUNT(oo.workflow_uuid) AS total_actions
FROM daily_workflows dw
LEFT JOIN dbos.operation_outputs oo ON dw.workflow_uuid = oo.workflow_uuid
GROUP BY dw.day
ORDER BY dw.day DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment