Esp32 or stm32f1 handle 8 serial connection

Can stm32f103 or esp32 handle 8 serial connection? I need 1 microcontroller to handle 8 serial whatever it done by hardwareserial or software, because the trafic data not continuously. Need you advice

Not if you need to use them concurently. You have the available hardware ports - bearing in mind you will likely need one for progamming - plus SoftwareSerial. In SoftwareSerial you can configure multiple serial ports, but, you can use only one port at a time.

the most I have used is 6 serial ports on a Microchip PIC24FJ1024GB610
you could try a Raspberry Pi using multiple USB-TTL or USB-RS232 serial modules, e.g. FTDI usb-ttl-serial-cable-series
each USB serial module creates a virtual serial port. e.g. dev/ttyUSB0, dev/ttyUSB1, etc
you can program the RPi to access the serial ports using C++, Python, Java, etc

I don't know any arduino compatible board that supported 8 hardware UARTS
The maximum that I remember is W806/Air103 WinnerMicro boards, that has a 6 UARTs