I want to expand on the implementation details for others considering this approach, covering the dynamic form schema API design, metadata-driven forms architecture, and external HR integration patterns.
Dynamic Form Schema API Design:
Our API follows a three-layer architecture:
-
Schema Generation Layer: Queries metadata repository (Workday in our case) to build form schema based on employee context (role, department, location, employment type). The schema is JSON-based following JSON Schema specification with custom extensions for Mendix-specific rendering hints.
-
Prefill Data Layer: Fetches employee data from HR system and cached Mendix data to populate form fields. Uses intelligent caching - static data (department structure) cached for 24 hours, dynamic data (employee details) cached for 1 hour.
-
Validation Layer: Applies validation rules from metadata and executes custom validation microflows referenced in schema. Validations run both client-side (for UX) and server-side (for security).
API endpoint pattern:
GET /api/forms/onboarding?employeeId={id}&department={dept}&role={role}
GET /api/forms/onboarding/validate (POST with form data)
POST /api/forms/onboarding/submit
Metadata-Driven Forms Architecture:
The schema structure we use:
{
"formId": "onboarding-engineering-2024",
"title": "Engineering Onboarding",
"sections": [
{
"sectionId": "personal-info",
"title": "Personal Information",
"fields": [
{
"fieldId": "email",
"type": "email",
"label": "Work Email",
"required": true,
"validation": {"pattern": "^[a-z]+@company\.com$"},
"prefillSource": "hr.workEmail"
}
]
}
],
"fieldDependencies": [...],
"submitEndpoint": "/api/forms/onboarding/submit"
}
Key design decisions:
- Field types match HTML5 input types plus custom types (signature, file-upload, multi-select)
- Validation rules use JSON Schema validation vocabulary
- Field dependencies support conditional visibility and value dependencies
- Prefill sources map to HR system fields or Mendix entities
External HR Integration (Workday):
Three integration patterns:
-
Batch Sync (nightly):
- Full sync of organizational structure, employee core data, onboarding templates
- Stores in Mendix for fast access
- Handles deltas to avoid full reload
-
Real-time Lookup (on-demand):
- Validates employee IDs, checks employment status
- 2-second timeout with fallback to cached data
- Used sparingly to avoid latency
-
Webhook Notifications (event-driven):
- Workday pushes changes when employee data or onboarding templates change
- Invalidates relevant caches
- Triggers re-generation of affected form schemas
Integration is built using Mendix REST Consume module with OAuth2 authentication. We maintain a connection pool and implement circuit breaker pattern to handle Workday outages gracefully.
Implementation Benefits:
- 80% reduction in manual form configuration (measured over 6 months)
- Time-to-launch: 2 weeks → 2 days for new onboarding workflows
- HR self-service: Non-technical HR staff can modify onboarding requirements
- Consistency: All forms follow same UX patterns automatically
- Maintenance: Single form rendering engine vs. dozens of custom forms
Challenges and Solutions:
-
Complex Validation Logic: Some business rules were too complex for declarative validation. Solution: Allow custom validation microflows referenced by name in schema.
-
Performance with Large Forms: Forms with 50+ fields had slow initial load. Solution: Implement lazy loading for sections - only load visible sections initially.
-
Version Management: Changes to metadata could break in-progress forms. Solution: Schema versioning - each form instance locks to schema version at creation time.
-
Testing: Difficult to test all form variations. Solution: Automated schema generation tests and visual regression testing with Selenium.
Recommendations for Implementation:
Start small - implement for one onboarding workflow first. Prove the concept before expanding. Focus on the 80/20 rule - cover common cases with metadata, allow custom development for edge cases. Build comprehensive schema documentation and validation tools. Invest in monitoring - track schema generation time, form load time, and error rates. Most importantly, involve HR early - they’re your primary users of the metadata configuration.
This approach works beyond onboarding - we’ve extended it to performance reviews, leave requests, and equipment procurement. The pattern is universally applicable wherever you have repetitive form-based workflows with similar structure but different field requirements.