Skip to main content

Custom

Custom is where you write a rule that no template or builder covers. You describe what you want, the AI writes the rule, and CalendarPipe tests it on your upcoming events straight away. The code is always there, so you can read it or change it yourself.

Open a pipe from the Pipes page and select the Custom tab. The workspace has three parts:

  • Chat, where you describe the rule and the AI replies.
  • Test results, which show what the rule does to each of your upcoming events.
  • Code, a panel under the results that you can open to read or edit the rule.

On a phone, the three parts are tabs: Chat, Preview and Code.

Rules for a booking page's busy calendars use the same workspace. There, the rule decides which events block time: only pass or block matters, and transforms have no effect.

Describe the rule​

Type what the rule should do, in your own words, and send it. For example:

  • "Only my weekend events"
  • "Skip standup and anything shorter than 15 minutes"
  • "Hide the details and show them as busy"
  • "Only events after 5pm, coloured grape"

The AI replies in a sentence or two with what the rule now does, and writes the code. Each reply ends with a test line, such as "4 of 12 pass · 2 changed · 8 blocked".

Keep going with follow-ups until the rule is right: "also skip anything after 8pm", or "the dentist appointment is still showing". The AI sees the current code and the latest test results, so it can find the event you mean. If your request could be read two ways that change which events sync, the AI can ask a short question instead of guessing.

You can also start from the Templates tab: pick a template, type the change you want in the box under the list, and Custom opens with your text as the first message.

Test results​

Every change to the rule is tested automatically, whether the AI wrote it or you did. There is no Test button. The test runs the rule on up to 20 events from your source calendar, from the same window a sync covers, including events already in progress. Each recurring series shows up once before any series repeats, so a daily meeting can't crowd out everything else. When the calendar has no upcoming events, you see example events instead, with a note saying so.

For each event, the results show:

  1. Whether it passes, is changed (with what changes), or is blocked, plus the rule's reason when it gives one. Changed includes the pipe's default event colour and anything the target calendar drops. Google, for example, keeps no description on an out-of-office event.
  2. Removed marks a blocked event that is already on the target: saving deletes that copy. For a pipe that sends invitations it reads Cancelled, because the invitation is cancelled.
  3. Skipped marks an event sync never copies: one CalendarPipe added to the source itself, or a timed event with no time zone. Your rule never sees these. A timed event with no time zone that was synced before shows as Removed, since sync deletes its copy whatever the rule says.
  4. Error marks an event the rule could not finish on, for example because it timed out. Sync leaves its copy as it is.

When the AI's rule fails on an event, or runs but raises a warning, CalendarPipe sends the problem back and the AI fixes it, up to 3 attempts within the same message. You see "Fixing it" in the chat while this happens. If those attempts don't clear a warning, you get the rule that works, warning included.

info

A stricter rule removes events that are already synced. Rule changes apply to upcoming events only: copies of events that have already ended stay on the target as they are.

Warnings​

The test results also list warnings: code that runs, but probably doesn't do what you meant. Warnings never block a save. They include:

  • an old name, such as function gate or GateEvent;
  • event.hour, event.dayOfWeek or event.isWeekday, which are in UTC rather than your time zone;
  • a result field that doesn't exist, such as a misspelt transfrom, or a transform on a blocked event;
  • reading an event property that doesn't exist, such as event.reminders, which can be set in transform but not read;
  • a transform the target calendar ignores, such as color on a calendar other than Google.

The AI sees the same warnings and fixes them, except a transform the target ignores: the code can't change what the target keeps, so the AI leaves that field in place.

When the rule uses the old names, Update to current syntax renames gate to rule and the Gate types to Rule in the draft, without changing what the rule does. Save the draft to make it live; History keeps the version before it. The UTC properties are left for you to replace, because the replacement needs a time zone: see Deprecated.

Edit the code yourself​

Open the Code panel to read the rule or change it. The editor knows the rule's types, so you get autocompletion for every event property. Your edits are tested about a second after you stop typing, and the code is formatted when you leave the editor. The code is read-only while the AI is working.

The AI builds on your edits. When you send the next message, it gets the code as you left it.

A rule is a function named rule that takes the event and returns whether it passes, and optionally how the copy changes:

function rule(event: RuleEvent): RuleResult | boolean {
if (event.matches('confidential')) {
return { pass: false, reason: 'Blocked confidential event' };
}
return { pass: true, transform: { title: `[Work] ${event.title}` } };
}

See the Property Reference for every property, helper and transform, and the Cookbook for complete examples.

Save a version​

Nothing you do in Custom changes the pipe until you save. Until then you are working on a draft, and the version that was live keeps syncing. The draft is kept on our servers, so you can leave and come back to it on another device.

Click Save as v2 (the number is the next version) to make the draft live. Saving is blocked while the AI is working, while a test is running, or when the rule fails on every event.

Discard draft deletes the draft's messages and code. The live version keeps syncing.

History​

History lists every saved version of the rule, newest first, with when it was saved and the first message that led to it. Changes from the Visual Builder, templates and the API are versions too.

Edit from here opens a version as a new draft, with its code and chat, and tests it on your events. If you already have a draft, you are asked before it is replaced.

To go back to an earlier version, open it with Edit from here and save it. It becomes the next version, labelled Restored v2 (for example) when you saved it unchanged. Nothing is lost: History keeps every version, including the one you replaced.

AI messages​

PlanAI messages
Free5 in total, never reset
Pro30 a day
  • A message counts once, however many attempts the AI needs to fix it.
  • A message is not counted if the AI service fails before it replies. A reply that asks you a question counts.
  • Pro's messages reset at 00:00 UTC. The chat shows the time in your own time zone.
  • Messages used on Pro, including during the free trial, don't count against Free's 5.
  • Free shows how many messages are left. Pro shows the count once 10 or fewer are left.

When you run out, you can still edit the code yourself, and every edit is still tested.

What is sent to the AI​

Nothing is sent until you send a message. Each message sends:

  • your message;
  • the rule's current code, including your own edits;
  • up to the last 12 messages of the chat;
  • your time zone;
  • the latest test results, for up to 20 upcoming events from your source calendar.

For each event in the test results, that is the title, start and end time, whether it is all-day, how many attendees it has and up to 4 of their email addresses, your response, whether it shows as busy or free, its visibility when it is not the default, whether it is out of office or recurring, its location, the first 160 characters of its description, and what the rule did to it.

The request goes through the Vercel AI Gateway to the model provider. We ask the Gateway to route only to providers that do not retain the data or train on it. Your chat is stored with the rule's draft and versions and is deleted when you delete the pipe or busy calendar. The privacy policy has the full details, including the providers and where they process data.