Event-based automations
Event-based automations run when something happens—a PR is opened, an issue is commented on, or a webhook fires—instead of on a schedule. This is ideal for responsive workflows like auto-reviewing PRs, triaging issues, or reacting to external service events.
Prerequisites for GitHub event automations
GitHub event automations require some one-time setup before events will flow. If any step is missing, automations will appear to work (manual triggers succeed) but GitHub events will silently never arrive.
1. Install the Faheem Code GitHub app
The Faheem Code GitHub App must be installed on the GitHub organization that owns the repositories you want to monitor. Install it from your GitHub integration settings. The app needs access to the repositories that will generate events.
2. Create an Faheem Code team organization
If you're working with repositories owned by a GitHub organization (e.g., myorg/my-repo), you need an Faheem Code team organization — not just a personal account. GitHub events for org repos are routed to team orgs, not personal orgs.
If you don't already have one, create a team organization — see What Are Organizations for details and how to get started.
3. Claim your GitHub organization
Your Faheem Code team org must claim the GitHub organization to establish the link between GitHub webhooks and your Faheem Code org. Claiming tells the event router: "Events for repos in this GitHub org should go to this Faheem Code team org."
To claim a GitHub org:
- Switch to your team org using the org switcher in the sidebar
- Go to Organization Settings
- In the Git Conversation Routing section, find your GitHub org
- Click Claim
You must be an Owner of the Faheem Code team org and have admin access to the GitHub org to complete the claim. See Claiming Git Organizations for full details.
4. Create the automation under the team org
Make sure you are switched to the team org (not your personal org) when creating the automation. The automation must live in the same org that claimed the GitHub organization — otherwise events won't match.
5. (Optional) add service accounts to the team org
If you're using a service account (like a bot account) to create or own automations, that account must be a member of the team org. Invite them from the Organization Members page.
Troubleshooting
If your automation doesn't trigger on GitHub events:
GitHub app not installed on the org
The Faheem Code GitHub App must be installed on the GitHub organization that owns your repositories. Go to GitHub integration settings and verify it is installed with access to the relevant repos. Without this, no webhook events are sent to Faheem Code.
GitHub org not claimed
The most common cause. Go to Organization Settings → Git Conversation Routing and check if your GitHub org shows as claimed. If not, click Claim. See Claiming Git Organizations.
Automation in personal org instead of team org
GitHub events for org repos are routed to the team org that claimed the GitHub org. If you created the automation under your personal org, events will never reach it. Switch to the team org and recreate the automation.
Event type or filter mismatch
Double-check that the event type (e.g., pull_request.labeled) and filter expression match the action you're testing. Use wildcards like pull_request.* to match all actions during debugging.
Automation is disabled
Verify the automation is enabled. You can check via the automations list or by asking Faheem Code to list your automations.
Built-in vs. custom integrations
| Type | Setup | Best For |
|---|---|---|
| Built-in (GitHub) | One-time org setup (see above), then create the automation | PR reviews, issue triage, push-triggered tasks |
| Custom Webhooks | Register webhook first, then create automation | Linear, Stripe, Slack, and other services |
GitHub events (built-in)
GitHub is a built-in integration. Create automations that respond to GitHub events without any webhook setup.
Example: auto-review PRs with a specific label
When a PR is labeled with faheemcode, automatically review it:
Create an event-based automation called "Auto Review PRs" that triggers
when a pull request is labeled with "faheemcode" in any of my repos.
It should review the PR for code quality and best practices, then post
the review as a comment.
The agent will create an automation with:
- Trigger type:
event - Source:
github - Event:
pull_request.labeled - Filter: Matches PRs labeled
faheemcode
Example: respond to @faheem-code mentions
Create an automation that responds when someone mentions @faheem-code
in an issue comment. It should analyze the issue context and provide
a helpful response.
Available GitHub events
| Event | Common Actions | Use Case |
|---|---|---|
pull_request | opened, labeled, synchronize, ready_for_review | PR automation |
issues | opened, labeled, assigned | Issue triage |
issue_comment | created | Mention responses |
push | — | Branch-based triggers |
release | published | Release workflows |
Use wildcards like pull_request.* to match all actions for an event type.
Filtering events
Filters let you narrow which events trigger your automation. They use JMESPath expressions to match fields in the event payload—so you can trigger only on specific labels, users, branches, or other conditions.
Common filter patterns:
contains(pull_request.labels[].name, 'faheemcode')
icontains(comment.body, '@faheem-code')
glob(repository.full_name, 'myorg/*')
ref == 'refs/heads/main'
glob(repository.full_name, 'myorg/*') && contains(pull_request.labels[].name, 'bug')
contains(...)— match a specific labelicontains(...)— case-insensitive mention in a comment bodyglob(...)— match repos in your org with wildcards==— exact match (e.g., push to main branch only)&&— combine multiple conditions
Custom webhooks
For services beyond GitHub—like Linear, Stripe, or Slack—register a custom webhook first, then create automations that use it.
Walkthrough: Linear integration
Step 1: get your webhook secret from Linear
Linear provides the webhook signing secret—you cannot configure your own.
- Go to Linear Settings → API → Webhooks
- Click New webhook
- Copy the signing secret that Linear displays (you'll need this in the next step)
- Leave the webhook URL blank for now—you'll get it from Faheem Code
Step 2: register the webhook with Faheem Code
First, set up your environment variables:
- Create an Faheem Code API key at app.faheemcode.ai/settings/api-keys
- Export the API key and the webhook secret from Step 1:
export FAHEEMCODE_API_KEY="example-user-api-key"
export LINEAR_WEBHOOK_SECRET="your-linear-signing-secret-from-step-1"
Then run the following command to register the webhook:
curl -X POST "https://app.faheemcode.ai/api/automation/v1/webhooks" \
-H "Authorization: Bearer ${FAHEEMCODE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"name": "Linear Issues",
"source": "linear",
"event_key_expr": "type",
"signature_header": "Linear-Signature",
"webhook_secret": "'"${LINEAR_WEBHOOK_SECRET}"'"
}'
The response includes a webhook_url that you'll configure in Linear.
Understanding event_key_expr
The event_key_expr is a JMESPath expression that extracts the event type from incoming webhook payloads. This extracted value is what you match against in the automation's on field.
For example, Linear sends payloads like:
{"type": "Issue", "action": "create", "data": {...}}
With event_key_expr: "type", the system extracts "Issue" as the event type. Then in your automation, you set on: "Issue" to match it.
Step 3: complete the Linear webhook configuration
- Return to the Linear webhook you started in Step 1
- Paste the
webhook_urlfrom the previous step - Select which events to send (e.g., Issues, Comments)
- Save the webhook
Step 4: create the automation
Now the webhook is registered, the agent can create automations for you end-to-end. Just describe what you want:
Create an event-based automation called "Triage Linear Issues" that triggers
when a new issue is created in Linear.
It should analyze the issue title and description, suggest appropriate labels,
and add a comment with initial triage notes.
The agent creates the automation with:
- Source:
linear(your registered webhook) - Event:
Issue(Linear's event type) - Filter:
action == 'create'
Custom webhook parameters
When registering any custom webhook, these parameters define how Faheem Code processes incoming events:
| Parameter | Required | Description |
|---|---|---|
name | Yes | Human-readable name |
source | Yes | Unique identifier (lowercase, alphanumeric with hyphens) |
event_key_expr | No | JMESPath to extract event type (default: type) |
signature_header | No | Header containing HMAC signature (default: X-Signature-256) |
webhook_secret | No | Signing secret—provide yours or let the system generate one |
Common services
These are example configurations for popular services. Always verify with each service's webhook documentation, as signature headers and payload formats may change.
| Service | Signature Header | Event Key | Notes |
|---|---|---|---|
| Linear | Linear-Signature | type | |
| Stripe | Stripe-Signature | type | Uses a custom t=timestamp,v1=signature format — verify compatibility |
| Slack | X-Slack-Signature | type | |
| Twilio | X-Twilio-Signature | type | Uses HMAC-SHA1 of request URL + params — verify compatibility |
Next steps
New to automations? Start with the Automations Overview for the bigger picture, including cron-based scheduling and general concepts.
- Automations Overview — Cron-based automations and general concepts
- Managing Automations — Update, disable, or delete automations