---
title: "FunctionFile"
description: "A single source file belonging to a function version. A function version
captures the full file set at the moment it was saved; the run worker
materialises these into a Worker Loader bundle on demand and compiles TS/JS
sources in-isolate via `@cloudflare/worker-bundler`.

Files reference only `versionId`; reach the function via `functionVersion.functionId`."
section: "Reference"
group: "Types"
order: 103
---

## Definition

```ts
interface FunctionFile {
  id: string;
  versionId: string;
  name: string;
  source: string;
  createdAt: string;
}
```

## Fields

| Field       | Type     | Notes                                                                                                              |
| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `id`        | `string` | `readonly` `required`                                                                                              |
| `versionId` | `string` | `required` — Function version this file belongs to.                                                                |
| `name`      | `string` | `required` — Logical file name within the function's source tree (e.g. `index.ts`, `package.json`, `lib/util.ts`). |
| `source`    | `string` | `required` — Raw file contents.                                                                                    |
| `createdAt` | `string` | `readonly` `required` — ISO-8601 timestamp of creation.                                                            |
