Is it possible to know what change triggered an automation in a script?

I’d like to optimize my automation by running the same automation whether any field is updated, but perform a change related to the updated field only.

How can I know what field was updated from a script?

The script cannot identify the updated field on its own. However, you could have formula fields do this. You could have last modified time fields for each of the inputs, and have the script compare the last modified times with the current time. Or you could have a formula field that uses last modified times to identify the field that was modified last.

Thanks but that won’t be reliable, but the time the automation runs, other fields may have been changed and it might not use the field that actually triggered the automation.