Curved Single Stringer Stair - Rotate Beam to keep Top Face Up

I am trying to model a curved single stringer stair. For attachment of the treads, the top face of the HSS section need to always point up, which means that the HSS section will need to gradually rotate. I have been playing around with option in Dynamo but can’t figure it out. Please help.

Can you post what you have? Hard to know where to begin otherwise.