def find_failed_results(run_artifacts: dict) -> list:
    """find the index and ID for which elements failed in run

    Args:
        run_artifacts (dict): dbt api run artifact json response

    Returns:
        list: list of tuples with unique id, index
    """
    failed_steps = []

    for index, result in enumerate(run_artifacts["results"]):
        if result["status"] not in ["success", "pass"]:
            failed_steps.append((result["unique_id"], index))
    return failed_steps