How detect Invalid config: History, recorder, and logbook could not be set up in automation?

Hi!
If HA start before MySQL (Other host) start, i have Notify like:

Invalid config
The following integrations and platforms could not be set up:
  history
  logbook
  energy
  default_config
  history_stats.sensor
Please check your config and logs.

How detect this notify in automation and restart HA after MySQL get online status?

Like this:

Yes, but no … I don`t need all persistent notification like:

    trigger:
      - platform: state
        entity_id: persistent_notification.http_login

I need only this notify (Invalid config ...)

Look like i found: core/config.py at 952d11cb0390852656206cd164db7099ea8e22ee · home-assistant/core · GitHub
I need try:

    trigger:
      - platform: state
        entity_id: persistent_notification.invalid_config

But I don’t know if the automation will work when Home Assistant starts, because this message appears before Home Assistant starts completely.
Or is there a way to catch this notification, then wait for Home Assistant to start completely, and then perform the action?
Can you tell me how (if it is possible)?