Skip to content
GitHub Agentic Workflows

Upgrading Agentic Workflows

This guide walks you through upgrading your agentic workflows to the latest version, ensuring you have access to the newest features, improvements, and security fixes.

The upgrade process updates three key areas:

  1. Agent and prompt files — GitHub Copilot instructions, dispatcher agent, and workflow creation prompts
  2. Workflow syntax — Automatically migrates deprecated fields and applies the latest configuration patterns
  3. Workflow compilation — Automatically compiles all workflows to generate up-to-date .lock.yml files

Before upgrading, ensure you have GitHub CLI (gh) v2.0.0+, the latest gh-aw extension, and a clean working directory in your Git repository. Verify with gh --version, gh extension list | grep gh-aw, and git status.

Upgrade the gh-aw extension to get the latest features and codemods:

Terminal window
gh extension upgrade gh-aw

Check your version with gh aw version and compare against the latest release. If you encounter issues, try a clean reinstall with gh extension remove gh-aw followed by gh extension install github/gh-aw.

Create a backup branch (git checkout -b backup-before-upgrade) or ensure your changes are committed and pushed. Since workflows are tracked in Git, you can always revert changes with git checkout HEAD~1 -- .github/workflows/my-workflow.md.

Run the upgrade command from your repository root:

Terminal window
gh aw upgrade

This command performs three main operations:

The upgrade updates these files to the latest templates (similar to running gh aw init):

  • .github/aw/github-agentic-workflows.md — GitHub Copilot custom instructions
  • .github/agents/agentic-workflows.agent.md — Dispatcher agent for routing tasks
  • .github/aw/create-agentic-workflow.md — Prompt for creating new workflows
  • .github/aw/update-agentic-workflow.md — Prompt for updating existing workflows
  • .github/aw/create-shared-agentic-workflow.md — Prompt for shared workflows
  • .github/aw/debug-agentic-workflow.md — Prompt for debugging workflows
  • .github/aw/upgrade-agentic-workflows.md — Prompt for upgrade guidance

The upgrade automatically applies codemods to fix deprecated fields in all workflow files (.github/workflows/*.md):

CodemodWhat It FixesExample
timeout-minutes-migrationReplaces timeout_minutes with timeout-minutestimeout_minutes: 30timeout-minutes: 30
network-firewall-migrationRemoves deprecated network.firewall fieldDeletes firewall: mandatory
sandbox-agent-false-removalRemoves sandbox.agent: false (firewall now mandatory)Deletes agent: false
safe-inputs-mode-removalRemoves deprecated safe-inputs.mode fieldDeletes mode: auto
schedule-at-to-around-migrationConverts daily at TIME to daily around TIMEdaily at 10:00daily around 10:00
delete-schema-fileDeletes deprecated schema fileRemoves .github/aw/schemas/agentic-workflow.json
delete-old-agentsDeletes old .agent.md files moved to .github/aw/Removes outdated agent files

The upgrade automatically compiles all workflows to generate or update .lock.yml files, ensuring they’re ready to run in GitHub Actions.

Example output:

Updating agent and prompt files...
✓ Updated agent and prompt files
Applying codemods to all workflows...
Processing workflow: daily-team-status
✓ Applied schedule-at-to-around-migration
✓ Applied timeout-minutes-migration
Processing workflow: issue-triage
✓ Applied safe-inputs-mode-removal
All workflows processed.
Compiling all workflows...
✓ Compiled 3 workflow(s)
✓ Upgrade complete
Terminal window
# Standard upgrade (updates agent files + applies codemods + compiles workflows)
gh aw upgrade
# Verbose output (shows detailed progress)
gh aw upgrade -v
# Update agent files only (skip codemods and compilation)
gh aw upgrade --no-fix
# Upgrade workflows in custom directory
gh aw upgrade --dir custom/workflows

After upgrading, carefully review all changes before committing:

Review changes with git diff .github/workflows/ to verify that deprecated fields are updated, formatting is preserved, and workflow logic remains intact.

Typical migrations include timeout_minutestimeout-minutes, daily atdaily around, and removal of deprecated network.firewall and safe-inputs.mode fields. Use git diff --word-diff for detailed comparison.

The upgrade automatically compiles workflows. To validate specific workflows, run gh aw compile my-workflow --validate. Common issues include invalid YAML syntax, deprecated fields (fix with gh aw fix --write), or incorrect schedule format. See the schedule syntax reference for details.

Verify that each .md workflow has a corresponding .lock.yml file with git status | grep .lock.yml. Never edit .lock.yml files directly—they’re auto-generated. Always edit the .md source and recompile.

Test workflows locally with gh aw status and gh aw compile my-workflow --validate. Trigger manual runs with gh aw run my-workflow and monitor with gh aw logs my-workflow. If using MCP servers, verify configuration with gh aw mcp list. Consider testing in a draft PR before merging to production.

Stage and commit your changes:

Terminal window
git add .github/workflows/ .github/aw/ .github/agents/
git commit -m "Upgrade agentic workflows to latest version"
git push origin main

For better traceability, consider separate commits for agent files, workflow migrations, and lock files. Always commit both .md and .lock.yml files together—never add .lock.yml to .gitignore.

Extension upgrade fails: Try a clean reinstall with gh extension remove gh-aw && gh extension install github/gh-aw.

Codemods not applied: Manually apply with gh aw fix --write -v.

Compilation errors: Review errors with gh aw compile my-workflow --validate and fix YAML syntax in source files.

Workflows not running: Verify .lock.yml files are committed, check status with gh aw status, and confirm secrets are valid with gh aw secrets bootstrap.

Breaking changes: Revert with git checkout backup-before-upgrade and review release notes.

Upgrading across versions: Review the changelog for cumulative changes.

Custom directories: Use gh aw upgrade --dir custom/workflows.

Selective codemods: Apply specific workflows with gh aw fix my-workflow --write or skip codemods with gh aw upgrade --no-fix.

CI/CD automation: Automate upgrades with a scheduled workflow that creates PRs. Always review automated upgrade PRs before merging.

Upgrade regularly to stay current with features and security fixes. Always review changes, test workflows, and read release notes. Keep backups using Git branches for easy rollback.

Learn about new features in the changelog, explore the frontmatter reference, review best practices, or browse the agentics collection.

Need help? Check the troubleshooting guide or open an issue.