Hi,
You can choose input parameters, such as trigger record ID, on the left side of script step menu.
All input variables, with names defined by you, passed to script by object input.config()
Then you should do smth like:
let inputData=input.config()
let recordID=inputData.ID
let userName=inputData.name
or, using ES6,
let {recordID, userName}=input.config()
You can also get values as parameters, but depending on the way of record creation, it might be empty, so you can choose another trigger.