I have a SPD designed SP 2013 workflow. it creates a task based on a custom content type fine. Now I'm creating a custom edit form template with custom buttons on it. My custom form works fine, the button click event is caught on the server side fine. Now I need to do something to the parent list item that the workflow starts from. This is where I can't figure out how to do anymore. I can get the workflow instance id in the field WF4InstanceId of the task item. However, that's as far I could go. It appears that none of the existing SharePoint workflow APIs can access the SP 2013 workflow instances anymore:
SPWeb.Workflows has 0 count though one instance of my 2013 workflow is running.
taskListItem.Tasks has 0 count too so I can't get a SPWorkflowTask instance.
I understand that SP 2013 workflow is completely different, but how can I go about getting a reference of the parent list item that started the workflow stance in the task edit form? It is such a common need but appears to be impossible or unknown through the workflow APIs?