How to get workflow state transition history for a node? In the admin section, for any given node, I need to add a dropdown field that lets QA assign that node to a developer who had previously made changes to the node's workflow state. I am currently using the workflow module (https://www.drupal.org/project/workflow). This field needs to be populated with users who have changed the node's workflow state before. So, I'm working on a module that can do this. My question is, how do you programmatically get the workflow state transition history for a given element? 

For every revision of a given node that has involved a workflow change, I would need the following information: 


The state or state id (sid) that it was changed to.
The uid of the user that made the change.
The order in which the workflow state transitions were made.


I tried node_revision_list, but it does not include revisions that only change the workflow state. (Because it's not looking at the workflow_node_history table).

I can get the information I need directly from the database by running the following query, but I don't want to do any database-hacking if this functionality is already in Drupal somewhere.

SELECT sid, uid  FROM `workflow_node_history` WHERE `nid` = ? ORDER BY stamp asc


Is there a Drupal function that already does this?
The Workflow module has a lot of API calls that you can use to get the relevant information you need.

Here are all the workflow functions you can access

It seems like you might be looking specifically for the workflow_get_workflow_node_history_by_nid function

Here you supply a node ID and it will return the history results as an object where you can find the information you need.  It even joins it with the users table so you have all the relevant user information.