Migrating from Rules to Actions

Overview

Customers will need to begin migrating their existing Rules and Hooks to Actions as Rules and Hooks reach end of life on November 18, 2024.
 

Key Dates for the Deprecation

  • October 16, 2023 - Rules and Hooks will no longer be available for tenants of new and existing customers.
  • Existing tenants using Rules and Hooks will maintain access to those features until EOL but are highly encouraged to start the migration to Actions as soon as possible.
  • November 18, 2024 - Rules and Hooks will reach end of life and will be removed from all tenants. In practical terms, this will mean Rules and Hooks currently configured in a given tenant will no longer execute during the login pipeline.

Applies To

  • Rules
  • Hooks
  • End of Life

Solution

Migrating from Rules to Actions can be broken down into four main steps:

1. Plan the migration: Post-Login Actions run after existing Rules, so Rules can be converted one at a time in the Dashboard or all at once using the Management API. Tips when planning the migration:

  • Keep Actions and Rules 1:1 so functionality can be turned off and on in blocks and tested.
  • Use flags in user metadata to avoid duplicating expensive or one-time operations.
  • Start at the end of the Rules pipeline and work backward because active Rules run before deployed Actions. This allows for keeping some logic in Rules as logic is built and tested in Actions.
  • Make sure to run changes when impact and traffic will be lowest.
  • Consider temporarily customizing the login page to halt logins if the cutover could cause invalid logins or gaps in protection.
  • Consider using the Auth0 Deploy CLI to script, test, and quickly implement the migration all at once or iteratively.

2. Understand limitations: While Actions can handle the vast majority of things that Rules can, be aware of a few limitations before starting the migration. (Remember: both Rules and Actions can run during the migration.)

3. Convert code: To convert a Rule to an Action, replace Rule-specific code with Actions code. This section covers the tasks to perform to turn a functioning Rule into its equivalent Action. Tips when converting code: 

  • In general, look for the read-only properties of Rules user and context objects on the Actions event object. Look for any side effects Actions have on the system (like failing a login or updating user metadata) in the api object functions.
  • Use the Actions Code Editor in the Auth0 Dashboard to write the code; it will help by highlighting errors and supplying auto-complete suggestions.
  • Before going live, thoroughly test the new Actions in a staging or test environment.

4. Complete the migration: Once the new Actions code has been written and tested, activate the Action and deactivate the Rule. These two tasks can be done quickly in succession, but depending on the order, there might be a short period where either both or neither are running. Because active Rules run before deployed Actions, start at the end of the Rules pipeline and work backward, it allows for keeping some logic in Rules as the logic in Actions is built and tested.

Recommended content

No recommended content found...