Schedule Assistant Documentation

Documentation for the Schedule-to-Calendar automation workflow and AI prompting logic.

1 n8n Workflow Architecture

The application relies on an n8n webhook workflow to process the schedule text/images and generate structured events. The workflow executes in the following sequence:

Webhook (POST)
Check If Image or Text
If Image
Analyze an Image
Format Data (Image)
If Text
Basic LLM ChainGemini / OpenRouter
Format Data (Text)
Format Data for Calendar
Check if all day
31 Create Calendar Event

2 AI Prompt & JSON Structure

The LLM is configured to act as a precise Data Extraction Specialist. It strictly returns a JSON object, ensuring consistency with the UI rendering logic.

JSON Structure Rules

  • Rule 1Every response MUST be a valid JSON object. Reasoning or explanations are forbidden.
  • Output Schema { "output": { "type": "Schedule", "entries": [...] } }
  • Date FormatAll dates MUST follow YYYY-MM-DD format. Use current year if missing.

Critical Logic & Mapping

  • Mutual Exclusivity System strictly processes either Text OR Image to prevent data fusion conflicts.
  • Date Splitting Date ranges (e.g. "4 & 5") are automatically split into multiple sequential entries.
  • Role Mapping Intelligently maps roles like "PPT", "OBS", or "Meeting" to specific categories.

Full LLM System Prompt

STRICT_JSON_ONLY: Begin your response immediately with '{'. Do not include any introductory text or markdown formatting. 

Act as a precise Data Extraction Specialist. Your task is to convert raw Media Ministry schedules into a structured JSON format matching this schema:

{
  "output": {
    "type": "string",
    "entries": [ { "date": "YYYY-MM-DD", "category": "string", "name": "string" } ]
  }
}

### RULES:
1. OUTPUT: Return ONLY valid JSON.
2. DATES: Format all dates as YYYY-MM-DD.
3. RANGES: Split ranges like "4 & 5" into separate objects.