Skip to main content
anthropic.onSessionRunStarted starts an automation when a session begins or resumes a run. It corresponds to the session.status_run_started Anthropic webhook event.

Example

automations/anthropic-on-session-run-started.automation.ts

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.