# Managed Agent Automation Examples

> Complete, tested Type.com automations to copy. Each example has the full code, how it runs stage by stage, fixtures, and the values to replace.

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

Each Type.com automation example is a complete automation that you can copy into `src/main.ts` and deploy. Every page has the same parts: what it does, how it runs, the full code, how it works, a test, and the values to replace.

The code is written to be read top to bottom. The stages are written inline, in the order that they run. Each stage starts with a comment that says what it does.

Each example has a graph. Each node in the graph is one key in the code, and its shape shows its type:

```mermaid
flowchart LR
  hourly(["hourly · schedule"])
  check["check · code"]
  review{{"review · agent"}}
  record["record · code"]
  hourly -->|entry| check
  check -->|next| review
  review -->|onResult| record
```

| Shape | Node | In the code |
| --- | --- | --- |
| Pill | Trigger | A key in `deployment.subscriptions` |
| Rectangle | Code stage | A `code({ ... })` key in `stages` |
| Hexagon | Agent stage | An `agent({ ... })` key in `stages` |

The arrows use the words from the code: `entry` is the subscription's entry stage, `next` is a `next(...)` decision, and `onResult` is where an agent's result goes.

## From Type's own workspace

Type.com runs these automations on its own production systems and engineering channels. The examples are simplified versions, with placeholder IDs.

| Example | Triggers | What it does | Shows you how to |
| --- | --- | --- | --- |
| [Monitor production security](https://docs.type.com/automations/examples/security-monitor/index.md) | Every 15 minutes | Checks the database, request logs, and Sentry for attacks. An agent investigates new signals and escalates in Slack. | Read several sources, dedupe with a checkpoint, and call an agent only when needed |
| [Turn bug reports into fixes](https://docs.type.com/automations/examples/bug-reports-to-fixes/index.md) | Slack message, Slack reaction, schedule | Files a Linear story for each bug post, and an agent opens a fix pull request. A ✅ closes the story, and Mondays remind owners. | Run three triggers in one automation |
| [Verify, merge, and watch bug fixes](https://docs.type.com/automations/examples/verified-bug-fixes/index.md) | Slack message, schedule | A verifier on a different model checks the fix video before the pull request opens. Low-risk fixes merge when green, and the deploy is watched with backoff. | Chain two agents on different models, merge safely, and monitor after a deploy |
| [Fix one security finding a day](https://docs.type.com/automations/examples/security-audit-fix/index.md) | Daily schedule | Finishes an open fix, or audits the code and fixes the most severe finding. Reports in Slack. | Route a run between two agents that share one contract |
| [Investigate errors on request](https://docs.type.com/automations/examples/investigate-errors/index.md) | Slack reaction | A 🔍 on a bug report starts an investigation with the team's skill. Code posts the root cause. | Start an agent on demand and use a skill |

## More examples

| Example | Trigger | Stages | Shows you how to |
| --- | --- | --- | --- |
| [Diagnose CI failures](https://docs.type.com/automations/examples/ci-failure-review/index.md) | GitHub workflow run | code → agent → code | Skip noise with an AI question, then investigate with an agent |
| [Write daily release notes](https://docs.type.com/automations/examples/release-notes/index.md) | Cron schedule | code → agent → code | Use code, the sandbox, an agent, and a skill together |
| [Triage Slack requests with an agent](https://docs.type.com/automations/examples/slack-triage/index.md) | Slack message | code → agent → code | Give one step to the managed agent and use its typed result |
| [Triage inbound email](https://docs.type.com/automations/examples/email-triage/index.md) | Email | code → agent → code | Branch on an agent's decision |
| [Poll an API for new items](https://docs.type.com/automations/examples/poll-with-checkpoint/index.md) | Interval schedule | code → code | Read a Custom API and remember progress with a checkpoint |
| [Receive webhooks from any service](https://docs.type.com/automations/examples/webhook-orders/index.md) | Webhook URL | code | Accept HTTP events from any service |

## Instruction automations

An instruction automation needs no code. Ask Type in a Space, and say when it runs, what it reads, what it makes, and where the result goes:

| Job | Ask Type |
| --- | --- |
| Morning support digest | "Every weekday at 8:00, read the support tickets opened since yesterday, group them by theme with the /support-triage skill, and post a summary in this Space." |
| Weekly blocker sweep | "Every Friday at 15:00, list the Linear issues in the current cycle that are blocked or have not changed in five days, and post them with their owners." |
| Pull request review | "When a pull request is opened in acme/project, review it with the /pr-review skill and comment on the pull request." |
| Linear triage | "When a Linear issue is created, add a label, suggest an owner, and ask for missing reproduction steps." |
| Competitor watch | "When the competitor's changelog feed has a new entry, summarize what changed and why it matters to us." |
| Vendor inbox | "For each email to this Space's address, summarize it and post it only if it needs a reply." |

Type.com proposes the trigger, the schedule, the destination, and the connections before it makes the automation. See the [Quickstart](https://docs.type.com/automations/quickstart/index.md).

## Placeholder values

The examples use these placeholder values. Replace them with your own:

| Placeholder | What it is | How to find yours |
| --- | --- | --- |
| `ch_example` | A Space ID | `type-cli spaces list --json` |
| `orgint_example`, `orgint_slack`, `orgint_linear`, … | A connection ID | `type-cli integrations list --json` |
| `ches_example` | An event source ID (webhook, email, or RSS) | `source.sourceId` in the automation that Type made for the source |
| `C0123456789` | A Slack channel ID | The channel details in Slack |
| `acme/project` | A GitHub repository | `owner/repo` |
