HRIS
Get Employee Milestones from HRIS
Implementation: Sync Employee Data and Calculate Milestones
Step 1: Sync Employee Profile Data from Connected HRIS
Use Knit's Sync API to pull employee profile data from any connected HRIS system. Subscribe to the employee_profile model to receive birth dates, start dates, employment status, and custom fields that may contain additional milestone information.
API Endpoint: POST https://api.getknit.dev/v1.0/sync.start
// Initialize sync for employee profile data
const initializeEmployeeSync = async (integrationId) => {
const response = await fetch('https://api.getknit.dev/v1.0/sync.start', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
'x-knit-integration-id': integrationId
},
body: JSON.stringify({
data_type: 'employee',
models: ['employee_profile'],
honorScheduler: true
})
});
return await response.json();
};
// Webhook endpoint receives synced employee data
app.post('/webhooks/knit/employee-sync', (req, res) => {
const { event, data } = req.body;
if (event === 'record.new' || event === 'record.updated') {
const employee = data;
// Store employee milestone dates
storeEmployeeMilestones({
employeeId: employee.id,
firstName: employee.firstName,
lastName: employee.lastName,
email: employee.workEmail,
birthDate: employee.birthDate,
startDate: employee.startDate,
employmentStatus: employee.employmentStatus
});
}
res.status(200).send('Received');
});
Step 2: Calculate Upcoming Milestones and Create Trigger Schedule
Process synced employee data to identify upcoming milestones. Calculate trigger dates (typically 7-14 days before the actual milestone) and schedule automated gifting workflows accordingly.
// Calculate upcoming milestones for all active employees
const calculateUpcomingMilestones = (employees) => {
const today = new Date();
const upcomingMilestones = [];
employees.forEach(employee => {
// Skip inactive employees
if (employee.employmentStatus !== 'ACTIVE') return;
// Calculate birthday milestones
if (employee.birthDate) {
const nextBirthday = getNextOccurrence(employee.birthDate);
const daysUntilBirthday = Math.floor((nextBirthday - today) / (1000 * 60 * 60 * 24));
if (daysUntilBirthday === 7) {
upcomingMilestones.push({
type: 'birthday',
employeeId: employee.employeeId,
employeeName: `${employee.firstName} ${employee.lastName}`,
email: employee.email,
milestoneDate: nextBirthday,
triggerDate: new Date(today)
});
}
}
// Calculate work anniversary milestones
if (employee.startDate) {
const yearsOfService = Math.floor((today - new Date(employee.startDate)) / (1000 * 60 * 60 * 24 * 365));
const nextAnniversary = getNextAnniversary(employee.startDate);
const daysUntilAnniversary = Math.floor((nextAnniversary - today) / (1000 * 60 * 60 * 24));
// Trigger for milestone years: 1, 5, 10, 15, 20, 25
const milestoneYears = [1, 5, 10, 15, 20, 25];
if (milestoneYears.includes(yearsOfService + 1) && daysUntilAnniversary === 14) {
upcomingMilestones.push({
type: 'work_anniversary',
employeeId: employee.employeeId,
employeeName: `${employee.firstName} ${employee.lastName}`,
email: employee.email,
yearsOfService: yearsOfService + 1,
milestoneDate: nextAnniversary,
triggerDate: new Date(today)
});
}
}
});
return upcomingMilestones;
};
Step 3: Initiate Automated Gifting Workflow When Milestone Approaches
When a milestone trigger date arrives, automatically initiate your platform's gifting workflow. This might include budget approval, gift selection interfaces, manager notifications, or direct gift fulfillment based on pre-configured preferences.
// Trigger automated gifting workflows for upcoming milestones
const triggerGiftingWorkflows = async (milestones) => {
for (const milestone of milestones) {
switch (milestone.type) {
case 'birthday':
await initiateBirthdayGift(milestone);
break;
case 'work_anniversary':
await initiateAnniversaryGift(milestone);
break;
case 'onboarding_milestone':
await initiateOnboardingGift(milestone);
break;
}
}
};
// Example birthday gift workflow
const initiateBirthdayGift = async (milestone) => {
// Retrieve employee preferences from your database
const preferences = await getEmployeeGiftPreferences(milestone.employeeId);
// Check budget allocation for birthday gifts
const budgetApproved = await checkBudgetAvailability('birthday', preferences.department);
if (budgetApproved) {
// Create gift selection workflow
const giftWorkflow = {
employeeId: milestone.employeeId,
recipientName: milestone.employeeName,
recipientEmail: milestone.email,
giftType: 'birthday',
occasionDate: milestone.milestoneDate,
budgetCategory: preferences.budgetTier,
giftOptions: await fetchGiftOptions('birthday', preferences),
approvalRequired: false, // Auto-approved for birthdays
status: 'pending_selection'
};
// Trigger gift selection notification
await sendGiftSelectionEmail(giftWorkflow);
// Log milestone gift initiation
await logMilestoneGift({
type: 'birthday',
employeeId: milestone.employeeId,
triggeredAt: new Date(),
scheduledDeliveryDate: milestone.milestoneDate
});
}
};
Key Data Models and APIs
Knit provides unified access to employee milestone data across 30+ HRIS platforms through standardized data models:
| Data Model / API | Description |
|---|---|
employee_profile |
Core employee information including firstName, lastName, workEmail, birthDate (for birthday tracking), startDate (for tenure/anniversary calculation), employmentStatus (to filter active employees), and custom fields that may contain additional milestone dates. |
POST /v1.0/sync.start |
Initiates data synchronization for subscribed employee models. Specify data_type: "employee" and models: ["employee_profile"] to sync milestone-relevant fields. |
| Webhook Events | Receive record.new events when new employees join and record.updated events when employee data changes. Real-time webhooks ensure milestone calculations stay accurate. |
employee.employmentStatus |
Enum field with values ACTIVE, INACTIVE, NOT_SPECIFIED. Filter for ACTIVE employees to avoid triggering gifts for terminated staff. |
| Date Fields | All date fields follow RFC3339 (ISO 8601) format: YYYY-MM-DD. This standardization simplifies milestone date calculations across different HRIS platforms. |
Wrapping Up: Automate Recognition and Strengthen Employee Engagement
Automating employee milestone recognition through HRIS data sync transforms gifting platforms from reactive tools into proactive recognition engines. No more manual date tracking, missed birthdays, or forgotten anniversaries. With Knit's unified employee data model, your platform automatically identifies upcoming milestones and triggers timely, personalized gift workflows that make every employee feel valued—exactly when it matters most.
Key capabilities unlocked:
- Unified API for 30+ HRIS Systems: Connect once to Knit, sync employee data from BambooHR, Workday, ADP, Personio, and more without building individual integrations
- Real-Time Webhook Delivery: Receive employee data changes instantly via webhooks, keeping milestone calculations accurate without polling APIs
- Automatic Delta Syncs: After initial sync, Knit automatically pushes only changed employee records at configured intervals, keeping milestone data fresh
- Standardized Date Formats: All HRIS platforms return dates in consistent ISO 8601 format, eliminating date parsing complexity
- Custom Milestone Support: Sync organization-specific milestone dates from HRIS custom fields for tailored recognition programs