'POST /api/tool_shed_repositories/import_workflow
Import the specified exported workflow contained in the specified installed tool shed repository into Galaxy.
:param key: the API key of the Galaxy user with which the imported workflow will be associated.
:param id: the encoded id of the ToolShedRepository object
The following parameters are included in the payload.
:param index: the index location of the workflow tuple in the list of exported workflows stored in the metadata for the specified repository'

@expose_api
def import_workflow(self, trans, payload, **kwd):

    api_key = kwd.get('key', None)
    if (api_key is None):
        raise HTTPBadRequest(detail="Missing    required    parameter    'key'    whose    value    is    the    API    key    for    the    Galaxy    user    importing    the    specified    workflow.")
    tool_shed_repository_id = kwd.get('id', '')
    if (not tool_shed_repository_id):
        raise HTTPBadRequest(detail="Missing    required    parameter    'id'.")
    index = payload.get('index', None)
    if (index is None):
        raise HTTPBadRequest(detail="Missing    required    parameter    'index'.")
    repository = repository_util.get_tool_shed_repository_by_id(self.app, tool_shed_repository_id)
    exported_workflows = json.loads(self.exported_workflows(trans, tool_shed_repository_id))
    exported_workflow = exported_workflows[int(index)]
    workflow_name = exported_workflow['workflow_name']
    (workflow, status, error_message) = workflow_util.import_workflow(trans, repository, workflow_name)
    if (status == 'error'):
        log.debug(error_message)
        return {}
    return workflow.to_dict(view='element')
