New to Kestra?
Use blueprints to kickstart your first workflows.
Audits active Okta user accounts to detect dormant accounts exceeding inactivity thresholds, reducing SaaS license waste and security exposure.
Enterprise Identity and Access Management (IAM) teams must maintain strict lifecycle governance over active workforce identities. Orphaned or dormant accounts belonging to departed employees, temporary contractors, or inactive consultants represent both a significant security attack surface and unnecessary SaaS licensing expenditure. This workflow continuously inspects active Okta accounts, flags users who have not logged in within the configured threshold, and alerts IAM security teams to prompt deprovisioning.
0 9 * * 1) or triggers on-demand via manual execution./api/v1/users?filter=status eq "ACTIVE") using SSWS administrative tokens..lastLogin timestamps against the current UTC date, falling back to account creation dates for users who have never logged in.io.kestra.plugin.core.flow.If task evaluates whether inactive_users_count exceeds max_tolerated_inactive_users.SlackIncomingWebhook listing email addresses, user IDs, and elapsed dormant days.flowchart TD
A[weekly_okta_audit Schedule Trigger] --> B[scan_okta_inactive_users Python Script]
B --> C[check_inactive_accounts Flowable If]
C -- Dormant > Tolerance --> D[notify_slack_identity_team Webhook]
C -- Clean Directory --> E[log_okta_audit_status Log]
D --> E
E --> F[export_okta_manifest Return]
| Name | Type | Default | Description |
|---|---|---|---|
okta_org_url |
STRING |
https://dev-example.okta.com |
Base domain URL for the target Okta identity management tenant. |
inactivity_threshold_days |
INT |
90 |
Threshold of days without login before an active account is flagged for deprovisioning. |
alert_on_inactive_users |
BOOL |
true |
Whether to dispatch alerts when dormant active user accounts are identified. |
max_tolerated_inactive_users |
INT |
5 |
Maximum allowable count of dormant users before triggering an escalation alert. |
{{ outputs.scan_okta_inactive_users.vars.total_active_users_audited }}: Number of active Okta users scanned during the audit.{{ outputs.scan_okta_inactive_users.vars.inactive_users_count }}: Number of active accounts exceeding the dormancy threshold.{{ outputs.scan_okta_inactive_users.vars.inactive_users_details }}: Serialized JSON list of dormant accounts with emails and elapsed days.{{ outputs.export_okta_manifest.value }}: Structured dictionary containing the consolidated tenant audit summary.okta.users.read or Read-Only Administrator role privileges.OKTA_API_TOKEN: Okta administrative API token used for SSWS authentication.SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used for dispatching alert messages.OKTA_API_TOKEN and SLACK_WEBHOOK_URL in your Kestra Secret storage.company.security namespace.okta_org_url with your company Okta tenant URL (e.g., https://mycompany.okta.com).rel="next") to traverse the full directory.POST /api/v1/users/{id}/lifecycle/suspend request to automatically suspend confirmed dormant accounts.