# Scheduled Automations: Run Agents on a Schedule

> Run scheduled agent work for your whole team in Type.com, with no laptop on. A managed agent runs on your schedule with shared connections.

Canonical page: https://docs.type.com/automations/scheduled-automations/

To run a scheduled Claude or Codex agent job for your team without keeping a laptop on, make it a scheduled automation in Type.com. A managed Claude or Codex agent runs it in the cloud at the time you choose, from every minute to once a month, with the Space's shared connections and skills. Each run is a thread anyone in the Space can open, and anyone in the Space can edit the automation's plain-language instructions.

A Claude Code cloud scheduled task, formerly called a routine, also runs with your laptop closed, and it belongs to one person's claude.ai account. A Type.com scheduled automation belongs to the Space, so the whole team shares it.

A schedule starts a run at a fixed time. Use schedules for reports, reviews, sweeps, and reminders. Instruction automations and code automations can both run on a schedule.

Use schedules for:

- daily user health reports,
- weekly pipeline reviews,
- monthly reports on a calendar day,
- first-weekday or last-weekday reviews, such as the first Monday or the last Friday,
- morning support digests,
- weekly marketing ideas,
- recurring blocker sweeps,
- checks of a service that cannot send events.

## With instructions

A scheduled instruction automation starts the [managed agent](https://docs.type.com/automations/managed-agent/index.md) with your instructions at each scheduled time. Make it from **Automations** in the sidebar, or ask Type in the Space. See [Create and Manage Automations](https://docs.type.com/automations/deploy/index.md).

Template prompts can propose scheduled automations as starting points. In the setup conversation, choose the proposals that fit the role. Confirm the cadence, the time zone, and the destination before Type makes an automation. An automation that Type makes from a template starts paused. Enable it when you are ready.

Good scheduled instructions say how often the automation runs, which sources the managed agent checks, what output it makes, and who gets the result.

### Choose when it runs

Choose one of these schedules, and a time zone:

| Schedule | Runs |
| --- | --- |
| **Weekly** | At a time of day on the days that you select. |
| **Monthly** | At a time of day on one day each month. |
| **At an interval** | Every few minutes or hours on the days that you select. |

### Interval schedules

Choose an interval of 1, 15, 30, 60, 120, or 240 minutes. Choose the days on which the automation can run.

> **Note:** Custom intervals are not on for all workspaces yet. When they are on, you can enter any whole number of minutes from 1 to 1,440 (24 hours), for example 5, 17, or 90.

If Type makes an automation with an interval below 15 minutes, the automation starts paused. Open the automation in Type to enable it.

### Monthly schedules

A monthly automation can run on:

- a numbered calendar day, from the 1st to the 31st,
- the first occurrence of a weekday, such as the first Monday,
- the last occurrence of a weekday, such as the last Friday.

If a numbered day does not exist in a shorter month, Type.com runs the automation on the last day of that month. For example, a schedule for the 31st runs on the last day of February.

### Model, accounts, and failures

- To choose the model, reasoning, speed, and connected accounts, see [Run a Managed Agent](https://docs.type.com/automations/managed-agent/index.md).
- Type pauses a scheduled instruction automation after its last three runs failed. It pauses at once when a failure needs a person, for example an account to reconnect. See [Recover an automatically paused schedule](https://docs.type.com/automations/test-troubleshoot/index.md#recover-an-automatically-paused-schedule).

## With code

A code automation runs on a schedule when a subscription has a `recurring` source. Choose a cron expression, a fixed interval, or a stepped schedule that slows down over time. See [Core concepts](https://docs.type.com/automations/how-it-works/index.md) for the basics of a code automation, and [Monitor production security](https://docs.type.com/automations/examples/security-monitor/index.md) for a complete example.

The entry stage of a recurring subscription receives a `RecurringEvent`: `{ scheduledAt }`. Use `recurringEventSchema` as its `input`.

### Run on a cron schedule

This automation posts a reminder in the Space at 9:45 New York time on weekdays:

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

// Replace with the ID of the Space to post in.
const spaceId = "ch_example";

export default automation({
  // Each finished run records the ID of the message that it posted.
  output: z.object({ messageId: z.string() }),

  deployment: {
    subscriptions: {
      weekdayMorning: {
        title: "Standup reminder",
        description: "Post a reminder at 9:45 New York time on weekdays",
        source: {
          kind: "recurring",
          schedule: {
            kind: "cron",
            expression: "45 9 * * 1-5", // 9:45, Monday to Friday
            timezone: "America/New_York",
          },
        },
        entry: "postReminder",
      },
    },
  },

  stages: {
    // Post the reminder in the Space, then end the run.
    postReminder: code({
      input: recurringEventSchema,
      transitions: [],
      async run({ ctx, input }) {
        const sent = await ctx.write.sendMessage(
          {
            channelId: spaceId,
            content: "Standup starts in 15 minutes. Add your update to this thread.",
          },
          // The same scheduled time always gives the same key.
          { effectKey: `standup-reminder:${input.scheduledAt}` },
        );
        if (sent.isErr()) {
          return err(sent.error);
        }

        return complete({ messageId: sent.value.messageId });
      },
    }),
  },
});
```

- `timezone` is required. Use an IANA name, for example `Europe/London` or `UTC`.
- A schedule can run at most once a minute. Type rejects an expression with a seconds field that runs more often.
- The expression must have a future run when you deploy. If a schedule later has no more runs, Type.com pauses the subscription.

### Run at an interval

```ts
source: {
  kind: "recurring",
  schedule: { kind: "interval", everySeconds: 900 }, // every 15 minutes
},
```

- `everySeconds` must be at least 60 and a multiple of 60. Type checks this when you deploy.
- The first run starts at the next scheduler check after the automation is enabled. Type checks once a minute. Later runs stay on the same grid: each run is one interval after the previous planned time.

### Slow the cadence over time

Use a stepped schedule when checks should become less frequent as time passes:

```ts
deployment: {
  expiration: { kind: "duration", afterSeconds: 345600 }, // four days after first activation
  subscriptions: {
    check: {
      title: "Monitor with backoff",
      description: "Check often at first, then less often",
      source: {
        kind: "recurring",
        schedule: {
          kind: "stepped",
          steps: [
            { everySeconds: 60, forSeconds: 3600 },
            { everySeconds: 600, forSeconds: 3600 },
            { everySeconds: 3600, forSeconds: 21600 },
            { everySeconds: 86400 },
          ],
        },
      },
      entry: "check",
    },
  },
},
```

This checks every minute for an hour, every ten minutes for an hour, hourly for six hours, then daily until the automation expires. The cadence follows elapsed time.

- The first run is one interval after activation. Each step starts its own interval grid.
- An occurrence exactly at a step's endpoint belongs to that step. The next step's first run is one new interval after the boundary.
- Use 2 to 32 steps. Intervals and durations are whole minutes, given in seconds. Intervals cannot decrease, and each timed step lasts at least one interval.
- Only the final step omits `forSeconds`. Use an [expiration](https://docs.type.com/automations/reference/deployment/index.md#expiration) by duration, run count, or timestamp to stop it. Without an expiration, the final interval repeats indefinitely.
- Time continues during pauses. When you resume, Type skips the missed runs and keeps the elapsed time.
- Changing the schedule restarts its cadence. Code-only edits keep it. Neither edit resets the expiration deadline or the run count.

Deploy with `type-cli automations deploy ./monitor --space operations`, or ask Type to configure the same schedule in chat. `type-cli scheduled-actions get <id> --space operations --json` returns the next planned run of each subscription as an ISO timestamp in `subscriptionNextDueAt`. The automation view refreshes these times every minute, lists each step of a stepped schedule, and marks the current step. Paused, archived, or expired schedules have no next run.

### Use the scheduled time

Use `event.scheduledAt` in effect keys and in time windows. Do not use the current clock time for these. If Type runs the same occurrence again, `scheduledAt` stays the same. The real start time can be later than `scheduledAt`.

### Missed runs

- While an automation is paused, its schedule does not run. When you resume, Type waits for the next planned time. It does not run the times that it missed.
- If Type starts late, it runs the planned occurrence once. Then it moves to the next planned time after the current time. It does not run each interval that passed.

### Read a service that cannot send events

Code automations receive events from Slack, GitHub, and Linear connections, from [webhooks](https://docs.type.com/automations/webhooks/index.md), and from [email and RSS](https://docs.type.com/automations/email-rss/index.md) sources. For other services, read the service on a schedule:

1. Read new items since the last run. Use a [checkpoint](https://docs.type.com/automations/state/index.md) to remember the last item.
2. Process only the new items.
3. Save the new checkpoint.

> **Tip:** Use events when the service can send them. Events are faster, and they do not start runs when nothing changed. Use a schedule only when events cannot do the job.

## Limitations

- Instruction intervals are whole minutes from 1 to 1,440. Without custom intervals, choose one of the preset intervals. Code intervals are at least 60 seconds and a multiple of 60.
- Cron expressions and stepped schedules are for code automations. Instruction automations use weekly, monthly, and interval schedules.
- A schedule does not run while the automation is paused. Type does not run missed times when you resume.
- A recurring source cannot use `debounce` or a built-in matcher. Its entry stage always receives `{ scheduledAt }`.
- `scheduledAt` is the planned time. The real start time can be later.

## FAQ

### How do I run Claude Code on a schedule for my team without keeping a laptop on?

Make the job a scheduled automation in a Type.com Space. A managed Claude or Codex agent runs it in the cloud at the time you choose, with the Space's shared connections, so no laptop or server has to stay on. Anyone in the Space can read each run's thread and edit the automation's plain-language instructions.

### How is this different from a Claude Code scheduled task?

A Claude Code cloud scheduled task, formerly called a routine, also runs with your laptop closed, and it belongs to one person's claude.ai account. A Type.com scheduled automation belongs to its Space: it uses the team's shared connections, anyone in the Space can view, edit, and test it, and every run is a thread the team can open.

### How often can a scheduled automation run?

An instruction automation runs weekly, monthly, or at an interval, from every minute to every four hours on the days you choose. A code automation can also use a cron expression, a fixed interval of at least one minute, or a stepped schedule.

### What happens when a scheduled run fails?

Type.com pauses a scheduled instruction automation after its last three runs failed, and at once when a failure needs a person, such as an account to reconnect.
