npx skills add ...
npx skills add github/gh-aw --skill debugging-workflows
Debug gh-aw workflows using run logs, audits, and failure triage.
npx skills add github/gh-aw --skill debugging-workflows
Use this guide to debug GitHub Agentic Workflows: download and analyze logs, audit runs, and trace workflow behavior.
The gh aw logs command downloads workflow run artifacts and logs from GitHub Actions for analysis.
When you run gh aw logs, the following artifacts are downloaded for each run:
| File | Description |
|---|---|
aw_info.json | Engine configuration and workflow metadata |
safe_output.jsonl | Agent's final output content (when non-empty) |
agent_output/ | Agent logs directory |
agent-stdio.log | Agent standard output/error logs |
aw.patch | Git patch of changes made during execution |
workflow-logs/ | GitHub Actions job logs (organized by job) |
summary.json | Complete metrics and run data for all runs |
The gh aw audit command investigates a single workflow run in detail, downloading artifacts, detecting errors, and generating a report.
The audit command provides:
Understanding the workflow architecture helps in debugging.
Agentic workflows use a markdown + YAML frontmatter format:
| Component | Purpose | Configuration |
|---|---|---|
| Engine | AI model to use | engine: copilot, claude, codex |
| Tools | APIs available to agent | tools: section with MCP servers |
| MCP Scripts | Context passed to agent | mcp-scripts: with GitHub expressions |
| Safe-Outputs | Resources agent can create | safe-outputs: with allowed operations |
| Permissions | GitHub token permissions | permissions: block |
| Network | Allowed network access | network: with domain/ecosystem lists |
The .lock.yml file is the actual GitHub Actions workflow that runs.
Symptoms:
Solution: Add GitHub MCP server configuration:
Symptoms:
Solution: Add required permissions:
Symptoms:
Solution: Configure mcp-scripts:
Symptoms:
Solution: Enable safe-outputs:
Symptoms:
Process Safe Outputs reports multiple failed messages in one runupdate_pull_request message includes a 403 workflows-permission warningadd_comment) include Bad credentialsWhat this means:
update_pull_request can be expected/non-fatal in some workflows.Bad credentials error on other messages is a separate authentication failure that needs its own fix.Diagnostic steps:
permissions: for missing scopes when 403 errors appear.Symptoms:
Solution: Configure network access:
Symptoms:
Solution: Increase timeout or optimize prompt:
When a run is still executing:
| Command | Description |
|---|---|
gh aw logs | Download logs for all workflows |
gh aw logs <workflow> | Download logs for specific workflow |
gh aw logs --json | Output as JSON |
gh aw logs --start-date -1d | Filter by date |
gh aw logs --engine copilot | Filter by engine |
gh aw logs --parse | Generate Markdown reports |
| Command | Description |
|---|---|
gh aw audit <run-id> | Audit specific run |
gh aw audit <url> | Audit from GitHub URL |
gh aw audit <run-id> --json | Output as JSON |
gh aw audit <run-id> --parse | Parse logs to Markdown |
| Command | Description |
|---|---|
gh aw mcp list | List workflows with MCP servers |
gh aw mcp inspect <workflow> | Inspect MCP configuration |
| Command | Description |
|---|---|
gh aw status | Show all workflow status |
gh aw compile | Compile all workflows |
gh aw compile <workflow> | Compile specific workflow |
gh aw compile --strict | Compile with security checks |
| Command | Description |
|---|---|
gh aw run <workflow> | Trigger workflow manually |
gh workflow run <name>.lock.yml | Alternative trigger method |
gh run watch <run-id> | Monitor running workflow |