AI agents with PlanetScale webhooks

Receive PlanetScale webhooks on Trigger.dev and use them to start, resume or message your AI agents.

Get started now

What you can do with PlanetScale webhooks

Start an agent

PlanetScale events can start a new agent run. For example, an agent that reviews every PlanetScale deploy request.

Resume an agent

An agent can pause until the PlanetScale event it needs arrives, for up to 90 days, and costs nothing while it waits.

Message an agent

PlanetScale events can land in a running agent's conversation, so it acts on them with full context.

Events you can receive from PlanetScale

Some of the events PlanetScale sends. Your agent can filter on any of them.

branch.ready

Branch ready

deploy_request.opened

Deploy request opened

deploy_request.schema_applied

Deploy request schema applied

branch.schema_recommendation

Schema recommendation created

cluster.storage

Cluster storage threshold

webhook.test

Webhook test

Example

An agent that reviews every PlanetScale deploy request

import { webhook, webhooks } from "@trigger.dev/sdk";
export const planetscale = webhooks.endpoint.define({
id: "planetscale",
source: webhooks.planetscale(),
});
export const planetscaleEvents = webhook({
id: "planetscale-events",
endpoint: planetscale,
filter: "event.event == 'deploy_request.opened'",
onEvent: async ({ event }) => {
// Start, resume or message your agent with the event
console.log(event);
},
});

Handled for you

Verified for you

webhooks.planetscale() checks the X-PlanetScale-Signature header on every request. Bad requests are rejected before anything runs.

Filter before anything runs

Only the PlanetScale events you care about start a run. Filtered webhooks use no compute.

See every delivery

Every webhook is recorded with its payload, headers and the agents it reached, so you can debug it and replay it.

Get started

  1. 1

    Set up the agent

    Copy the starter prompt into your coding agent, like Claude Code, Cursor or Codex. It creates a Trigger.dev project and adds the webhook endpoint. Prefer to write it yourself? Start from the example above.

  2. 2

    Add the webhook in PlanetScale

    Deploy your project, or run trigger dev, and the endpoint appears on the Webhooks page of the Trigger.dev dashboard with its URL. Add that URL in PlanetScale's webhook settings and pick the events you need. The endpoint's Copy setup prompt button gives your coding agent the exact steps.

  3. 3

    Add PlanetScale's signing secret

    Copy the signing secret from PlanetScale. Then on the endpoint's page in the Trigger.dev dashboard, choose Set signing secret and paste it in, so Trigger.dev can check every request really came from PlanetScale.

  4. 4

    Try it

    Send a test event from PlanetScale, or use the endpoint's Test tab. It appears on the endpoint's Deliveries tab, with the agents it reached.

Related integrations

Ready to build with PlanetScale webhooks?

Declare an endpoint, deploy, and paste the URL into your provider.

Get started for free