The window/document setTimeout function's browser based. This is SSJS and there's no window or document object to provide this functionality.
You can use the Script.Util.HttpRequest() function to set the timeout for your request. If you inspect the returnStatus of the response for a failure, you can handle the error.
Output the @ro variable and double check its output in your journey setup, not email studio.
Probably @ro is empty in your Journey data extension but filled in your test DE, which could explain the behaviour.
A typical root cause could be that the Journey Entry Source fieldname is different from "Retention_Owner__c", which you assume in your code.
The answer to all your questions is yes:
you can store pdfs or other files either in Content Builder or in your sFTP
you can use AMPscript to attach the files to your emails
you can use AMPscript to dynamically match subscriber data with files and to create conditional statements
you can match a file based on a filename, customer key, etc.
Some examples ...
IsEmailBounced and the email opt out fields are different things. IsEmailBounced refers to the deliverability settings - if bounce management is activated, the field value is updated to true.
The field you're looking for is HasOptedOutOfEmail on the Lead and Contact objects. You can update that field as normal provided you have the correct permissions.
It doesn't appear it is accessible anywhere:
Here is the Idea to make it accessible through a personalization string
Here is a similar question on the community where it also states this isn't accessible anywhere.
If you are looking to pass attributes for an email in UTM stings you could enable Parameter manage and use q of the 5 Additional Email Attrbiutes ...
There is a hidden field _CustomObjectKey which is used in AmpScript, this field may also be requested for DataExtensionObject:
Thanks to Jonas Lamberty for a hint!
So, I can't explain why but the following appeared to be the issue (and solution)
I was testing by exploiting the administrator Login As feature within our Staging sandbox
Said user had never logged into the Staging sandbox normally
Staging sandbox used single signon required for the Profile in question (I don't think this is relevant but complicated my ...