How do you ensure that only one “copy” of a worker will be active in a multi node otp application?

Note this relies on :global so it isn’t resistant to netsplits. If you already have a DB that supports locks you could use that in addition to this to get a robust combo. Or, in fact, just have the task run on all nodes and rely entirely on locks + a “last updated” timestamp to avoid duplicate updates.