You are on the right track, you need to use an async workitemhandler in order to represent that behavior. Basically a Async WorkItemHandler will not automatically complete the WorkItem as soon as the executeWorkItem() method finish. When the external notification comes in you will need to use the workItem.getId() in order to complete it using the ksession.getWorkItemManager().complete(id, params) method.
Notice that you will need to keep somewhere in your application the work Item id that is pending to be completed, that depends on your situation and how you are storing data.
Hope it helps! Cheers