## Webhooks Workflows

Webhooks let you react to every new Jam. The workflow recipes below are common patterns, each with steps for one or more no-code platforms, along with a code variant. Every workflow recipe assumes you already have a `jam.created` webhook endpoint. If you don’t, see [Get Started with Webhooks](/content/docs/webhooks/index.html) first.

### Open a PR from a Jam

Hand a new Jam to an agent that reads the bug and opens a fix PR. This workflow runs an LLM agent against your repository. Scope it to a sandbox repo or a narrow set of paths before any merges land near production.

The flow:

1. `jam.created` fires.
2. A GitHub Actions workflow (or any runner you control) runs with the Jam ID.
3. The runner invokes an agent that calls Jam MCP for the recording, logs, network requests, and transcript.
4. The agent writes a patch in a new branch and opens a PR that links back to the Jam.

#### Steps

1. Create `.github/workflows/jam-to-pr.yml` and trigger on `repository_dispatch` with event type `jam-created`.
2. Stand up a function (Netlify, Vercel, Workers) that verifies the Jam signature and POSTs to GitHub’s `repository_dispatch` API with the Jam ID in the client payload.
3. Add the function URL in [Settings → Webhooks](/content/s/settings/webhooks/index.html) and subscribe to `jam.created`.
4. In the workflow, run [Claude Code](https://www.anthropic.com/claude-code) or your agent of choice with the Jam ID. The agent calls Jam MCP for context, edits files, commits, and opens a PR.
5. Restrict the agent to specific paths, set required reviewers on the PR, and run the test suite before any human approves.

```yaml
name: Jam to PR
on:
  repository_dispatch:
    types: [jam-created]

jobs:
  fix:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Run agent
        env:
          JAM_ID: ${{ github.event.client_payload.jamId }}
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          JAM_API_KEY: ${{ secrets.JAM_API_KEY }}
        run: ./scripts/run-agent.sh
```

### Notify Slack on incoming Jams

This workflow posts a Slack message whenever a Jam is captured through a [Recording Link](/content/docs/recording-links/index.html). Pair it with a public-facing Recording Link to collect feedback from your website and ping the team on every new report.

#### Steps

1. Create a Zap in Zapier.
2. Select Webhooks by Zapier as the trigger.
3. Copy the webhook URL.
4. Open [Settings → Webhooks](/content/s/settings/webhooks/index.html), add a new endpoint, paste the Zapier URL, and subscribe to `jam.created`.
5. Open the endpoint’s testing view and click **Send Example**.
6. Return to Zapier and test the trigger.
7. Add **Filter** to send Slack messages only for Recording Link Jams.
8. Add Slack as the action and map webhook fields into the message text.
9. Run a final test, then click **Publish**.

### Auto-file a Linear or Jira ticket

Every `jam.created` event becomes a triage issue with the title, description, captured URL, and a link back to the Jam.

#### Steps

1. Use **Webhooks by Zapier → Catch Hook**, copy the generated URL, and register it in [Settings → Webhooks](/content/s/settings/webhooks/index.html) with the `jam.created` event.
2. Send an example event from Jam.
3. For Linear, choose **Create Issue**. For Jira, choose **Create Issue**.
4. Map the fields appropriately.
5. Run a test and turn on the Zap.

### Prioritize Jams from key accounts

Route Jams captured on key-account domains straight to the team and tag them with a priority label.

#### Steps

1. Trigger on jam.created.
2. Match the `originalUrl` host against a list of key-account domains.
3. If matched, post to a high-priority Slack channel and create a `P0` ticket.
4. If not, fall through to your normal triage flow.

### More patterns

These flows share the same shape: pick up `jam.created`, call [Jam MCP](/content/docs/jam-mcp/index.html) for full context, then do something with it.

- Auto-triage a folder
- Design QA into a PR
- Recordings into artifacts
