Something I was working on today required me to figure out a way to determine the current workflow state for a Sitecore item. Note, this code is running within the context of the content editor (a custom field type, to be exact). Obviously, an item in the web database had better be in the "Published"...