Given the “database-like” behavior of Grist, I think this would only be possible if you add a “Creation Date” column, with a trigger formula and the time function. That would give something like that:
"Num{}".format(1 + table.lookupRecords(
Creation_Date=$Creation_Date,
sort_by="manualSort"
).id.index($id))
And the Creation Date trigger formula would be:
from time import time
int(time())
It’s possible to elaborate with other kinds of conditions, like in this thread.
This table may be a starting point to illustrate all that.