Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[[_workflow_conditions_]]
= Defining conditions

The optional `if` setting allows you to define a condition using an expression language that must be met for the workflow to be triggered.
It allows more fine-grained control over when a workflow execution should be created based on the context of the event.
The optional `if` setting allows you to define the conditions the target resource must meet in order for the workflow to be triggered.

Conditions provide fine-grained control over whether a workflow execution should be created.
They allow you to inspect the context of the event and the state of the resource.
Expand All @@ -16,7 +15,7 @@ If the condition evaluates to `true`, the workflow execution is created. If it e
the expression from the `on` setting evaluates to `true`.

Just like the `on` setting, the condition is written using an expression that supports a variety of checks on the realm resource associated with the event.
For instance, considering a `user_group_membership_created` event, you can define a condition to trigger the workflow only if the user has a specific attribute:
For instance, considering a `user_created` event, you can define a condition to trigger the workflow only if the user has a specific attribute:

```yaml
on: user_created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ As you can see, events are functions in an expression and, as such, they also su
For example, to trigger a workflow when a user is added to a specific group, you can use the following expression:

```yaml
on: user_group_membership_created('/mygroup')
on: user_group_membership_added('/mygroup')
```

You can also combine multiple conditions using logical operators. For example, to trigger a workflow when a user is created or when authenticates, you can use:
You can also combine multiple conditions using logical operators. For example, to trigger a workflow when a user is created or when they authenticate, you can use:

```yaml
on: user_created or user_authenticated
Expand All @@ -47,10 +47,10 @@ At the moment, workflows support event functions for the following realm resourc
| `user_created` | User is added to the realm. | None
| `user_removed` | User is removed from the realm. | None
| `user_authenticated` | User authenticates to the realm. | The client id of the client acting on behalf of the user when authenticating.
| `user_federated_identity_created` | User is federated or when the account is linked to an identity provider. | The identity provider alias.
| `user_federated_identity_added` | User is federated or when the account is linked to an identity provider. | The identity provider alias.
| `user_federated_identity_removed` | User's federated identity is removed or unlinked from an identity provider. | The identity provider alias.
| `user_role_granted` | A role is granted to the user. | The role name.
| `user_role_revoked` | A role is revoked from the user. | The role name.
| `user_group_membership_created` | User joined a group. | The group name or path
| `user_group_membership_added` | User joined a group. | The group name or path
| `user_group_membership_removed` | User is removed from a group. | The group name or path
|===