'GET /api/workflows/{encoded_workflow_id}
Displays information needed to run a workflow from the command line.'

@expose_api
def show(self, trans, id, **kwd):

    stored_workflow = self.__get_stored_workflow(trans, id)
    if ((stored_workflow.importable is False) and (stored_workflow.user != trans.user) and (not trans.user_is_admin())):
        if (trans.sa_session.query(trans.app.model.StoredWorkflowUserShareAssociation).filter_by(user=trans.user, stored_workflow=stored_workflow).count() == 0):
            message = 'Workflow    is    neither    importable,    nor    owned    by    or    shared    with    current    user'
            raise exceptions.ItemAccessibilityException(message)
    if kwd.get('legacy', False):
        style = 'legacy'
    else:
        style = 'instance'
    return self.workflow_contents_manager.workflow_to_dict(trans, stored_workflow, style=style)
