B737-800
Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Multiengine
Flight Crew Last 90 Days 100; Flight Crew Type 2500
Workload
Conflict Airborne Conflict; Deviation - Altitude Excursion From Assigned Altitude; Deviation - Speed All Types; Deviation - Track / Heading All Types; Inflight Event / Encounter Loss Of Aircraft Control; Inflight Event / Encounter Weather / Turbulence
Air Traffic Control Issued New Clearance; Flight Crew Diverted; Flight Crew Requested ATC Assistance / Clarification
Weather
There was a line of storms crossing ZZZ.  We were told to expect holding at ZZZZZ.  We ended up holding.  We did one turn and then we got sent back on the arrival.  We ultimately got vectors from ZZZZZ1 and were following one Company aircraft.  The plan was to fly northeast about 30 miles at 5;000 ft to go around the weather and then come back south to land.  We couldn't get in front of it or through it.  Company turned around to try to get around the weather from the other direction.  We did the same thing.  We got a 270 heading and a descent to 4;000 ft and an assigned speed of 170 knots.  On that vector; I noticed airspeed decreasing and added some power.  Then the airspeed dropped to approximately 140 knots and the autopilot and autothrottles were disconnected.  I announced to the PM (Pilot Monitoring) that we were in windshear and I added power and started a climbing turn to the left.  The aircraft started accelerating and climbing; and we retracted the flaps.  The highest speed I saw during the recovery was 220 knots.  During this period; airspeed; pitch attitude and altitude was very difficult to control and we encountered what we believed to be severe turbulence.  The PM told ATC that we had severe turbulence and windshear and that we were turning to the left and climbing.  We tried to level at 5;000 ft and flew southwest.  ATC told us to climb to 6;000 ft for traffic.  I added power and the aircraft responded poorly.  Eventually; we got a climb going; but we were unable to stop the climb at 6;000 ft.  The aircraft continued to about 6;450 ft and ATC asked us what altitude we were going to.  PM told them that we were trying to get to 6;000 ft but were having a difficult time maintaining altitude with the turbulence.  On our way back down to 6;000 ft we got a TCAS TA for traffic at our 1-2 o'clock at 700-800 ft above us.  I continued down to about 5;800 ft to make sure we avoided that traffic.  We continued southwest and diverted to ZZZ1. If we had asked to stay in holding until we saw that the line had passed even further northeast of the field; it would have prevented this.  We had about 13.0 of fuel when we entered holding; so we had the time. [We were] unable to maintain assigned altitude; heading; and airspeed due to windshear and severe turbulence.
Air carrier First Officer reported the flight encountered wind shear and severe turbulence associated with a line of storms resulting in altitude/airspeed excursions; a conflict and a divert.