GitHub Agentic Workflows let you automate repository tasks by writing natural language instructions in markdown. These markdown files then compile into GitHub Actions workflows powered by AI agents. Instead of writing complex YAML, you describe what you want done and an AI agent handles it.
GitHub Agentic Workflows are a form of natural language programming over GitHub.
GitHub Agentic Workflows is currently a research project from GitHub Next and Microsoft Research. Specifications may change, and human supervision is recommended.
GitHub Agentic Workflows consists of a markdown file with frontmatter, describing the triggers, permissions, safe outputs, allowed tools, and more. This is then followed by a set of natural language instructions on what the agent should do.
Currently, you have to use the gh aw CLI extension to compile this to generate the Actions workflow.
This is the current process, but in the future, the development team plans to simplify Agentic Workflows, requiring only a markdown file in .github/workflows to allow “agentic things to just happen”
An Agentic Workflow file is comprised of five key components:
Agentic Workflows compile to produce standard GitHub Actions YAML files. This means they are repo-centric, team-visible, and version controlled. You can always inspect the generated .lock.yml file to see exactly what will execute.
You may be thinking “Why shouldn't I just ask my AI agent to write me a GitHub Action?" The key difference between the two is the amount of control you have over your AI agents!
With AI-generated YAML, the agent writes the workflow steps, you commit the file, and from then on, it's the same as any other static workflow.
Where Agentic Workflows really shines is where a bit of “productive ambiguity" helps. For example, a human teammate can understand “read the coverage report and write tests to improve the coverage.” This isn't a programmatic instruction set that needs to be written with GitHub Actions syntax, instead, it's something an AI agent can interpret and execute.
Because an AI agent is making runtime decisions, security becomes critical. GitHub Agentic Workflows emphasise security by inheriting GitHub Actions' sandboxing model, scoped permissions, and auditable execution, enforced by these attributes:
safe-outputsThis is a fundamental difference compared to if you invoked an AI agent in a normal GitHub Action, which runs with whatever permissions you give the job and has no built-in guardrails on what the agent chooses to do.
Agentic Workflows are best suited for repetitive repository tasks that have a bit of ambiguity and would benefit from AI reasoning, not requiring strict, deterministic outputs.
Common use cases include:
Create a workflow for GitHub Agentic Workflows using https://raw.githubusercontent.com/github/gh-aw/main/create.md{{ YOUR WORKFLOW SPECIFICATION HERE }}
If you'd prefer to manually create your Agentic Workflows, follow these instructions.
gh aw GitHub CLI extension.md file with YAML frontmatter (triggers, permissions, safe-outputs, tools) followed by natural language instructionsgh aw to generate the GitHub Actions .lock.yml file from your markdown.md source and the generated .lock.yml to your repositoryThe workflow runs on the events you specified, with the AI agent executing your instructions
Learn more at GitHub Agentic Workflow Docs - Manual Editing
You can also create workflows directly through the GitHub web interface using natural language prompts, without needing the CLI.
Here's an example markdown file for an Agentic Workflow that automatically detects and closes duplicate issues.
From there, all you would need to do is compile the workflow markdown into a YAML workflow file using: gh aw compile, producing the YAML file responsible for this workflow.
---description: >Automatically detect duplicate issues and close them with a linkto the original, notifying relevant users.on:issues:types: [opened]permissions:contents: readissues: readpull-requests: readtools:github:toolsets: [default]safe-outputs:add-comment:max: 3close-issue:max: 1update-issue:max: 2noop:max: 1---# Duplicate Issue DetectorYou are an AI agent that detects duplicate issues in this repository.When a new issue is opened, you analyze the existing issue backlog tofind potential duplicates. If a duplicate is found, you close the newissue with a reference to the original and notify relevant users.## Your Task1. **Read the newly opened issue** — get the title, body, and anymentioned users from the triggering issue.2. **Search the issue backlog** — use the GitHub tools to search forexisting open AND closed issues that may cover the same topic.Try multiple search queries to cast a wide net (at least 2-3different queries).3. **Evaluate similarity** — for each candidate, compare titlesimilarity, description overlap, and labels. Look for **semantic**duplicates (same underlying problem described differently).4. **If a duplicate is found**:- Comment on the NEW issue explaining it's a duplicate, linkingto the original with `#<number>`- Close the NEW issue as "not planned"- Comment on the ORIGINAL issue tagging the reporter and anymentioned users for visibility- Add the `duplicate` label to the new issue5. **If NO duplicate is found**:- Call the `noop` safe output with a summary message.## Guidelines- **Be conservative**: Only close if you are confident it is trulya duplicate. When in doubt, leave it open.- **Prefer the older issue**: Always close the newer one.- **Be helpful**: Comments should be polite and explain why youbelieve it's a duplicate.