Skip to content
senn-techsenn-tech
Back to blog
Infrastructure
Servers, Proxmox and network2026-11-28· By Franz Senn

Keycloak Workflows: onboarding and inactivity locks as YAML rules

On 27 November 2026 the Keycloak project published the first part of a practice series on Workflows. It shows three processes as YAML: onboarding new accounts, handling inactive accounts and granting the admin role for a limited time. The facts about the feature come from the project's publications; the recommendations are our assessment. We have not run these processes ourselves.

Keycloak Workflows are a rules engine inside the identity provider. A YAML file describes which event or schedule starts a process, who it applies to and which steps follow. The engine can, for example, send mail, grant or revoke roles, assign groups and disable accounts, either immediately or after a waiting period.

Keycloak logo
Keycloak is an open source project for sign-in and permissions. (source: Simple Icons 16.36.0, file keycloak.svg (licence field in the metadata: custom, Linux Foundation Trademark Usage), mark: Keycloak Authors / The Linux Foundation)

Maturity

VersionFeature status according to the projectReleased
26.4experimental (project blog)September 2025
26.5previewJanuary 2026
26.6supportedApril 2026
26.8adds automatic invitations through workflowsOctober 2026

The feature is young. Read the release notes of your version before you adopt it.

How a rule is built

on names the event, for example user-created or user-authenticated. Alternatively or in addition, schedule checks at intervals which accounts match a condition. if filters who is meant: by attributes, roles, groups or an identity provider link. steps runs the actions, delayed with after. The documentation notes that the check for due steps runs every 12 hours by default.

Anatomy of a workflow ruleTriggeron or scheduleConditionif: attribute, role, groupStepssteps: mail, role, disableDelayafter: checked every 12 h
(source: Keycloak Server Administration Guide 26.8.2)

Example: inactive accounts

Inactivity is not a condition in the engine. The project's post solves it like this: every login starts the process, and restart-in-progress sends it back to the beginning at the next login. An account that stays away reaches the steps one after another. Shortened here:

name: Track inactive users
on: user-authenticated
concurrency:
  restart-in-progress: true
steps:
  - uses: notify-user
    after: 90d
    with:
      subject: We miss you!
      message: It has been a while since your last login.
  - uses: notify-user
    after: 60d
    with:
      subject: Your account will be disabled soon
      message: Log in now to keep your account active.
  - uses: disable-user
    after: 7d
From login to lockEvery login startsafreshrestart-in-progressFirst messageafter: 90dWarning before thelockafter: 60dDisable the accountafter: 7d
(source: own diagram based on the Keycloak practice post of 27 November 2026)

The waiting periods add up: 90, then 60, then 7 days. These values come from the example, and each organisation sets its own deadlines. Without schedule this rule only covers accounts that log in after it is switched on. Old accounts that are never used again stay untouched.

Onboarding and time-boxed rights

The onboarding example sends new accounts with the attribute department=engineering a welcome message and grants the developer role and the /Engineering group. The third example starts when someone receives the admin role: a warning follows after seven days and the removal one day later. Accounts with the attribute permanent-admin=true are excluded. Conditions on attributes need care: whoever can edit such an attribute influences which steps run for the account. The documentation advises letting only administrators edit such attributes and not setting unmanaged attributes to Enabled.

Limits in operation

According to the documentation, Keycloak does not persist workflow execution history. If you must prove which account passed which stage and when, enable DEBUG logging for org.keycloak.models.workflow beforehand and retain the logs, or build your own event listener. According to the documentation the engine retries a failed step without limit. While a rule with delayed steps has active instances, its step chain cannot be changed: wait for them to finish, or delete the workflow with its instances and create a new one. The engine does not replace approvals by managers or HR. If such a process already runs in a ticketing system, the decision can stay there.

The sign-in basics are covered in Keycloak as the central login. More articles sit under servers and network, and help with a sign-in overhaul under IT services.

Further sources

Questions?
Do I have to install anything to use Keycloak Workflows?+

No. According to the release notes, Workflows have been supported since Keycloak 26.6 from April 2026. According to the feature guide they are enabled by default. The command kc.sh --version inside the container shows which version is running.

Does Keycloak store what a workflow did?+

No. According to the documentation, execution history is not persisted. There are log messages, by default just warnings and errors, and DEBUG logging shows the full flow. For a complete audit trail the documentation points to custom event listeners on the provider interface.

How do I test workflows without risk?+

Use a separate test instance with test accounts and a test mail server, no real addresses. Shorten delays and the check interval for testing. Before enabling in production, back up the database and start with a mail-only rule with a narrow condition.