> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Session updated

> Starts an automation when session configuration changes.

`anthropic.onSessionUpdated` starts an automation when session configuration changes. It corresponds to the `session.updated` Anthropic webhook event.

## Example

```ts automations/anthropic-on-session-updated.automation.ts theme={null}
import { automation } from "automate.ax"
import { anthropic } from "automate.ax/anthropic"

export default automation("Session updated", () => {
  const event = anthropic.onSessionUpdated()

  anthropic.getSession({ sessionId: event.resourceId })
})
```

## Options

Pass `account` to select a named Anthropic Managed Agents connection. The connection must include the workspace's webhook signing key.

## Event

Returns a verified event with `id`, `createdAt`, `providerEventType`, `organizationId`, `workspaceId`, `resourceId`, `sessionThreadId` (`string` for thread lifecycle events, otherwise `null`), and the authoritative `resource`. Deleted resources are `null`. Session-idled events also include the latest `session.status_idle` event and its typed stop reason.

Anthropic can retry or reorder deliveries. Automate.ax deduplicates the provider event ID, verifies five-minute signature freshness, and fetches current provider state before starting an independent root context.
