AI Generator
The AI Generator requires a Pro plan. Upgrade here.
The AI Generator lets you create gate functions by describing what you want in plain English. Tell CalendarPipe what events to filter, block, or transform, and AI generates the TypeScript code for you.
How to Use
- Navigate to a sync rule's gate function settings
- Select the AI tab
Screenshot: AI Generator tab in the gate function editor
- Type your prompt describing the gate function behavior you want
- Click Generate
Screenshot: Prompt input field with Generate button
- Review the generated code
- Click Accept to save the gate function, or Reject to try again with a different prompt
Screenshot: Generated code preview with Accept and Reject buttons
Writing Good Prompts
The quality of the generated gate function depends on your prompt. Be specific about what events to filter and what should happen to them.
Good Prompts
| Prompt | What It Does |
|---|---|
| "Block all events on weekends and after 6pm on weekdays" | Filters by day of week and hour |
| "Redact the title of events with fewer than 3 attendees to just say 'Meeting'" | Transforms small meetings for privacy |
| "Only sync events that have 'Team' in the title and are at least 30 minutes long" | Combines text matching with duration filtering |
| "Block cancelled events and set all-day events to show as free" | Handles multiple event types differently |
Tips for Better Results
- Be specific about the action -- say "block", "pass", "redact", or "transform" rather than vague instructions
- Mention specific properties -- use words like "title", "attendees", "duration", "weekday" to guide the AI toward the right event properties
- Describe edge cases -- if you want different behavior for different events, describe each scenario
- Keep it focused -- one prompt should describe one logical filtering behavior
Prompts to Avoid
| Prompt | Why It's Too Vague |
|---|---|
| "Make my calendar better" | No specific filtering criteria |
| "Clean up events" | Unclear what "clean up" means |
| "Do something smart" | No actionable instructions |
Review and Accept
After the AI generates code, you'll see a preview of the TypeScript gate function. Take a moment to review it:
- Does the logic match what you described?
- Are the correct event properties being checked?
- Is the action (pass/block/transform) what you intended?
Screenshot: Accept and Reject buttons below the generated code
- Accept saves the generated code as your sync rule's gate function
- Reject discards the generated code and lets you write a new prompt
If the generated code is close but not quite right, accept it and then fine-tune it in the Code Editor. You don't have to get it perfect in one generation.
Rate Limits
AI generation is limited to 30 generations per day on the Pro plan. The limit resets daily at midnight UTC.
Each time you click Generate, it counts as one generation regardless of whether you accept or reject the result. Plan your prompts carefully to make the most of your daily limit.
After Generation
Once you accept a generated gate function, the code appears in the Code Editor tab where you can:
- View and understand the generated logic
- Make manual edits and refinements
- Test the function against sample events using the built-in test runner
- Save further changes
The AI Generator is a starting point -- the Code Editor is where you refine and perfect your gate function.
Next Steps
- Learn how to edit generated code in the Code Editor
- Browse ready-to-use Templates for common scenarios
- Look up event properties in the Property Reference