Keycloak · Arazzo Workflow
Keycloak Upsert a Realm Role
Version 1.0.0
Create a realm-level role if it is missing, update it if it already exists, then read it back.
View Spec
View on GitHub
AuthenticationAuthorizationIdentity ManagementOAuthOpenID ConnectSecuritySSOArazzoWorkflows
Provider
Workflows
upsert-realm-role
Idempotently define a realm-level role and return its stored representation.
Searches the realm for a role by name, updates it when present and creates it when absent, then reads the role back by exact name to confirm the result.
1
searchRoles
getRoles
Search the realm's roles for the target name. Keycloak matches substrings here, so a hit is treated only as a signal to take the update branch, not as proof of an exact match.
2
updateExistingRole
updateRole
Update the role in place, addressed by its exact name rather than by anything the substring search returned. Jumps straight to the read-back so the create branch is not also executed.
3
createNewRole
createRole
Create the realm-level role. Keycloak answers 201 with no response body, so the representation is resolved by the read-back step that follows.
4
readBackRole
getRole
Read the role by its exact name to return the authoritative stored representation, including the generated id that role mapping calls require.