Instructions
1. Initial Setup & Discovery
- •Discover Environment: Use
filesystem-list_directoryto explore/workspace/dumps/workspacefor onboarding documents (PDFs). - •Database Discovery: Use
snowflake-list_databasesandsnowflake-list_schemasto locate the relevant database (e.g.,LANDING_TASK_REMINDER). - •Table Discovery: Use
snowflake-list_tablesto find employee and task tables (e.g.,EMPLOYEE,EMPLOYEE_LANDING,PUBLIC_TASKS,GROUP_TASKS_*).
2. Analyze Onboarding Document
- •Read PDF: Use
pdf-tools-get_pdf_infoandpdf-tools-read_pdf_pagesto extract the onboarding checklist from the PDF (e.g.,landing_tips.pdf). - •Extract Task Structure: Parse the PDF to identify:
- •Public Tasks (for all departments): e.g., "Onboarding Training", "Security Training", "Confidentiality Training", "Company Culture", "Company Strategy". Note their relative deadlines (e.g., "complete by D+7").
- •Group-Specific Tasks: Identify tasks for Backend (D+30), Frontend (D+45), Testing (D+60), and Data (D+75) groups. Each group typically has "Development Process", "Development Standards", and "Development Environment" tasks.
3. Identify New Employees & Group Assignments
- •Query Employee Data: Use
snowflake-read_queryonEMPLOYEEandEMPLOYEE_LANDINGtables. - •Find New Hires: Identify employees where
LANDING_TASK_ASSIGNED = FALSEandLANDING_DATEis recent (or as per user request). - •Determine Group Assignment: An employee's group is inferred from their
REPORT_TO_ID(manager). Map managers to groups based on existing task table patterns (e.g., employees with tasks inGROUP_TASKS_BACKENDreport to manager ID 8001). - •Get Manager Emails: Join with the
EMPLOYEEtable to get the manager's email for CC.
4. Check for Overdue Tasks
- •Query All Task Tables: For
PUBLIC_TASKSand eachGROUP_TASKS_*table, find records whereFINISHED_FLAG = FALSEANDDDL < CURRENT_DATE(). - •Aggregate by Employee: Collect all overdue tasks for each employee, including their manager's email.
5. Calculate Deadlines & Generate Task Lists
- •Base Date: Use
CURRENT_DATE()as the start date (Day 0). - •Calculate Deadlines:
- •Public Tasks: Day 0 + 7 days.
- •Backend Tasks: Day 0 + 30 days.
- •Frontend Tasks: Day 0 + 45 days.
- •Testing Tasks: Day 0 + 60 days.
- •Data Tasks: Day 0 + 75 days.
- •Format Dates: Use 'YYYY-MM-DD' format for database insertion and email content.
6. Update Database
- •Insert New Tasks: Use
snowflake-write_queryto insert records into the appropriate tables (PUBLIC_TASKS,GROUP_TASKS_*) for each new employee. - •Update Tracking Flag: Update
EMPLOYEE_LANDINGtable, settingLANDING_TASK_ASSIGNED = TRUEfor processed new hires.
7. Send Emails
- •Onboarding Emails: For each new employee, use
emails-send_email.- •To: Employee's email.
- •CC: Their manager's email (from
REPORT_TO_IDlookup). - •Subject: "Onboarding Training Tasks".
- •Body: Follow the exact format: