Skip to content
Changelog

Report a bug

Quickstart

This quickstart has two parts. In part 1, you make an instruction automation without code. In part 2, you make a code automation with Type CLI.

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

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

    Every weekday at 9:00, read the issues that were opened in Linear yesterday and post a short summary in this Space.

  2. Read the proposal. Check the schedule, the time zone, the destination, and the connections.

  3. Open the automation from Automations in the sidebar. Select Test to run it one time in a private thread.

  4. Read the test thread. Change the instructions if the result is not correct, then select Save and Test again.

  5. Select Enable.

You can also select Create → Automation, then choose a Space. New automations that you make this way start paused.

In this part, you make an automation that runs every hour and records the time in run history. Then you add a test and deploy it.

  • Code automations must be on for your workspace. They are in early access.
  • You need a Space. You deploy the automation to it.
  • Install Type CLI and log in:
Terminal window
curl -fsSL https://type.com/install.sh | sh
type-cli auth login
  • Optional: install Bun to get types in your editor.
  1. Make a folder and the project file.

    Terminal window
    mkdir hourly-check && cd hourly-check
    type.json
    {
    "name": "Hourly check",
    "entrypoint": "src/main.ts"
    }
  2. Write the code.

    src/main.ts
    import type {
    AutomationContext,
    AutomationDeployment,
    RecurringEvent,
    } from "@type-dot-com/sdk/automations";
    export const deployment = {
    subscriptions: {
    hourly: {
    title: "Hourly check",
    description: "Record the scheduled time in run history",
    source: {
    kind: "recurring",
    schedule: { kind: "interval", everySeconds: 3600 },
    },
    },
    },
    } satisfies AutomationDeployment;
    export default class HourlyCheck {
    hourly(ctx: AutomationContext, event: RecurringEvent) {
    return ctx.setOutput({ checkedAt: event.scheduledAt });
    }
    }
    • deployment.subscriptions.hourly runs every 3,600 seconds.
    • The method hourly has the same name as the subscription key. Type calls it on each run.
    • ctx.setOutput shows a result in run history.
  3. Add a test.

    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 runs this fixture at each deploy. If the output is different, the deploy fails.

  4. Optional: add types for your editor.

    Terminal window
    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.

Terminal window
type-cli automations deploy . --space <your-space>

The CLI prints each stage:

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

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

Terminal window
type-cli automations history --space <your-space> --automation <automation-id>

Each run shows its status and the output { "checkedAt": "..." }.

Change everySeconds to 900 (every 15 minutes) and deploy again:

Terminal window
type-cli automations deploy . --space <your-space>

Type updates the same automation. If a check fails, the old code keeps running.

Terminal window
type-cli scheduled-actions disable <automation-id> --space <your-space>