Study FAQ
How do I author and compile a GitHub Agentic Workflow?
Also asked as 2
- What is the Markdown-to-lock-file workflow for gh-aw?
- How should I create, compile and update a GitHub Agentic Workflow?
Answer
Create a Markdown workflow in .github/workflows/, put configuration in YAML frontmatter and the agent's task in the Markdown body, then compile it into a companion .lock.yml GitHub Actions workflow. Review and version both files together; compilation validates configuration rather than proving runtime success or report accuracy.
You need repository write access, enabled GitHub Actions, an AI-engine account, authenticated GitHub CLI v2.0.0 or later and the github/gh-aw extension. In a terminal, gh --version checks the CLI version and gh extension install github/gh-aw installs the extension. Run gh aw init from the repository for first-time authoring support; it adds skills, instructions and a custom agent.
Define on, engine, tools, necessary read permissions and reviewed safe outputs. State the input scope, reporting period, required evidence and missing-data behavior in the instructions. Engine authentication must be configured separately.
From the repository root, run:
gh aw compile
This compiles workflows and can refresh multiple lock files. Check the actual exit result and diagnostics, then inspect the complete diff and the current companion file. An old lock file left on disk is not evidence that the edited source compiled. For an unclear failure, gh aw compile --verbose provides diagnostics; fix the named source defect and compile again.
Keep the source revision, tool versions, compiler result and reviewed source/lock diff. When changing requirements, edit Markdown, recompile and review both artifacts. A new input type, trigger or write effect needs an authority review as well as wording changes. Test an authorized Actions run separately and inspect its logs, resource changes and output.
References: Creating GitHub Agentic Workflows - GitHub Docs, Error Reference, Security Architecture.
Full explanation
GH-700: Author and Compile GitHub Agentic Workflows
Study guide · GH-700
Read the full explanation