Instance variables are cleared when executing a workflow
Good morning, I'm encountering a rather unique problem that I can't seem to fix.
To make it short I use javascript code which configures schedulers, but when the workflow runs and executes the javascript code it must be restarted for the scheduler modifications to be taken into account. to prevent it from restarting the workflow in a loop I use an instance variable "<variables lastSavedDate="xxxx-xx-xx"/>". The Javascript code will check if the value that I entered in a script variable (var inputDate) is equal to instance.vars.lastSavedDate, if this is the case then it continues processing, if this is not the case then it updates the lastSavedDate variable with the value of inputDate then it restarts the workflow.
In theory I think it should work, in practice my instance variable is simply cleared. when I do a logInfo(instance.vars.lastSavedDate), the log returns "undefined" and when I return to the workflow variables there is only "<variables/>" which is entered instead of "< variables lastSavedDate="xxxx-xx-xx"/>" Do you have any idea why it does this and how to fix it?