audit.workflow-run.aggregate ​
Aggregate workflow-run counts per workflow_type for an organization, optionally scoped to a domain prefix group and a time window.
Per-workflow_type run counts for one organization within a time window.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-audit |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | UUID of the organization whose runs are aggregated |
workflow_type_prefixes | json | No | — | Optional list of workflow_type name prefixes (strings). A row matches if any prefix matches. Use to scope the aggregate to a domain group (e.g. all kubernetes.* runs). |
since | string | No | — | ISO 8601 timestamp; defaults to 24h before until (or now) if omitted |
until | string | No | — | ISO 8601 timestamp; defaults to now if omitted |
limit | integer | No | — | Max distinct workflow_types to return (default 500, max 5000) |
include_total | boolean | No | — | When true, also compute total_runs — the exact distinct run count across the window (an extra latest-per-run aggregate query). Default false: total_runs comes back null; the per-type counts in items are always exact. |
include_children | boolean | No | — | When true, DAG child/step executions count as runs. Default false: only top-level runs (matches the query workflow's default, so list and aggregate reconcile). |
workflow_run_id | string | No | — | Engine-stamped parent DAG run id when invoked as a Step target |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
items | json | Yes | — | List of {workflow_type, count, last_started_at_iso} grouped by workflow_type, ordered by count descending. |
since_iso | string | Yes | — | The effective lower bound (inclusive) of the aggregation window |
until_iso | string | Yes | — | The effective upper bound (exclusive) of the aggregation window |
total_types | integer | Yes | — | Number of distinct workflow_types returned |
total_runs | integer | No | — | Total distinct workflow-id count matching the filters, independent of the returned type limit. Only computed when include_total=true; null otherwise. |
has_more_types | boolean | Yes | — | Whether more workflow_type groups exist beyond the returned items |
error | string | No | — | Set when the underlying storage call raised (string message) |
error_type | string | No | — | Set when the underlying storage call raised (exception class name) |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
done | Yes | Yes | Yes | — | — |
Outcomes ​
| Outcome | Type | Description | State Data Keys |
|---|---|---|---|
aggregated | SUCCESS | Workflow run aggregates returned | items, total_runs |
failed | FAILURE | Audit workflow failed | failure_reason |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "audit.workflow-run.aggregate",
"initial_data": {
"organization_uuid": "value"
}
}