N8N Automation: Tamara Daily Homework Digest
Relevant source files
The following files were used as context for generating this wiki page:
The Tamara Daily Homework Digest is an automated workflow that generates and emails a summary of upcoming school assignments. It operates within the Tamara Learning Program to provide visibility into school obligations for the next seven days. The system specifically targets Schoology calendar events while excluding platforms without calendar feeds like PowerSchool.
Sources: projects/tamara-learning-program/canonical/automation/n8n/README.md:1-12, projects/tamara-learning-program/manifests/intake-inventory.yaml:45-51
System Architecture
The automation utilizes n8n Cloud (CONN-N8N) as the execution platform. It follows a linear four-stage process: triggering based on a schedule, fetching external calendar data, processing the data via JavaScript, and dispatching a formatted email through Gmail.
Workflow Logic Flow
The following diagram illustrates the data transition from the schedule trigger to the final email dispatch.
Component Specifications
The workflow consists of four primary nodes defined in the JSON configuration.
| Node Name | Type | Description |
|---|---|---|
| Every day 3:30 PM | n8n-nodes-base.scheduleTrigger | Triggers the workflow at 15:30 Asia/Riyadh time, Saturday to Thursday. |
| Get Schoology calendar | n8n-nodes-base.httpRequest | Fetches the raw iCal feed from a user-supplied Schoology Export link. |
| Build digest | n8n-nodes-base.code | Parses iCal data, filters for a 7-day window, and generates an Arabic HTML table. |
| Send to Latifah | n8n-nodes-base.gmail | Dispatches the processed digest to the configured recipient using Gmail credentials. |
Sources: projects/tamara-learning-program/canonical/automation/n8n/tamara-daily-homework-digest.json:5-96, projects/tamara-learning-program/canonical/automation/n8n/README.md:3-9
Data Processing Logic
The "Build digest" node executes JavaScript to transform raw iCal text into a structured HTML report.
Filtering and Flagging
The logic processes events based on their start dates (DTSTART). It calculates three specific time windows:
- Today: Flagged with "🔴 اليوم" (Red circle - Today).
- Tomorrow: Flagged with "🟠 بكرة" (Orange circle - Tomorrow).
- 7-Day Window: All events occurring between today and the next seven days are included in the digest.
Formatting
The output is an RTL (Right-to-Left) HTML document using Arial font. It includes a table with columns for the day, the assignment title, and the urgency flag. The subject line of the email dynamically updates to reflect the count of urgent (today/tomorrow) items.
// Parsing logic snippet from n8n Code node
const events = [];
// ... extraction logic ...
const rows = events
.map(e => ({ ...e, d: e.start ? toDate(e.start) : null }))
.filter(e => e.d && dayKey(e.d) >= today && dayKey(e.d) <= limit)
.sort((a, b) => a.d - b.d)
.map(e => {
const k = dayKey(e.d);
const flag = k === today ? '🔴 اليوم' : k === tomorrow ? '🟠 بكرة' : '';
// ... HTML row generation ...
});
Sources: projects/tamara-learning-program/canonical/automation/n8n/tamara-daily-homework-digest.json:39-75
Security and Data Policy
The automation adheres to a strict "no child data" policy within the repository.
- Credentials: No emails, links, or API credentials are stored in the
.jsonfile. - Environment: Configuration values (Schoology iCal link and Gmail credentials) must be manually populated within the n8n Cloud environment.
- Status: The workflow is currently classified as
PROPOSED_NOT_ACTIVEand requires separate approval before activation.
Sources: projects/tamara-learning-program/manifests/intake-inventory.yaml:49-51, projects/tamara-learning-program/canonical/automation/n8n/README.md:11-12, 01_GOVERNANCE/decision-log.yml:19
Implementation Constraints
The following limitations apply to the current implementation:
- Source Coverage: Only Schoology data is included. Arabic and Computer Science homework (stored in PowerSchool) are excluded because PowerSchool lacks a calendar feed.
- Schedule: Execution is restricted to Saturday through Thursday to align with the school week in the Asia/Riyadh timezone.
- Timezone: The system explicitly uses
Asia/Riyadhfor date calculations and schedule triggers.
Sources: projects/tamara-learning-program/canonical/automation/n8n/README.md:3, 13, projects/tamara-learning-program/canonical/automation/n8n/tamara-daily-homework-digest.json:11, 52, 107
Summary
The Tamara Daily Homework Digest provides an automated reporting mechanism for the Tamara Learning Program. By integrating n8n Cloud with Schoology and Gmail, the system ensures daily visibility into upcoming assignments while maintaining data privacy by keeping sensitive credentials external to the version-controlled source code.