Why isn't this automation working?

Then you need to use a Wait for Trigger action.

There are a couple Blueprints available to address these situations: