|The advent of automation and the simultaneous decline in the labor share and employment among advanced economies raise concerns that labor will be marginalized and made redundant by new technologies. We examine this proposition using a task-based framework in which tasks previously performed by labor can be automated and more complex versions of existing tasks, in which labor has a comparative advantage, can be created. We characterize the equilibrium in this model and establish how the available technologies and the choices of firms between producing with capital or labor determine factor prices and the allocation of factors to tasks. In a static version of our model where capital is fixed and technology is exogenous, automation reduces employment and the share of labor in national income and may even reduce wages, while the creation of more complex tasks has the opposite effects. Our full model endogenizes capital accumulation and the direction of research towards automation and the creation of new complex tasks. Under reasonable conditions, there exists a stable balanced growth path in which the two types of innovations go hand-in-hand. An increase in automation reduces the cost of producing using labor, and thus discourages further automation and encourages the faster creation of new complex tasks. The endogenous response of technology restores the labor share and employment back to their initial level. Although the economy contains powerful self correcting forces, the equilibrium generates too much automation. Finally, we extend the model to include workers of different skills. We find that inequality increases during transitions, but the self-correcting forces in our model also limit the increase in inequality over the long-run.