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

# List files

> Search files with Google Drive query syntax.

`googleDrive.listFiles` search files with Google Drive query syntax.

## Example

```ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { googleDrive } from "automate.ax/google-drive"

export default automation("List files", () => {
  onDashboardRun({ title: "List files" })
  googleDrive.listFiles({
    query: "name contains 'invoice'",
    orderBy: "modifiedTime desc",
  })
})
```

## Inputs

Use `query`, `orderBy`, `corpus`, `driveId`, `pageSize`, and `pageToken` to narrow or page results. `pageSize` accepts 1 through 1,000. Providing `driveId` selects that shared drive's corpus when you omit `corpus`. If you set `corpus` explicitly, provide `driveId` exactly when `corpus` is `"drive"`. Trashed files are excluded unless `includeTrashed` is true. A second argument with `account` selects a Google Account.

## Output

Returns `files`, `incompleteSearch`, and an optional `nextPageToken`. When `incompleteSearch` is true, Google could not search every requested corpus; narrow the corpus or retry the request.
