The law of karma is inevitable. But there are many ways by which we can escape from the chain of the law of causation and Karma Yoga is one of those ways.
Those who have succeeded in attaching or detaching their minds at will have succeeded in Pratyahara, which means gathering towards, checking the outgoing powers of the mind, freeing it from the thralldom of the senses. When we can do this, we shall really possess character; then alone we shall have taken a long step towards freedom. Before that, we are mere machines.
-Swami Vivekananda