diff --git a/src/Plugin/RulesAction/UserRoleAdd.php b/src/Plugin/RulesAction/UserRoleAdd.php
index 48471a2..4ddde26 100644
--- a/src/Plugin/RulesAction/UserRoleAdd.php
+++ b/src/Plugin/RulesAction/UserRoleAdd.php
@@ -4,6 +4,7 @@ namespace Drupal\rules\Plugin\RulesAction;
 
 use Drupal\rules\Core\RulesActionBase;
 use Drupal\user\UserInterface;
+use Drupal\user\Entity\Role;
 
 /**
  * Provides a 'Add user role' action.
@@ -45,6 +46,11 @@ class UserRoleAdd extends RulesActionBase {
    */
   protected function doExecute(UserInterface $account, array $roles) {
     foreach ($roles as $role) {
+      // Check that role is loaded and not just id.
+      if (!is_object($role)) {
+        $role = Role::load($role);
+      }
+
       // Skip adding the role to the user if they already have it.
       if (!$account->hasRole($role->id())) {
         // If you try to add anonymous or authenticated role to user, Drupal
