```html

Automating Boat Cleaning Dispatch and Calendar Integration for Event Operations

During this development session, we tackled a critical operational gap: integrating boat cleaning services into our event management pipeline. FancyHands was cancelled, forcing us to build an in-house dispatch system. This post covers the technical architecture we implemented to automate cleaning scheduling and coordinate it with our Google Calendar-based event management system.

The Problem

Our events operation relies on Google Calendar as the source of truth for bookings, but we had no automated way to dispatch cleaning services or track their execution. Manual coordination was error-prone and didn't scale. We needed a system that could:

  • Accept booking information from our calendar system
  • Dispatch cleaning tasks to service providers
  • Track completion status
  • Integrate bidirectionally with Google Calendar

Technical Architecture

Dispatch System Core

We created /Users/cb/Documents/repos/tools/dispatch_boat_cleaner.py, a Python-based dispatch automation script. This script serves as the integration point between our calendar system and cleaning operations.

dispatch_boat_cleaner.py
├── Calendar event parsing
├── Cleaning task generation
├── Provider assignment logic
└── Status synchronization back to GCal

Why Python? Our existing tooling ecosystem (Lambda functions, deployment scripts) already uses Python. This minimizes context-switching and allows code reuse from our campaign scheduler and inbox scraper utilities.

Google Apps Script Calendar Sync

The CalendarSync.gs file (located at /Users/cb/Documents/repos/sites/queenofsandiego.com/rady-shell-events/apps-script-replacement/) was updated to support bidirectional calendar synchronization. This GAS project acts as the bridge between Google Calendar and our backend services.

Key modifications:

  • Extended event metadata to include cleaning task status fields
  • Added polling intervals for checking dispatch completion status
  • Implemented email notifications tied to calendar event changes
  • Created action handlers for add-calendar-event, update-event-status, and dispatch-cleaning

The GAS file is deployed to Google Apps Script project via .clasp.json configuration. We mapped all project directories to their respective GAS project IDs to ensure changes push to the correct deployment environment.

Lambda Integration

Calendar API calls from the dashboard and scripts route through a Lambda function that validates authentication tokens and executes calendar actions. This function:

  • Validates dashboard auth tokens against environment secrets
  • Routes requests to appropriate GAS endpoints via API Gateway
  • Returns calendar event data for dashboard display
  • Invokes dispatch logic when calendar bookings are confirmed

Direct Lambda invocation proved faster than HTTP calls during testing, so we use the direct invocation path for time-sensitive operations like adding Scout holds to the calendar.

Deployment Pipeline

We created two deployment scripts:

  • /Users/cb/Documents/repos/tools/deploy_boat_cleaner.sh — Deploys the dispatch system to production
  • /Users/cb/Documents/repos/tools/deploy_campaign_scheduler.sh — Manages scheduled task deployment

Both scripts follow the same pattern:

# Load environment variables from repos.env
# Validate credentials exist
# Deploy code to appropriate service (Lambda, GAS, S3)
# Verify deployment via test invocation
# Log deployment metadata to dashboard

Calendar Event Automation

We successfully automated addition of 7 recurring Scout Wednesday holds to Google Calendar. Rather than manual data entry, we:

  • Structured event data in campaign JSON (/Users/cb/Documents/repos/tools/campaign_schedule.json)
  • Called the Lambda calendar API with proper authentication
  • Verified events appeared in Google Calendar within seconds

This pattern is now reusable for any bulk calendar operations.

Email Integration

Event confirmations and cleaning dispatch notifications flow through AWS SES. The system:

  • Reads calendar events and associated contact information
  • Generates HTML email templates from /Users/cb/Documents/repos/tools/templates/
  • Sends notifications to event hosts and cleaning providers
  • Logs sent emails in the dashboard for audit trails

The platform_inbox_scraper.py monitors incoming emails related to bookings, parses them for details, and automatically updates calendar events with confirmation status.

Data Flow Overview

Google Calendar Event
    ↓
GAS CalendarSync polling
    ↓
Lambda calendar API
    ↓
dispatch_boat_cleaner.py (cleaning task generation)
    ↓
Email notifications (via SES)
    ↓
Provider action (cleaning completed)
    ↓
Email response parsed by platform_inbox_scraper
    ↓
Calendar event status updated
    ↓
Dashboard reflects completion

Key Design Decisions

Why not a dedicated database? Google Calendar itself is our database. By treating it as the source of truth and synchronizing other systems to it, we avoid data consistency issues and reduce operational overhead. The calendar is already backed up, auditable, and accessible to all stakeholders.

Why GAS instead of pure Lambda? Google Calendar's API has better support through GAS, and authentication is handled automatically through Google's OAuth. For calendar operations, GAS is simpler and more reliable than managing credentials in Lambda.

Why email-based dispatch? Our cleaning providers and event coordinators already monitor email. Rather than forcing them onto a new platform, we use email as the dispatch channel. The inbox scraper handles the return path automatically.

Operational Integration

The cleaning dispatch system integrates with our existing workflow:

  • Dashboard cards track dispatch status and provider responses
  • Calendar holds (like the Scout Wednesdays) block time and prevent double-booking
  • Email notifications keep all parties informed without requiring them to check a new system
  • Audit trail is maintained in both email history and calendar event metadata

What's Next

The current implementation is functional but has opportunities for enhancement:

  • Provider rating system — Track which cleaning providers perform best and route jobs accordingly
  • Cost tracking — Capture invoices from providers and associate with calendar events for billing
  • Predictive scheduling — Analyze calendar patterns to pre-stage cleaning resources before events
  • Mobile app — Let providers receive and confirm dispatch via mobile, not just email

For now, the system eliminates manual coordination and creates a reliable dispatch pipeline for event operations. The architecture is extensible — adding new automation layers (cost tracking, ratings, etc.) only requires updating CalendarSync.gs or extending the dispatch script.

```