I don't have any idea how to create workflow programmatically, someone please suggest
I assume you are mentioning how to create a simple workflow process step ? I hope this might help you https://experienceleague.adobe.com/docs/experience-manager-learn/forms/adaptive-forms/custom-process...
Hope this helps
Here is a link from ArgilDX which gives the complete idea about creating a workflow in AEM programatically.
Please have a look:
Also you can refer the documentation from Adobe as well:
Hope this helps!