If your job disappears due to automation, there will likely be jobs available dealing with the automation, though fewer of them. You also may be able to side-step into some related job. 

Keep your eyes open and take advantage of 'related' training or opportunities that come available to you.