from typing import Dict


def parse_varnames(action: Dict) -> Dict:
    """Parse mapping of function or notebook argument names to the names of
    variables (e.g., parameters) in the workflow context.

    Parameters
    ----------
    action: dict
        Workflow step serialization.

    Returns
    -------
    dict
    """
    return {doc['arg']: doc['var'] for doc in action.get('variables', [])}