getTime for timestamp fields, when external signing?

In the docs, the section Where to use getTime, I read…

For workflows that prepare and submit transactions, care needs to be taken when using calls to getTime…

For workflows where this constraint can not be met (e.g. workflows that sign transactions using external parties), it is recommended that workflows are designed to use the ledger time primitives and assertions.

However, that page and the “ledger time primitives and assertions” introduced in 3.x deal with time constraints (e.g, isLedgerTimeGE).

What if I simply want to populate a createdAt field? Can I use getTime? Or do I run the risk of the transaction failing if external signing does not occur within the one-minute window?

Should I populate timestamps like createdAt with an off-ledger time, passed in as a choice argument?

Yes, I believe the transaction will fail if it falls outside of the one-minute window. This is because getTime is resolved when the transaction is first prepared.

That’s certainly an option. You can then use the new time primitives to make sure it falls within certain acceptable windows of ledger time.