Buon giorno Salvatore,
Please use xtk:options for this kind of storage, out of the scope of instance.vars.
You define an entry in Administration>Platfom>Options node.
Then in your workflow, with Javascript activity you set:
setOption ("myValueToKeep", vars.NumErrors)
and getOption for reading the value kept between 2 executions, to initialize the vars.numErrors at the beginning of workflow.
xtk:options lines allow text and numeric values, so it is universal method.
I didn't use xtk:Counters, perhaps it is useful but xtk:options is a global system working fine.
Regards
Jean-Serge