def METHOD_NAME(client, output):
    stream = _orient_stream(client, _flow_dumps_query)
    stream = _group_stream_entries(
        stream, operator.attrgetter('task_id'))
    for entry in stream:
        count = len(entry.batch)
        output.record_processed_dumps(count)
        if not _check_flow_event_existence(client, entry.ref):
            output.record_orphaned_dump(count)
            yield entry.ref
        output.flush()