What you’ll build
An agent that triggers when a GitHub issue is labeled"agent". The agent runs, processes the issue, and you see the result in your terminal.
Prerequisites
- An Action Llama project with an agent (see Getting Started)
- A GitHub repo you control
- A GitHub Personal Access Token (the agent already has one if you ran
al doctor)
1. Add a webhook source to config.toml
Define a named webhook source in your project’s config.toml:
2. Add the credential
openssl rand -hex 20). Save this value — you’ll need it when configuring GitHub.
3. Add a webhook trigger to your agent
In your agent’sconfig.toml, add a webhook trigger:
"agent". You can also filter by repo:
4. Start ngrok for local development
Your local machine isn’t reachable from the internet, so GitHub can’t deliver webhooks directly. Use ngrok to create a tunnel:https://abc123.ngrok-free.app).
5. Configure the GitHub webhook
In your GitHub repo:- Go to Settings > Webhooks > Add webhook
- Payload URL:
https://abc123.ngrok-free.app/webhooks/github(your ngrok URL +/webhooks/github) - Content type:
application/json - Secret: paste the same secret you used in step 2
- Events: select “Let me select individual events” and check Issues
- Click Add webhook
6. Start the scheduler
7. Test it
Go to your GitHub repo, open (or create) an issue, and add the label"agent".
In your terminal, you should see the agent pick up the webhook event and start running. Check the logs:
How it works
- GitHub sends a POST request to your ngrok URL when the issue is labeled
- The gateway receives it at
/webhooks/github, verifies the HMAC signature against your secret - The event is matched against your agent’s webhook filters (
events: issues,actions: labeled,labels: agent) - The agent is triggered with the full webhook payload injected into its prompt as a
<webhook-trigger>block
Next steps
- Deploying to a VPS — deploy to avoid needing ngrok
- Webhooks Reference — all providers and filter fields
- Scaling Agents — handle high webhook volume with parallel instances