Playbook: Email to Calendar¶
Objective¶
Automatically extract dates and events from incoming emails and sync them to the primary family calendar.
Pre-requisites¶
Step-by-Step Flow¶
- Ingestion: n8n workflow triggers via IMAP on a new email in the
Automate/Intakefolder. - Storage: n8n uploads the email body (as PDF) or any existing PDF attachments to Paperless-ngx with the tag
needs-processing. - Extraction: n8n calls the LLM with the Date Extraction Prompt, passing the OCR text from Paperless.
- Verification: LLM returns a structured JSON object containing
event_name,start_date,end_date, andlocation. - Action: n8n creates an event in Google Calendar using the data returned by the LLM.
- Cleanup: n8n updates the Paperless document tag from
needs-processingtosynced-to-calendar.
Data Contract¶
| Field | Type | Format | Source |
|---|---|---|---|
event_name |
String | Plain Text | Email Subject/Body |
start_date |
DateTime | ISO8601 | Email Body |
end_date |
DateTime | ISO8601 | Email Body |
location |
String | Plain Text | Email Body |
Failure Modes & Recovery¶
- Extraction Failed: LLM returns "No event found".
- Detection: n8n check for null fields.
- Recovery: Tag document in Paperless as
automation-failedand send a notification to Matrix.
- IMAP Timeout:
- Detection: n8n workflow execution error.
- Recovery: Retry policy in n8n (3 retries).
Variants¶
- SaaS Only: Replace n8n/Ollama with Zapier and ChatGPT.
- Local Only: Replace Google Calendar with Radicale via CalDAV.