Is there any sample to create workflow using api, as I am trying to make dynamic workflow where user

Is there any sample to create workflow using api, as I am trying to make dynamic workflow where user can select how workflow will processed so does anyone have code sample or CURL or anything which can help me out?
Was this page helpful?