Write Your First Agentic Workflow
August 9, 2026 · View on GitHub
Writing your first workflow is the moment theory becomes practice — let's make something real.
:dart: What You'll Do
You'll use Copilot to create .github/workflows/daily-report-status.md — a scheduled workflow that also supports manual dispatch. You'll configure it with permissions, safe-outputs, and a task brief, then compile it to produce daily-report-status.lock.yml, the file GitHub Actions runs.
:clipboard: Before You Start
- Completed Install the gh-aw CLI Extension
- The
gh awcommand works in your terminal - You already ran
gh aw initand pushed.github/skills/agentic-workflows/
Verify Copilot access before you begin.
- In the terminal that is already open in your Codespace, run:
gh copilot
- In Copilot CLI, send this prompt:
/agentic-workflows what trigger does a scheduled workflow use?
Confirm you receive a reply. Any response means Copilot CLI and the agentic-workflows skill are accessible.
Important
If you see an error instead of a reply, do not continue. Fix the access issue first — model-access errors will cause Step 8 to fail. Check github.com/settings/copilot, then see Confirm Model Access for detailed troubleshooting.
- I opened Copilot CLI in the terminal and received a reply to the test prompt
Create your first workflow
Note
Use the AI agent that runs your agentic workflows (Copilot, Claude, Codex, or whichever you configured) for all agentic workflow tasks in this workshop. Using the same agent locally gives you behavior that matches production — Copilot Chat (Agent Mode) runs in a different harness and may produce different results.
In your AI agent, run this prompt:
/agentic-workflows Create a daily-report-status workflow with:
- name: Daily Report Status
- triggers: daily schedule and workflow_dispatch
- permissions: contents read, issues read, copilot-requests write
- safe-outputs: create-issue
- task brief: "Generate an activity report in a new issue."
Compile it after creating it.
Review the agent's edit, then continue. Prefer this path over hand-editing each line.
What the agent created — the generated file should look roughly like this:
---
name: Daily Report Status
on:
schedule: daily # compiled to a daily GitHub Actions cron schedule
workflow_dispatch: {} # also allows manual runs
permissions:
contents: read
issues: read
copilot-requests: write # required to call the AI model
safe-outputs:
create-issue: # the only write action the agent may perform
---
Generate an activity report for this repository and post it as a new issue.
The frontmatter tells GitHub Actions when to run, what permissions the agent has, and which write action it may use (create-issue). The task brief below the second --- is what the AI agent reads and acts on.
If you hit a compile error, use Side Quest: Using gh aw compile to Catch Errors Early.
Validate, then commit and push
Run:
gh aw compile
Optional while editing: gh aw compile --watch.
Then commit and push:
git add .
git commit -m "Add daily-report-status agentic workflow"
git push
For follow-up edits, keep using an agent with the agentic-workflows skill and avoid manual workflow editing unless you are debugging a specific line-level issue.
✅ Checkpoint
- Copilot access was confirmed in Copilot CLI before starting (test prompt received a reply)
-
.github/workflows/daily-report-status.mdexists and contains anon: schedule:trigger in the frontmatter - The file includes
permissionswithcopilot-requests: write -
gh aw compileexits with no errors and producesdaily-report-status.lock.yml - Both
daily-report-status.mdanddaily-report-status.lock.ymlare committed and pushed tomain - The workflow appears in the Actions tab of your repository under "Daily Report Status"
- You are ready to choose the workflow's billing and authentication method
Next: Confirm Model Access