def get_steps_from_instance(workflow: object) -> Dict[str, Callable]:
    """
    Given a workflow instance, return the list of its methods that were defined as steps.

    Args:
        workflow (object): The workflow instance to inspect.

    Returns:
        Dict[str, Callable]: A dictionary mapping step names to their corresponding methods.

    """
    step_methods = {}
    all_methods = inspect.getmembers(workflow, predicate=inspect.ismethod)

    for name, method in all_methods:
        if hasattr(method, "__step_config"):
            step_methods[name] = method

    return step_methods

    Given a workflow instance, return the list of its methods that were defined as steps.

    Args:
        workflow (object): The workflow instance to inspect.

    Returns:
        Dict[str, Callable]: A dictionary mapping step names to their corresponding methods.

    
llama-index-core/llama_index/core/workflow/utils.py