# Automation Project Files and type.json

> The folder layout of a Type.com code automation project: type.json, fixtures.json, the .type folder, and which files are uploaded.

Canonical page: https://docs.type.com/automations/reference/project-files/

A code automation project is a folder. You deploy it with `type-cli automations deploy`.

- my-automation/
  - type.json the project settings
  - fixtures.json optional test cases
  - src/
    - main.ts the entrypoint
    - format.ts other modules
  - .type/ made by the CLI; never uploaded
    - project.json
    - deployment.json

## `type.json`

```json title="type.json"
{
  "name": "Hourly check",
  "description": "Record the scheduled time in run history",
  "entrypoint": "src/main.ts"
}
```

| Field | Required | Default | Rules |
| --- | --- | --- | --- |
| `name` | Yes | — | 1 to 200 characters. Must be unique in the Space. |
| `description` | No | — | At most 2,000 characters. |
| `entrypoint` | No | `src/main.ts` | The file that default-exports `automation({ deployment, output, stages })`. Ends in `.ts`, `.js`, `.mts`, or `.mjs`. 1 to 255 characters. |
| `expiration` | No | The source value | An [expiration](https://docs.type.com/automations/reference/deployment/index.md#expiration) that replaces `deployment.expiration` in the source. `null` removes the expiration. |
| `integrationAccounts` | No | — | At most 50 `{ "organizationIntegrationId", "integrationAccountId" }` pairs. Each pair picks the saved account that the automation uses for that connection. |

`type.json` must be a regular file of at most 64 KiB. Type rejects unknown fields.

An expiration flag on `type-cli automations deploy` replaces both `type.json` and the source for that deploy. See [CLI Reference](https://docs.type.com/automations/reference/cli/index.md#automations-deploy).

## Which files Type uploads

The CLI reads the folder and uploads only source files.

| Rule | Detail |
| --- | --- |
| File types | Only names that end in `.ts`, `.js`, `.mts`, `.mjs`, or `.json`. The CLI skips other files, for example `.md`, `.tsx`, and `.yaml`. |
| Hidden files | Files and folders whose names start with `.` are skipped, for example `.env` and `.type/`. |
| Symbolic links | Skipped. |
| Ignore files | The CLI follows `.gitignore` and `.typeignore` in each folder. Their rules apply to that folder and the folders inside it. A `!` rule includes a file again. |
| Folders | `node_modules`, `dist`, `build`, `coverage`, `generated`, and `vendor` are skipped at all levels. |
| Config and secrets | `type.json`, `package.json`, `tsconfig.json`, `credential.json`, `credentials.json`, `secret.json`, `secrets.json`, and `service-account.json` are skipped. So are the same names with more text after a `.` or `-`, for example `package-lock.json`, `tsconfig.build.json`, or `secrets-prod.json`. The match is not case-sensitive. |
| Tests | Names that end in `.test.<ext>`, `.spec.<ext>`, `.generated.<ext>`, or `.d.ts` are skipped, for example `format.test.ts`. |
| Root `fixtures.json` | Read as test cases, not uploaded as code. A `fixtures.json` in a subfolder is uploaded as a normal module. |

> **Caution:** Do not put credentials in source files. The skip rules above are a safety net, not a guarantee. Type gives credentials to your code through connections.

### Size limits

- At most 256 files.
- At most 1 MiB for all files together, including `fixtures.json`.
- The source files, as JSON, must also fit in 1 MiB.
- Each file path is 1 to 255 characters. Paths must be relative, with no `.` or `..` parts, backslashes, or control characters.
- These paths are reserved: `node_modules`, `.type-installed`, and `.type-contract`.
- Each `.gitignore` and `.typeignore` is at most 64 KiB.

### Dependencies

Type.com does not install packages. A `package.json` file is not uploaded. Your code can import only the [allowed modules](https://docs.type.com/automations/reference/sdk/index.md#allowed-imports-in-automation-code) and relative files in the project.

## `fixtures.json`

An optional array of test cases. Type runs them during each deploy. If one fails, the deploy fails. See [Test with Fixtures](https://docs.type.com/automations/testing/index.md).

This fixture tests the entrypoint below:

```json title="fixtures.json"
[
  {
    "name": "records the scheduled time",
    "subscriptionId": "hourly",
    "payload": { "scheduledAt": "2026-10-07T12:00:00.000Z" },
    "toolResponses": [],
    "expectedOutput": { "checkedAt": "2026-10-07T12:00:00.000Z" }
  }
]
```

```ts title="src/main.ts"
import {
  automation,
  code,
  complete,
  recurringEventSchema,
} from "@type-dot-com/sdk/automations";

export default automation({
  output: z.object({ checkedAt: z.string() }),
  deployment: {
    subscriptions: {
      hourly: {
        title: "Hourly check",
        description: "Record the scheduled time in run history",
        source: {
          kind: "recurring",
          schedule: { kind: "interval", everySeconds: 3600 },
        },
        entry: "record",
      },
    },
  },
  stages: {
    record: code({
      input: recurringEventSchema,
      run: ({ input }) => complete({ checkedAt: input.scheduledAt }),
    }),
  },
});
```

| Field | Required | Rules |
| --- | --- | --- |
| `name` | Yes | 1 to 120 characters. Unique in the file. |
| `subscriptionId` | Yes | The subscription key to run. |
| `payload` | Yes | The event, in the same shape as a live event. For `debounce.delivery: "batch"`, an array of events. Not used when `stage` is set. |
| `stage` | No | `{ name, input }`: run this stage with this input instead of the entry stage. For the stage after an agent, `input` is the `{ taskInput, result, receipt }` envelope. See [What a fixture runs](https://docs.type.com/automations/testing/index.md#what-a-fixture-runs). |
| `checkpoint` | No | The value of `ctx.checkpoint.value` for this case. Without it, `ctx.checkpoint` is `null`. |
| `environment` | No | Test values for [environment variables](https://docs.type.com/automations/reference/context/index.md#environment-variables), as strings. Fixtures never read the Space's saved values. |
| `matcher` | No | Simulated matcher results: `{ decision?: "match" \| "skip", ownSlackUserId?, jev?: { model, answers } }`. See [Test matchers](https://docs.type.com/automations/reference/matchers/index.md#test-matchers). |
| `toolResponses` | No | At most 128 `{ request, response }` pairs for `ctx.tools.call`, `ctx.read.call`, and `ctx.write.call`. |
| `integrationResponses` | No | At most 128 `{ request, response }` pairs for `ctx.read.request` and `ctx.write.request`. |
| `expectedOutput` | No | The exact JSON value that the stage passes to `complete()` or `blocked()`. |
| `expectedError` | No | Text that the error message must contain. 1 to 2,000 characters. |

- A file can have at most 20 cases.
- Do not set both `expectedOutput` and `expectedError` in one case.
- A case runs one stage: the subscription's entry stage, or the stage that `stage` names. It does not follow `next()` to other stages, and it does not start agent stages.
- Omit both `expectedOutput` and `expectedError` for an event that a matcher or a resource filter skips. Such a case must not have `toolResponses` or `integrationResponses`.

## `.type/project.json`

```json
{ "projectId": "0b5a8f2e-7c1d-4e3f-9a6b-2c4d6e8f0a1b" }
```

The CLI makes this file at the first deploy, before it sends anything. Type uses the project ID and the Space to find the automation.

- Keep this file, and commit it to version control.
- If you delete it, the next deploy makes a new automation.
- If you copy the folder, also make a new project ID, or the two folders update the same automation.

## `.type/deployment.json`

The CLI writes this file at each deploy. It records the last attempt:

```json
{
  "projectId": "0b5a8f2e-...",
  "deploymentId": "3f6c2a4e-...",
  "automationId": "atask_01k...",
  "serverUrl": "https://api.type.com",
  "space": "engineering"
}
```

The CLI saves `deploymentId` before it sends the project, and adds `automationId`, `serverUrl`, and `space` when Type answers. Use `deploymentId` with `type-cli automations deployment` to read the result of an interrupted deploy. The CLI does not read this file to continue a deploy.
