Instructions
Core Workflow
This skill orchestrates a multi-step process to manage employee onboarding and task reminders via a Snowflake database. Follow these steps precisely.
1. Initial Exploration & Context Gathering
- •Objective: Understand the database landscape and locate the relevant onboarding document.
- •Actions:
- •List all available Snowflake databases. Identify the one likely containing employee data (e.g.,
LANDING_TASK_REMINDER). - •List the contents of the
/workspace/dumps/workspacedirectory to find the onboarding PDF (e.g.,landing_tips.pdf). - •Read the PDF to extract the standardized task list, deadlines (D+7, D+30, etc.), and group assignments (Backend, Frontend, Testing, Data).
- •List all available Snowflake databases. Identify the one likely containing employee data (e.g.,
2. Database Schema Investigation
- •Objective: Map the database structure to understand how data is organized.
- •Actions:
- •List all schemas within the target database.
- •List all tables within the target schema (e.g.,
PUBLIC). - •Describe the key tables to understand their columns:
- •
EMPLOYEE(ID, Name, Email, Manager_ID) - •
EMPLOYEE_LANDING(Employee_ID, Landing_Date, Task_Assigned_Flag) - •
PUBLIC_TASKS(Employee_ID, Task_Name, Deadline, Status) - •Group-specific task tables (
GROUP_TASKS_BACKEND,GROUP_TASKS_FRONTEND, etc.)
- •
3. Data Analysis & Logic Building
- •Objective: Identify new employees needing onboarding and existing employees with overdue tasks.
- •Actions:
- •Query the
EMPLOYEEandEMPLOYEE_LANDINGtables. Cross-reference to find employees whereLANDING_TASK_ASSIGNED = FALSE. These are the new hires. - •For each new hire, determine their group/manager by joining the
EMPLOYEEtable with itself (manager lookup viaREPORT_TO_ID). Infer group from manager ID based on historical data from group task tables. - •Get the current date (
CURRENT_DATE()). - •For each task table (
PUBLIC_TASKS,GROUP_TASKS_*), query for records whereFINISHED_FLAG = FALSEANDDDL < CURRENT_DATE(). Join with employee/manager data for context.
- •Query the
4. Data Manipulation & Task Creation
- •Objective: Create task records for new employees and update their status flags.
- •Actions:
- •For each new employee, calculate deadlines based on their landing date and the rules from the PDF (e.g., Public Tasks: D+7, Backend Tasks: D+30).
- •Execute
INSERTstatements intoPUBLIC_TASKSand the appropriateGROUP_TASKS_*table with the task names, calculated deadlines, andFINISHED_FLAG = FALSE. - •Update the
EMPLOYEE_LANDINGtable, settingLANDING_TASK_ASSIGNED = TRUEfor the processed new hires.
5. Communication & Notification
- •Objective: Send formatted emails to employees and their managers.
- •Actions:
- •For New Employees (Onboarding): Generate an email for each new hire. Use the exact format: