def state_minus_3_days
      return state unless state['sessions']
      state.merge(
        'sessions' => DateTime.parse(state['sessions']).prev_day(3).iso8601
      )
    end
def state_minus_3_days
      return state unless state['sessions']
      state.merge(
        'sessions' => DateTime.parse(state['sessions']).prev_day(3).iso8601
      )
    end
Per Rep, include a "buffer" when we kick off our process
 In other words, end_time != session modification time. As a result, just
 maintaining a high watermark has the potential to miss certain sessions,
 and the probability of missing sessions increases if there's a big gap
 between the time of last message in the session and the time it is closed
 out by an agent (like, on weekends).

 For example, if you most recently queried all sessions up until time T1,
 then set start_time to T1 - 3 days on the next run (and dedupe sessions
 based on encrypted_id, which is guaranteed to be unique). This should
 account for sessions that happened over the weekend, etc.