@karlenigma If your Workflow Action is firing
Before Record Submit it should behave the same as a User Event script. In your script, I believe you just need to swap your use of
record
(you don't need the
N/record
module at all) for
scriptContext.newRecord