Overview
Follow these best practices when designing and building custom solutions. They provide a foundation for solutions that are reliable, scalable, maintainable, and easy for administrators to operate.
Apply these principles across the solution lifecycle: data ingestion and modeling, processing, performance, user experience, and ongoing operations. The goal is to build solutions that handle edge cases gracefully, stay within execution and system limits, and provide clear visibility into their operational state.
Data ingestion and modeling
- Define single sources of truth: Name one source of truth for each company entity before writing any code. Avoid two systems updating the same field. If concurrent writes are necessary, define and implement a conflict resolution strategy prior to implementation.
- Incorporate permissions into schema design: Design permission profiles alongside object architecture. Decide who can create, read, update, and soft-delete each record type before finalizing the data model.
- Separate raw ingestion from canonical models: Land external data in raw objects with the source schema intact. Transform that into canonical objects your functions and workflows use for matching, eligibility, and custom rules.
- Stage operational writes: Aggregate data into a staging custom object before posting to payroll or external systems to create an audit trail and review step. Only write directly inside posting functions for low-risk or read-only work.
- Optimize queries and bulk writes with stable keys: Query on indexed, stable fields (e.g.,
name,external_id,id). Key bulk upserts onexternal_idso writes are idempotent.
Processing and reliability
- Ensure full idempotency across executions: Make functions and workflows idempotent so re-running the same input doesn't duplicate records or double-post. Use workflow run IDs, API idempotency keys, or deterministic external IDs.
- Provide manual fallbacks for automated flows: Give every automated flow a manual admin trigger to handle pipeline failures or delayed runs.
- Separate transient errors from business logic failures: Retry network glitches and rate limits with exponential backoff. Route validation errors, missing config, and business rule rejections to a manual-review state with a reason.
- Implement pre-run reconciliation checks: Add a check before payroll runs to verify all expected input rows have arrived in Rippling.
- Maintain explicit processing state: Store lifecycle state directly on target objects driving external writes: status, timestamps, error reason, retry status, and last attempt.
- Perform currency calculation using whole cents: Standardize financial calculations by working entirely in whole cents. Apply any required currency rounding only at the final output step.
- Preserve precision for time calculations: Keep hours to 4 decimal places when calculating earnings, as Rippling Time & Attendance tracks precision down to the second.
Latency and performance
- Budget for system latency and buffers: Account for delays across pipelines, transformations, and workflows, as a 60-minute schedule often runs closer to 75. Measure actual runtimes and add buffer before committing to timing.
- Use time-based triggers for predictable cadences: Prefer time-based workflows when runs require a fixed schedule; event-based workflows can lag during high load.
- Keep formula fields off time-sensitive paths: Avoid using formula fields in real-time logic, as they can take up to a day to refresh.
- Architect for company-wide execution limits: Function limits are shared across all workflows, pipelines, and CLI calls in the company. Avoid running functions per-employee—batch the work to prevent hitting execution limits.
Simplicity and maintainability
- Minimize architectural complexity: Use the smallest set of custom objects, workflows, functions, and pipelines that meets the requirement.
- Drive custom behavior through configuration: Store customer-specific rules in settings, objects, or lookup tables instead of hardcoded branches in code.
- Design for scale using mandatory pagination: Paginate every list and query until fully exhausted. Design for batching and rate limits so logic scales from 50 to 50,000 records.
- Default to asynchronous execution: Default to async functions, reserving synchronous functions only for blocking user interactions.
Customer experience and operations
- Expose record lifecycle status in the app: Display clear status flags (pending, processing, pushed, failed, skipped, manual review) directly in the app UI so admins can monitor operations without opening raw objects.
- Provide dedicated application entry points: Build user entry points as custom apps or guided workflows rather than forcing admins to interact directly with the Catalog.
- Enforce UI action states and feedback: Disable actions that are invalid for the current record state, return clear status messages from backend functions, and automatically update the UI or trigger a banner alert after execution.
- Implement human-in-the-loop review steps: Pause automated execution and require explicit admin approval before committing sensitive or high-risk writes.
- Run automated health checks on operational pipelines: Schedule time-based health checks to test API token validity, system connectivity, and data freshness, routing failure notifications directly to your existing team monitoring channels.