Lightly coat your slow cooker with non-stick cooking spray or a thin layer of olive oil to prevent sticking and make cleanup easier.
Heat butter in a large skillet over medium heat. Add sliced onions and cook for 8-10 minutes until they begin to soften and turn golden. Add minced garlic and cook for another minute until fragrant.
Transfer the caramelized onions to your slow cooker. Whisk together beef broth, Worcestershire sauce, thyme, and flour (or cornstarch) in a bowl until smooth, then pour over the onions.
Season chicken breasts generously with salt and pepper on both sides, then nestle them into the onion mixture.
Cover and cook on low for 6-7 hours or on high for 3-4 hours. The chicken is ready when it reaches an internal temperature of 165°F (74°C) and shreds easily with a fork.
During the final 10-15 minutes of cooking, sprinkle the shredded Gruyère cheese over the chicken. Cover again to allow the cheese to melt.