r/KeyCloak • • 8d ago

Keycloak Workflows – Use cases?

Has anyone started using the new Workflows feature in Keycloak 26.6?

I'm curious to know what real-world business use cases people are implementing, particularly around client/users onboarding, automation, and lifecycle management.

Would love to hear about your experiences and any limitations you've encountered.

11 Upvotes

8 comments sorted by

8

u/CarinosPiratos 8d ago

For now we have some custom webhook thingy. Sending x events when happening.

Sendining a mail when user is locked out by brute force protection.

Deleting users after X days after last login. GDPR stuff

Delete user after the session finished, when authenticated via ID Card. For now only in germany, next year whole Europe, via EUDI Wallet.

Delete old attributes on users, with batch.

I have seen approval strategies aswell.

All in all powerful tool, relatively steep curve for implementing.

1

u/Particular_Way_4644 7d ago

Thanks for sharing your experience and the references! Have you explored Workflows for client onboarding rather than user lifecycle management? For example, triggering a workflow when a new OIDC client is created and automatically applying predefined configurations, assigning client scopes, or sending notifications using custom workflow steps?

1

u/proxyworm 7d ago

we have automated the process for custom KEYCLOAK deployment as per user / client demand for various Oauth Flow

1

u/CarinosPiratos 4d ago

We played around with it, but I would assume the Client Profile feature would be the correct place, to align settings.

2

u/trancecircuit 7d ago

I was looking at it recently because I have approval use cases where a user needs IV (via API call and callvack) and then manager's approval before allowing through. Also another use case is expiring group memberships after a timestamp in use profile is passed.

So when you say steep curve for implementing, can you elaborate on why? Is it hard to access right objects? Is it the workflow structure translated to code? Lack of documentation? Thanks in advance.

4

u/CarinosPiratos 7d ago

That group membership thingy is "solved" already. I think I saw a talk about that on the Keycloak Dev day.

Possibly it was 2025, so worth checking that out. You can find the videos on Youtube.

The docs are a little spread, so it was hard in the beginning to find the correct docs I need. I did use theses ones: https://github.com/keycloak/keycloak/tree/main/docs/documentation/server_admin/topics/workflows

After 2-3 hours of building Workflows, I got used to it. It is harder than creating an EventListener, but not impossible by any means. With AI you should be good to go.

There are Multiple Types, Events, Steps and Conditions.

Events, are super easy -> https://github.com/keycloak/keycloak/pull/51466/changes

Steps, are easy aswell. Internal stuff, so I can't post any link.

For me it were the Conditions, where I struggled the most. With its evaluate and predicate foo.
For e.g. here is the GroupMembershipCondition: https://github.com/keycloak/keycloak/blob/main/model/jpa/src/main/java/org/keycloak/models/workflow/conditions/GroupMembershipWorkflowConditionProvider.java

If you need some assistance to get started, just PM me.

PS: Also I ran into some issues, with the periodic run. So in your tests, you need to set the correct Parameters, for the Debug Logging and the period, where Keylcoak checks, if a Workflow should be executed.

1

u/proxyworm 7d ago

We have onboard KEYCLOAK in our production Internet Banking Application with custom SPI. Its doing good