Module Development

What Are Config Actions? for Drupal 10, 11

The Configuration Actions API is a powerful feature of Drupal recipes that allows you to modify existing configuration without replacing it entirely. While configuration exports let you add new configuration, config actions let you update what's already there—like granting permissions to an existing role or adjusting display settings. Effectively, config actions are a way for a recipe to declare a PHP method to run on a configuration object during recipe application and any arguments that method needs to run.

In this tutorial, we will:

  • Understand what config actions are
  • Learn how to read and write config actions in a recipe's YAML file
  • Explore common patterns like granting permissions and modifying displays
  • Understand the difference between generic and type-specific actions

By the end of this tutorial, you'll be able to read config actions in recipes, understand when to use them versus configuration exports, and recognize common config action patterns.