Baton.Query (Baton v0.1.0)

Copy Markdown View Source

Read queries powering the Workflow LiveView dashboard.

Workflow membership and labels are read from oban_jobs.meta (cheap, no join), while per-step structure (deps) and result presence come from workflow_nodes. The repo is resolved from Oban config at runtime.

Summary

Functions

Per-step LLM-usage stats for a workflow, keyed by step name.

All steps for a workflow with their state and structure, ordered by insertion.

Aggregate LLM-usage stats for a workflow (delegates to Stats).

List distinct workflows with aggregate status, newest first.

Counts across all workflow jobs grouped by state (summary bar).

Functions

get_step_stats(workflow_id)

Per-step LLM-usage stats for a workflow, keyed by step name.

get_workflow_jobs(workflow_id)

All steps for a workflow with their state and structure, ordered by insertion.

Joins workflow_nodes (deps, result presence) to oban_jobs (state, timing). Steps whose Oban job has been pruned are omitted.

get_workflow_stats(workflow_id)

Aggregate LLM-usage stats for a workflow (delegates to Stats).

list_workflows(opts \\ [])

List distinct workflows with aggregate status, newest first.

workflow_stats()

Counts across all workflow jobs grouped by state (summary bar).