You need to set up your project and environment go be able to handle Workflows events
You can have your plugin to listen to workflow events using Confluence's Event Listeners.
Fired when the state of page or blog post is changed
Fired when the state of a page of blog post has expired
Fired when the approval is assigned
|Fired when the approval is unassigned|
Fired when the page or blog post is approved
Fired when the page or blog post is rejected
Fired when a task is created
|Fired when a task is updated|
Fired when a task is completed
Fired when a task is closed (usually when the state changed and there are still open tasks)
Fired when a task is assigned
|Fired when a task due date is expired|
Check Workflows API's com.comalatech.workflow.event package and subpackages for more event types.
Workflow events are handled the same way as Confluence events