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

# Insert rows

> Insert header-keyed rows at a specific Google Sheets row number.

`insertRows` shifts existing rows down and writes new records atomically.

## Example

```ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { insertRows } from "automate.ax/google-sheets"

export default automation("Insert a priority order", () => {
  onHttpRequest({ scope: "automation" })

  insertRows({
    spreadsheet: "spreadsheet-id",
    source: { sheet: "Orders" },
    rowNumber: 2,
    rows: { "Order ID": "A-1042", Status: "Priority" },
  })
})
```

## Inputs

`spreadsheet`, `source`, one-based `rowNumber`, and one or more header-keyed
`rows` are required. Record and `inputMode` behavior match [Append rows](/reference/integrations/google-sheets/actions/append-rows#inputs).
The position must be in the source body or immediately after its current end.

`account` optionally selects the Google account binding.

## Output

Returns `{ affectedCells, rowNumbers, updatedRange }`. `rowNumbers` contains
the consecutive new rows. Formatting is inherited from the previous body row
when inserting below the first body row.
