Monitor production
Check the database, logs, and Sentry every 15 minutes. An agent investigates new signals. Example
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:
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 automation | Code automation | |
|---|---|---|
| You write | What you want, in plain words | TypeScript stages |
| Each run | The managed agent follows your instructions | Code stages run your logic. Agent stages give a step to the managed agent. |
| Best for | Research, writing, and decisions | Fixed rules, filters, and writes that must happen the same way each time |
| Cost | AI usage on each run | Low. AI usage only in agent stages and AI filters. |
| Make it | Ask Type in a Space | Deploy 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.
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:
ctx.output schema. The result completes the run when onResult is omitted, or starts the named stage.onResult.| Concept | What it is |
|---|---|
| Automation | One workflow in a Space. One automation(...) definition. |
| Subscription | A trigger, and the entry stage that it starts. An automation has one or more. |
| Stage | One step of a run: a code, agent, or ask stage. |
| Decision | What a code stage returns: next(stage, input), complete(output), or blocked(reason). |
ctx | What a code stage uses to read, write, call tools, and save state. |
| Run | One trigger, from the entry stage to complete(), blocked(), or a terminal agent result. |
Read Core concepts for the full model.