Automation Action Works When Run Manually But Not When Triggered

I have an automation that is triggered by an entity state change. The action calls a service that in turn calls a mariadb stored procedure. If I run the action manually via the automation edit page, it works as expected. If I trigger the entity state change via the developer console, the automation is triggered and in the trace I can see that it ran the action but the action does not work. There are no errors either in the logs or trace. This is my automation yaml:

description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.withings_weight
condition: []
action:
  - service: notify.mysql_command_homeassistant_db
    data_template:
      message: CreateStatesTempTable
mode: single

So something is not changing the state of the trigger entity, that’s where to look, you have tested this part with the manual trigger.
either that’s not the entity you think it is or something.

Figured it out. The stored procedure that was being executed gathers data from the home assistant states table. When the automation was being triggered, the states table wasn’t quite updated so was pulling an old value. Adding a delay of a few seconds has fixed the issue. When I manually ran the action, the states table had already been updated.