@KPadhiyar - building on the reponse from @Josh , there is an automation API that support progreammtic creation/update to any workflow.
As far as I have been able to determine, these APIs can display the details of custom code actions in any query for a given workflow, but cannot suppprt the creation/update of code sections in that workflow step.
Bottom line, this maybe needs a HubSpot update to round out the implementation.
Steve