from typing import List
from typing import Dict
from typing import Any


def filter_maxlen(items: List[Dict[str, Any]], maxlen: int) -> List[Dict[str, Any]]:
    """Returns only payloads not longer than maxlen."""
    if maxlen <= 0:
        return items

    filtered = []
    for item in items:
        if len(item["payload"]) <= maxlen:
            filtered.append(item)
    return filtered