Make sure you look at the getting started page
The Ad hoc Workflows API enables other confluence plugins to interact with Ad hoc Workflows to enquire about and manipulate states, task and approvals information and to get notification of workflows events.
Ready to go? Have a look at the Getting Started page.
All the workflow information is associated to Pages and Blog posts. The higher level entity is a State, which can be assigned, and contains Tasks, Approvals and Rejections.
The Workflow Utilities Plugin is an Open Source plugin which you can use as an example on how to integrate your plugin.