Ren

Automations

A space’s automations live in two files in its folder, schedules.yaml and webhooks.yaml. Each key in them is the slug of one automation.

Add a schedule

This schedule has the planner plan the week every Monday at 9:00 in New York. Each run starts a new chat in Engineering with the message:

spaces/engineering/schedules.yaml
weekly-triage:
  agent: planner
  cron: "0 9 * * 1"
  timeZone: America/New_York
  message: Review the open issues of acme/example-app and plan next week.

Schedules

KeyRequiredWhat it sets
cronYesWhen it runs, as a cron expression with five fields
timeZoneYesThe IANA time zone of the cron, such as Europe/Berlin
messageYesWhat the agent does each run
agentNoThe agent of each chat. If you leave it out, the chat gets the space’s default settings.
nameNoThe name in the app. Defaults to the slug.
untilNoThe last time it runs, in UTC
enabledNofalse pauses it. The default is true.

This schedule runs the tests every night until the end of March 2027, and is paused for now:

spaces/engineering/schedules.yaml
nightly-tests:
  name: Nightly tests
  agent: tester
  cron: "30 2 * * *"
  timeZone: UTC
  message: Run the full test suite of acme/example-app and report failures.
  until: "2027-03-31T23:59:00Z"
  enabled: false

Webhooks

A webhook in webhooks.yaml is either custom, with its own message and rules, or a preset that one of the space’s apps offers.

Custom webhooks

This webhook has the planner triage alerts that a monitoring service signs with HMAC-SHA256:

spaces/engineering/webhooks.yaml
alerts:
  name: Production alerts
  agent: planner
  message: Triage this alert and open a task if it needs a fix.
  signature:
    kind: hmac
    header: x-signature
    encoding: hex
    prefix: sha256=
  filter: body.kind == "alert"
  eventId: headers["x-delivery-id"]
  threadKey: body.alert.id
  title: body.alert.title

Only message is required, and name and agent work as they do for a schedule. The other four keys are rules: CEL expressions that read the request’s method, query, headers and body. Write header names in lowercase.

KeyIn the appWhat it returns
filterStart a session whenA bool. Only a request where it is true starts or continues a chat. Without it, every request does.
threadKeySession continuation keyA string. Requests with the same value continue one chat.
eventIdEvent identifierA string unique to each delivery, such as a delivery-ID header. Ren ignores a value it has already seen, so a retry doesn’t run twice.
titleSession titleA string, used as the title of a new chat

signature sets how Ren checks that a request really comes from the sender. Use none only when the sender can’t sign its requests.

kindOther keysRen checks
noneThe token in the URL only. The default.
headerheaderThat the header equals the signing secret
hmacheader, encoding (hex or base64), prefixThe HMAC-SHA256 of the body with the signing secret, in the header after prefix
standardThe Standard Webhooks signature (Svix, Clerk, Resend)
stripeThe stripe-signature header

App presets

To turn on a preset, name the app and the preset’s key in that app’s webhooks:

spaces/engineering/webhooks.yaml
pull-requests:
  app: engineering-tools
  preset: pull-requests
  agent: reviewer

A preset takes only app, preset, agent and mode. Its name, message and rules come from the app, so change them there; see Webhook presets.

Listening and live

A new webhook starts out listening (Debug in the app): Ren records each request but starts no chat, so you can test your rules safely. It starts and continues chats once you set mode: live.

A webhook that checks a signature needs a signing secret before it can go live, and a spec never holds secrets. So going live takes two applies:

  1. Declare it without mode, then plan and apply.

  2. Find its ID and URL:

    ren webhook list --space engineering | jq '.items[] | {slug, id, url}'
  3. Paste the URL into the other service, and set the secret it gave you:

    ren webhook set-signing-secret <webhook-id> --secret <secret>

    Without --secret, Ren generates a secret and prints it once. You can also select Set secret in the app.

  4. Send a test event, and run ren webhook test <webhook-id> to see what the rules do with the recorded requests.

  5. Add mode: live, then plan and apply.

A preset with secret: ren skips these steps. Ren generates its secret when apply turns it on, so you can declare it live right away.