When troubleshooting Sharepoint Workflows, one need that often comes out, is regarding how to get more details about a specific Workflow Instance on the Workflow Manager Databases.
This is due to the fact that this is usually the piece of information we get from the Sharepoint and most of the times people do not know how to use that piece of information to go deeper on the Workflow Manager side.
So, if we got an error message from the Sharepoint reporting some issue with a specific Workflow Instance, getting the details of that Workflow based on the Workflow Instance ID is not a trivial task, since the Sharepoint and the Workflow Manager are two independent products connected on the Database.
Anyway, the best option to do this is the following.
In the “WFMInstanceManagement” database, Instances table has the InstanceId column and the “WorkflowName” column.
SELECT * from [dbo].[Instances] WHERE InstanceId='<the instance id guid>’
In the “WFMResourceManagement” database, the WorkflowServices table maps WorkflowServiceId (a Guid) to Name.
This table also has the ActivityId, which is the id of the root activity.
The ActivityId can be used to query the Activities table in “WFMResourceManagement”, easy … right?
Hope that helps