Target Workflow
Agentic Maintenance (agentics-maintenance.yml) — selected as the only eligible candidate after excluding workflows optimized within the last 14 days and workflows with "Token" in their name.
⚠️ Data Gap Notice: The pre-downloaded all-runs.json and all daily snapshots for the 7-day window contain zero AI workflow runs ("runs": []). No AI token data was available for candidate selection. This issue targets the highest-frequency non-excluded workflow based on GitHub Actions run history.
Analysis Period & Runs Analyzed
| Metric |
Value |
| Analysis window |
2026-05-22 → 2026-05-29 (7 days) |
| Runs analyzed |
10 most recent scheduled runs |
| Run frequency |
2× per day (cron 37 */12 * * *) |
| All conclusions |
✅ 10/10 success |
Token Profile
This is a pure GitHub Actions maintenance workflow — no AI agent, no LLM calls, no token usage. The optimization focus is on action-minutes cost and runner efficiency.
| Metric |
Value |
| Avg run duration |
~17 s |
| Active jobs per scheduled run |
2 of 9 (cleanup-cache-memory, close-expired-entities) |
| Skipped jobs per run |
7 (dispatch-only operations) |
| Estimated weekly action minutes |
~4 min |
| AI token usage |
0 (no agent invocations) |
Per-run duration table (10 runs)
Ranked Recommendations
1. Investigate empty token-data pipeline (high priority)
Estimated savings: Unblocks all future optimization cycles — indirectly high impact.
Evidence: all-runs.json contained {"runs": [], "summary": {}}. All 10 daily snapshot files for the analysis window (2026-05-20 through 2026-05-29.json) show "workflows": []. The rolling-summary is an empty array. This suggests the gh aw logs download step in the audit workflow is returning no data, preventing any AI workflow token tracking.
Action: Verify that the gh aw logs --start-date -1d --json command is producing output on the runner. Check that the audit workflow's GH_TOKEN has actions: read permission and that the agentic workflow runs being tracked are not filtered by a repo-scope mismatch. Add a diagnostic echo of jq '.runs | length' /tmp/gh-aw/token-audit/workflow-logs.json in the setup step so failures surface in the log.
References: §26640788112
2. Reduce repeated Setup Scripts overhead across all 9 job definitions
Estimated token savings per run: ~0 AI tokens. Action-minutes savings: ~1 s per job per run (~28 job-seconds/week).
Evidence: Every one of the 9 job definitions in agentics-maintenance.yml includes the identical Setup Scripts step (uses: github/gh-aw-actions/setup@bc56a0cad...). On each scheduled run, only 2 jobs execute, and each spends 1–2 s on this step before doing 1–2 s of actual work. The setup overhead represents 25–50% of each job's wall time.
Action: The file is auto-generated by pkg/workflow/maintenance_workflow.go. Evaluate whether the generator can emit the setup action as a reusable job output or skip it entirely for jobs that don't require script artifacts (e.g., close-expired-entities uses actions/github-script which doesn't need the gh-aw CLI setup).
3. Relax schedule frequency when all minimum expiries allow it
Estimated savings: ~2 min/week action minutes if frequency halved.
Evidence: The cron comment reads # Every 12 hours (based on minimum expires: 3 days). A 12-hour schedule means the workflow runs 14×/week to enforce a 3-day minimum expiry — that is a 6× safety margin. Running every 24 hours would still give a 3× margin against a 3-day expiry, cutting weekly runs from 14 to 7.
Action: In the generator configuration (expires: 3d or equivalent), evaluate whether the safety margin can be relaxed to produce a 0 */24 * * * schedule. Alternatively, add a check at the top of close-expired-entities that exits early if no entities are approaching expiry, avoiding unnecessary API calls.
Caveats
- All 10 runs analyzed were scheduled (no
workflow_dispatch) — dispatch-only job behavior is unobserved.
- This workflow is auto-generated; recommendations 2 and 3 require changes to the generator source, not the
.yml file directly.
- The action-minutes savings are small (~2–3 min/week) given the workflow's brevity. The highest-value action (Rec 1) is to restore the token data pipeline so future optimization cycles can target high-AI-cost workflows.
- Only 10 runs examined; no failures were observed, so no error-recovery token waste was detected.
Generated by Agentic Workflow Token Usage Optimizer · ● 13.8M · ◷
Target Workflow
Agentic Maintenance (
agentics-maintenance.yml) — selected as the only eligible candidate after excluding workflows optimized within the last 14 days and workflows with "Token" in their name.Analysis Period & Runs Analyzed
37 */12 * * *)Token Profile
This is a pure GitHub Actions maintenance workflow — no AI agent, no LLM calls, no token usage. The optimization focus is on action-minutes cost and runner efficiency.
cleanup-cache-memory,close-expired-entities)Per-run duration table (10 runs)
Ranked Recommendations
1. Investigate empty token-data pipeline (high priority)
Estimated savings: Unblocks all future optimization cycles — indirectly high impact.
Evidence:
all-runs.jsoncontained{"runs": [], "summary": {}}. All 10 daily snapshot files for the analysis window (2026-05-20through2026-05-29.json) show"workflows": []. The rolling-summary is an empty array. This suggests thegh aw logsdownload step in the audit workflow is returning no data, preventing any AI workflow token tracking.Action: Verify that the
gh aw logs --start-date -1d --jsoncommand is producing output on the runner. Check that the audit workflow'sGH_TOKENhasactions: readpermission and that the agentic workflow runs being tracked are not filtered by a repo-scope mismatch. Add a diagnosticechoofjq '.runs | length' /tmp/gh-aw/token-audit/workflow-logs.jsonin the setup step so failures surface in the log.References: §26640788112
2. Reduce repeated Setup Scripts overhead across all 9 job definitions
Estimated token savings per run: ~0 AI tokens. Action-minutes savings: ~1 s per job per run (~28 job-seconds/week).
Evidence: Every one of the 9 job definitions in
agentics-maintenance.ymlincludes the identicalSetup Scriptsstep (uses: github/gh-aw-actions/setup@bc56a0cad...). On each scheduled run, only 2 jobs execute, and each spends 1–2 s on this step before doing 1–2 s of actual work. The setup overhead represents 25–50% of each job's wall time.Action: The file is auto-generated by
pkg/workflow/maintenance_workflow.go. Evaluate whether the generator can emit the setup action as a reusable job output or skip it entirely for jobs that don't require script artifacts (e.g.,close-expired-entitiesusesactions/github-scriptwhich doesn't need thegh-awCLI setup).3. Relax schedule frequency when all minimum expiries allow it
Estimated savings: ~2 min/week action minutes if frequency halved.
Evidence: The cron comment reads
# Every 12 hours (based on minimum expires: 3 days). A 12-hour schedule means the workflow runs 14×/week to enforce a 3-day minimum expiry — that is a 6× safety margin. Running every 24 hours would still give a 3× margin against a 3-day expiry, cutting weekly runs from 14 to 7.Action: In the generator configuration (
expires: 3dor equivalent), evaluate whether the safety margin can be relaxed to produce a0 */24 * * *schedule. Alternatively, add a check at the top ofclose-expired-entitiesthat exits early if no entities are approaching expiry, avoiding unnecessary API calls.Caveats
workflow_dispatch) — dispatch-only job behavior is unobserved..ymlfile directly.