How to create new workflow instance from X++

We have a piece requirement that asks for a new workflow instance being created from X++ programming. For instance, we add a new ribbon button that can create a new sales order workflow instance for the selected sales order. Anyone knows a good piece of example code?

Hi Kranthi, thank you for the reply, actually, I was led to a place somewhat not accurate. I know with the code piece submitting to workflow. But initially the requirement was talking about something else, I found another way to address it. No further help is needed. Thanks!