# Quickstart: Build Your First Automation

> Make your first instruction automation in a Type.com Space without code, then deploy your first code automation with the Type CLI.

Canonical page: https://docs.type.com/automations/quickstart/

Build your first Type.com automation in two parts. In part 1, you make an instruction automation without code. In part 2, you deploy a code automation with Type CLI.

## Part 1: an instruction automation

You need a Space with the connections that the job uses.

1. Open the Space and ask Type to make the automation:

    > Every weekday at 9:00, read the issues that were opened in Linear yesterday and post a short summary in this Space. Keep it paused until I test it.

2. Check what Type made: the schedule, the time zone, the destination, and the connections.
3. Open the automation from **Automations** in the sidebar, and select **Test**. The test runs once in a private thread.
4. Read the test thread. If the result is wrong, change the instructions, select **Save**, and test again.
5. Select **Enable**.

You can also select **Create → Automation** and choose a Space. Automations that you make this way start paused.

## Part 2: a code automation

You make an automation that runs every hour and records the scheduled time. Then you test it and deploy it.

### Before you start

Install [Type CLI](https://docs.type.com/reference/type-cli/index.md) and log in:

```sh
curl -fsSL https://type.com/install.sh | sh
type-cli auth login
```

You also need a Space to deploy to. To get types in your editor, install [Bun](https://bun.sh).

1. **Make the project.**

    ```sh
    mkdir hourly-check && cd hourly-check
    ```

    ```json title="type.json"
    {
      "name": "Hourly check",
      "entrypoint": "src/main.ts"
    }
    ```

2. **Write the automation** in `src/main.ts`:

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

    export default automation({
      // Each finished run records the time that it was planned for.
      output: z.object({ checkedAt: z.string() }),

      deployment: {
        subscriptions: {
          hourly: {
            title: "Hourly check",
            description: "Record a scheduled checkpoint in run history",
            source: {
              kind: "recurring",
              schedule: { kind: "interval", everySeconds: 3600 },
            },
            entry: "record",
          },
        },
      },

      stages: {
        // Complete the run with the scheduled time.
        record: code({
          input: recurringEventSchema,
          transitions: [],
          run({ input }) {
            return complete({ checkedAt: input.scheduledAt });
          },
        }),
      },
    });
    ```

    The subscription `hourly` starts a run every hour at the `record` stage. The stage gets `{ scheduledAt }` and returns `complete()`, which ends the run with a value that matches `output`.

3. **Add a test** in `fixtures.json`:

    ```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" }
      }
    ]
    ```

    Type.com runs each fixture when you deploy. If the output is different, the deploy fails and nothing changes.

4. **Optional: add types** for your editor:

    ```sh
    bun add @type-dot-com/sdk zod@4 neverthrow@8
    ```

    The CLI does not upload `package.json` or `node_modules`. Type runs your code with its own SDK.

5. **Deploy.**

    ```sh
    type-cli automations deploy . --space <your-space>
    ```

    The CLI prints each step:

    ```text
    validation: succeeded
    fixtures [records the scheduled time]: succeeded
    subscription [hourly]: succeeded
    activation: succeeded
    Deployment 3f6c2a4e-...: active
    Automation: atask_01k...
    ```

    The automation is on. The first run starts within about a minute.

6. **See the runs.**

    ```sh
    type-cli automations history --space <your-space> --automation <automation-id>
    ```

> **Tip:** Commit `.type/project.json`. Its project ID links the folder to the automation. The next deploy of this folder to the same Space updates the same automation.

### Change it, pause it

- **Change it:** set `everySeconds` to `900` (every 15 minutes) and deploy again. Type updates the same automation. If a check fails, the old version keeps running.
- **Pause it:** `type-cli scheduled-actions disable <automation-id> --space <your-space>`. To turn it on again, select **Enable** in Type.

You can also ask Type in a Space to write and deploy a code automation for you.

## Next steps

- [Core concepts](https://docs.type.com/automations/how-it-works/index.md): the model behind every automation.
- [Examples](https://docs.type.com/automations/examples/index.md): ten complete automations to copy.
