> ## 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.

# On document created

> Run an automation when Linear reports document created.

`linear.onDocumentCreated` handles document created in the connected Linear workspace.

```ts automations/watch-linear-document.automation.ts theme={null}
import { automation } from "automate.ax"
import { linear } from "automate.ax/linear"

export default automation("On document created", () => {
  const event = linear.onDocumentCreated()
  // Sync the Linear document to the knowledge base.
})
```

Optional static `account` defaults to the project binding. Linear webhook triggers require an OAuth connection with read access. The workspace can't change at runtime.

## Trigger data

Returns a `Signal<LinearDocumentWebhookDataTrigger>`:

```ts theme={null}
type LinearDocumentWebhookDataTrigger = LinearDocumentWebhookData & {
  event: LinearWebhookEvent<LinearDocumentWebhookData, "create">
}

interface LinearDocumentWebhookData {
  archivedAt?: string | null
  color?: string | null
  content?: string | null
  createdAt: string
  creatorId?: string | null
  hiddenAt?: string | null
  icon?: string | null
  id: string
  initiativeId?: string | null
  projectId?: string | null
  slugId: string
  sortOrder: number
  title: string
  trashed?: boolean | null
  updatedAt: string
  updatedById?: string | null
}

interface LinearWebhookEvent<TData, TAction extends string> {
  action: TAction
  actor?: LinearActor | null
  createdAt: string
  data: TData
  organizationId: string
  type: "Document"
  updatedFrom?: Record<string, JSONValue> | null
  url?: string | null
  webhookId: string
  webhookTimestamp: number
}

interface LinearActor {
  email?: string
  id?: string
  name?: string
  type?: string
  url?: string
}
```

Documents can belong to a project or initiative. Archived, hidden, and trashed state remain separate provider fields. Resource objects and the webhook envelope retain extra Linear fields.
