Skip to main content

Data Retention

DocApply automatically deletes or anonymizes inactive user accounts and old application data via scheduled jobs. This ensures GDPR compliance without manual intervention.


Overview​

There are two retention mechanisms:

MechanismTargetDefault ThresholdDefault Schedule
User RetentionInactive non-admin users365 days of inactivityDaily at 03:17 UTC
Applicant RetentionOld application records188 days (6 months minimum)Daily at 02:37 UTC

Both support dry-run mode (log-only, no actual deletion) and runtime limits to keep execution safe.


User Retention​

Targets users who have not been active for the configured inactivity period.

What happens:

  • 28 days before deletion: a warning email is sent to the user
  • On deletion day: the account and related data are cleaned up

Cleanup behavior by role:

  • Applicants: applications, reviews, ratings, comments, interview data, uploaded documents, and profile data are deleted
  • Professors / Employees: data is anonymized and reassigned to a placeholder "deleted user" account (configurable via the DELETED_USER_* variables below)
  • Admins: always skipped — admin accounts are never deleted

Applicant Retention​

Targets old application records independently of user accounts. The minimum threshold is 188 days (enforced in code to comply with GDPR).

What is deleted per application:

  • Reviews, comments, document dictionaries, interviewee records
  • Associated uploaded documents
  • The application record itself
info

Applicant retention is disabled by default and runs in dry-run mode. To enable it on production, set both APPLICANT_RETENTION_ENABLED=true and APPLICANT_RETENTION_DRY_RUN=false in GitHub Variables.


Configuration​

All retention properties are managed via GitHub Variables on testserver and production:

User Retention​

VariableDescriptionDefault
USER_RETENTION_ENABLEDEnable/disable scheduled user cleanuptrue
USER_RETENTION_DRY_RUNLog planned deletions without applying themfalse
USER_RETENTION_INACTIVE_DAYS_BEFORE_DELETIONDays of inactivity before a user is eligible for deletion365
USER_RETENTION_BATCH_SIZENumber of users processed per batch300
USER_RETENTION_MAX_RUNTIME_MINUTESMaximum execution time per run10
USER_RETENTION_CRONCron schedule0 17 3 * * *
USER_RETENTION_DELETED_USER_IDUUID of the placeholder user for anonymized data00000000-0000-0000-0000-000000000100
USER_RETENTION_DELETED_USER_EMAILPlaceholder emaildeleted@user
USER_RETENTION_DELETED_USER_FIRST_NAMEPlaceholder first nameDeleted
USER_RETENTION_DELETED_USER_LAST_NAMEPlaceholder last nameUser
USER_RETENTION_DELETED_USER_LANGUAGEPlaceholder languageen

Applicant Retention​

VariableDescriptionDefault
APPLICANT_RETENTION_ENABLEDEnable/disable scheduled applicant data cleanupfalse
APPLICANT_RETENTION_DRY_RUNLog planned deletions without applying themtrue
APPLICANT_RETENTION_DAYS_BEFORE_DELETIONDays before application data is eligible for deletion (minimum: 188)188
APPLICANT_RETENTION_BATCH_SIZENumber of applications processed per batch300
APPLICANT_RETENTION_MAX_RUNTIME_MINUTESMaximum execution time per run10
APPLICANT_RETENTION_CRONCron schedule0 37 2 * * *
tip

Retention runs produce detailed logs for traceability and auditing. Check the server logs to verify that retention jobs are running as expected.