By default Temporal activities have an automatic retry. However, to answer your question, yes, Activity B will only run once Activity A has been retried and failed 5 times.
You will get a generic error whether it its a Javascript or Typescript error in regards to Activity A. Although Activity B will still execute.
Let’s say activityB also takes in the error as a parameter. If activityA fails for different reasons those during those 5 retries, I assume activityB will only be run once, with the error message/reason from the 5th retry of activityA, correct?
Yes, Activity B will be executed after all retries of Activity A have been exhausted. The error from the last retry for Activity A will be passed on to Activity B.
How many times activity B is run depends on the retry policy set in proxyActivities. Also, for it to receive the error, you need to pass it as an arg, like activityB(params, err)
Note that this will not be serialized properly using the default data converter, you should probably extract the relevant error information into a JSON serializable object and pass that along.