Daily-scheduled Okta Workflow that detects email/username mismatches on Okta profiles and username/UPN drift in downstream app assignments, logs each to a table, and emails a summary.
Import this directly into Okta Workflows. Creates 3 flows, 1 table, and 2 connection placeholders.
Okta user profiles pass a username variable into each assigned application. When that app-user userName is set equal to the account username (the usual default), it stays in sync. But if you change the username on an Okta profile, Okta does not cascade the change into each existing application assignment. Those have to be re-synced manually, and any downstream app that uses username as the UPN will drift.
This workflow catches two kinds of drift:
userName on any of that user's app assignments.Three flows, one table, two connections.
| Column | Type | Purpose |
|---|---|---|
| Okta User ID | Text | Okta user.id |
| Text | profile.email | |
| Okta Username | Text | profile.login |
| App Name | Text | App label (empty for email mismatches) |
| App Username | Text | App assignment userName (empty for email mismatches) |
| Mismatch Type | Text | email_vs_username or username_vs_upn |
| Detected At | Date | Run timestamp |
In Okta Workflows console: File → Import, select username-discrepancy-audit.flopack. This creates a folder named Username Discrepancy Audit with the 3 flows and the table.
Two connection placeholders were created:
If you want Outlook/Office 365 instead of Gmail, delete the Send Email card and drop in Office 365 Mail → Send Email.
The flopack intentionally ships connector cards with empty input pins — Okta populates the correct pin schemas automatically when you open the flow in the editor. Drag outputs into inputs as follows.
status eq "ACTIVE" (or broader if you want to catch suspended accounts). Leave Limit at 200 per page.id into the helper's User ID input.Detected At >= today_start (use the Now card subtracted by 24h, or a date-truncated value).Length > 0.Username discrepancy audit - {{count}} issue(s) detected today.
Full details in the Username Discrepancies table:
https://your-org.workflows.oktapreview.com/ ...
Okta username drift: {{count}} issue(s). Body = Compose output.Read User → profile.email vs Read User → profile.login. Operator: Does Not Equal.email_vs_username. Detected At = Now.profile.emailprofile.loginlabelcredentials.userNameusername_vs_upn. Detected At = Now.Main flow ships scheduled for 07:00 America/New_York daily. Open the flow → Schedule tab to change time, cadence, or timezone.
Toggle each flow to ON (top-right of the flow editor). Helpers must be on or For Each calls will fail.
userName. Optionally filter those out with a Continue If on the app status inside Helper 2.user.lifecycle.update_profile that calls Helper 1 with the changed user. The daily sweep stays as the coverage safety net.This workflow detects; it doesn't auto-fix, by design — UPN changes can break sessions and downstream SSO. To remediate a username_vs_upn row: