Skip to content
Changelog

Report a bug

What Is an Automation in Type.com?

An automation is a workflow that Type runs for a Space. A trigger starts each run: a schedule, a Slack message, a GitHub event, a Linear change, a webhook, an email, or a feed item. You do not run servers, queues, or schedulers. Type runs the work, keeps the history, and stops the automation when a run fails.

With automations, you can:

  • Run on a schedule, from every minute to once a month.
  • React to events from Slack, GitHub, Linear, email, RSS, and any service that sends webhooks.
  • Read and write data in connected apps, with the Space’s connections.
  • Give a step to the managed agent when the step needs judgment, and get a typed result back.

Monitor production

Check the database, logs, and Sentry every 15 minutes. An agent investigates new signals. Example

Turn bugs into fixes

File a Linear story for each bug in Slack, and open a fix pull request. Example

Harden your code

Audit the code each morning and fix the most severe finding. Example

Write reports

Write daily release notes with the team’s skill. Example

Instruction automationCode automation
You writeWhat you want, in plain wordsTypeScript stages
Each runThe managed agent follows your instructionsCode stages run your logic. Agent stages give a step to the managed agent.
Best forResearch, writing, and decisionsFixed rules, filters, and writes that must happen the same way each time
CostAI usage on each runLow. AI usage only in agent stages and AI filters.
Make itAsk Type in a SpaceDeploy with Type CLI, or ask Type to write it

Start with instructions. When part of the job becomes a fixed rule, move that part into a code stage, and keep an agent stage for the part that needs judgment.

In Type.com’s recurring automation benchmark, automations that saved each task’s repeatable steps as code finished repeat runs of 250 business tasks from Zapier’s AutomationBench 30.6× faster than fresh Claude Code sessions at the median, with 96.8% less model spend and no loss in accuracy. Both used Claude Opus 5.5.

A code automation is one TypeScript file that default-exports automation({ output, deployment, stages }). This one runs every weekday morning: code starts the run, the managed agent writes a summary, and code posts it.

entry next onResult weekdayMorning schedule start code summarize agent post code
Trigger Code stage Agent stage
src/main.ts
import {
agent,
agentResult,
automation,
code,
complete,
next,
recurringEventSchema,
} from "@type-dot-com/sdk/automations";
import { err } from "neverthrow";
import { z } from "zod";
// Replace with the ID of your Space.
const spaceId = "ch_example";
// What the agent stage gets, and what it must submit.
const day = z.object({ date: z.string() });
const summary = z.object({ text: z.string().min(1).max(2000) });
export default automation({
// 1. The result of a finished run.
output: z.object({ messageId: z.string() }),
// 2. What starts a run, and the first stage that runs.
deployment: {
subscriptions: {
weekdayMorning: {
title: "Open work summary",
description: "Summarize open work every weekday at 9:00",
source: {
kind: "recurring",
schedule: {
kind: "cron",
expression: "0 9 * * 1-5",
timezone: "America/New_York",
},
},
entry: "start",
},
},
},
// 3. The steps of a run, in the order that they run.
stages: {
// Code: pass today's date to the agent.
start: code({
input: recurringEventSchema,
transitions: ["summarize"],
run({ input }) {
return next("summarize", { date: input.scheduledAt.slice(0, 10) });
},
}),
// Agent: read the Space's open threads and write a summary.
summarize: agent({
input: day,
output: summary,
instructions: "Summarize the open work in this Space in five bullets or fewer.",
onResult: "post",
}),
// Code: post the summary in the Space.
post: code({
input: agentResult({ input: day, output: summary }),
transitions: [],
async run({ ctx, input }) {
const sent = await ctx.write.sendMessage(
{ channelId: spaceId, content: input.result.text },
{ effectKey: `open-work:${input.taskInput.date}` },
);
if (sent.isErr()) {
return err(sent.error);
}
return complete({ messageId: sent.value.messageId });
},
}),
},
});

Once you deploy, Type.com takes over:

  • Subscriptions start runs. Each one names its trigger and its entry stage.
  • Code stages run your TypeScript in an isolated VM. They reach apps and the sandbox only through ctx.
  • Agent stages give one step to the managed agent. Type checks the agent’s result against the output schema. The result completes the run when onResult is omitted, or starts the named stage.
  • Ask stages pause for a person’s answers, then continue at onResult.
  • Run history records the output, the stages, and any errors of each run.
ConceptWhat it is
AutomationOne workflow in a Space. One automation(...) definition.
SubscriptionA trigger, and the entry stage that it starts. An automation has one or more.
StageOne step of a run: a code, agent, or ask stage.
DecisionWhat a code stage returns: next(stage, input), complete(output), or blocked(reason).
ctxWhat a code stage uses to read, write, call tools, and save state.
RunOne trigger, from the entry stage to complete(), blocked(), or a terminal agent result.

Read Core concepts for the full model.

  • Runs the triggers. Type.com keeps schedules, receives events, and filters them before your code starts.
  • Gives access safely. A run uses the Space’s connections and acts as the person who created the automation. Code never sees a credential.
  • Keeps history. Each run records its output, its stages, and its errors.
  • Handles failures. Type retries only when it can prove that the code did not start. Otherwise the automation keeps running and a repair agent starts for a code failure. A failed run never pauses it; if most of its recent runs fail, Type alerts its owner.