Using Agentic Workflows
Agentic Workflows are AI-powered repository automations that run coding agents in GitHub Actions. Defined in markdown with natural language instructions, they enable event-triggered and scheduled automation with built-in guardrails and security-first design.What are Agentic Workflows?
Agentic Workflows combine:- Natural Language Instructions - Describe what you want in plain English
- GitHub Actions Integration - Run on standard GitHub infrastructure
- AI Coding Agents - Powered by GitHub Copilot
- Security Guardrails - Safe outputs, least-privilege permissions
- Event Triggers - Schedules, slash commands, issue/PR events
Agentic Workflows differ from regular GitHub Actions:
- Traditional Actions: YAML with explicit steps and commands
- Agentic Workflows: Markdown with natural language goals + AI execution
Workflow Structure
Each workflow is a single.md file:
Frontmatter Fields
Frontmatter Fields
- name (required): Human-readable workflow name
- description (required): Brief description in single quotes
- on (required): Trigger events (schedule, issues, workflow_dispatch, etc.)
- permissions (required): Least-privilege GitHub token permissions
- safe-outputs (optional): Whitelisted output variables
- File naming: Lowercase with hyphens (e.g.,
daily-report.md)
Installing Workflows
Copy workflow file
Download a workflow from the workflows/ directory or create your own:
Compile to GitHub Actions
Generate the This creates
.lock.yml file:daily-issues-report.lock.yml from daily-issues-report.md.Important: Always commit both the
.md source and .lock.yml compiled files. Only .yml, .yaml, and .lock.yml files are blocked - .md files are required.Workflow Triggers
Workflows can respond to various GitHub events:- Schedule
- Slash Commands
- Issue Events
- Manual Trigger
Run workflows on a cron schedule:Use Cases:
- Daily status reports
- Weekly metrics summaries
- Monthly contributor reports
- Automated maintenance tasks
Workflow Examples from the Repository
- Daily Issues Report
- Relevance Check
- OSPO Health Report
- Release Compliance
CLI Commands
Manage workflows with thegh aw CLI:
Creating Your Own Workflows
Define the goal
Start with a clear automation goal:
- What task should be automated?
- When should it run?
- What outputs are needed?
Best Practices
Write Clear Instructions
Write Clear Instructions
- Be specific about expected outcomes
- Break down complex tasks into steps
- Specify output format (issue, comment, file)
- Include examples when helpful
Use Minimal Permissions
Use Minimal Permissions
Only request permissions you actually need:
Handle Edge Cases
Handle Edge Cases
Include instructions for edge cases:
Version Control Workflows
Version Control Workflows
- Commit both
.mdand.lock.ymlfiles - Use descriptive commit messages
- Test workflows before deploying to production
- Review workflow runs regularly
Security Considerations
Important: Agentic Workflows run with your repository’s permissions. Follow these security guidelines:
Least Privilege
Least Privilege
Always use minimal required permissions:
Safe Outputs
Safe Outputs
Whitelist outputs to prevent data leakage:
Input Validation
Input Validation
Describe validation in instructions:
Audit Workflow Runs
Audit Workflow Runs
- Review workflow execution logs
- Monitor for unexpected behavior
- Track API rate limit usage
- Set up alerts for failures
Troubleshooting
Workflow not compiling
Workflow not compiling
- Check frontmatter YAML is valid
- Verify all required fields are present
- Run
gh aw validate workflow.md - Check for syntax errors in markdown
Workflow not triggering
Workflow not triggering
- Verify
.lock.ymlfile exists and is committed - Check cron syntax for scheduled workflows
- Ensure permissions are set correctly
- Review GitHub Actions logs
Permission errors
Permission errors
- Grant required permissions in frontmatter
- Check GitHub token scopes
- Verify repository settings allow Actions
- Review branch protection rules
Unexpected output
Unexpected output
- Refine natural language instructions
- Add more specific steps
- Include examples of expected format
- Test with smaller scope first
Common Use Cases
- Maintenance
- Triage
- Metrics
- Quality
- Daily/weekly issue reports
- Stale issue/PR identification
- Dependency update checks
- License compliance scanning
- Broken link detection
Related Resources
- Browse All Workflows
- GitHub Agentic Workflows Specification
- GitHub CLI Extension
- Hooks - Session-triggered automation
- Contributing Guide