persist state of a variable inbetween script runs

Hi,

I’m implementing a script which checks some local configuration and want to notify an external (rest)api of a change via /tool fetch.
This is working fine already but it should run quite often and I was wondering if I can reduce the api access to just transmit changes. But for this I would need to know the result of the last execution. Is this possible somehow?

Sorry for the beginner question.
Found it now by using :global variables.