code: def get_workflows():
      
      wftool = api.get_tool("portal_workflow")
      wfs = {}
      for wfid in wftool.objectIds():
          wf = wftool.getWorkflowById(wfid)
          if hasattr(aq_base(wf), "updateRoleMappingsFor"):
              wfs[wfid] = wf
      return wfs
docs: Returns a mapping of id->workflow