The definition of a category is usually attributed to Mac Lane and Eilenberg (1945). What seems to be less known is that the german mathematician Heinrich Brandt has developed the notion of a groupoid already in 1926 (motivated by questions on quadratic forms). The paper "Über eine Verallgemeinerung des Gruppenbegriffes" introduces, names and studies (connected) groupoids explicitly. The object-free definition is used, so that groupoids look very much like groups except that the product is only defined partially.
Well, first of all I have to say that it is quite amazing that the definition of a category is basically already there in Brandt's paper. Just erase the inverse elements from Axiom III. The paper doesn't really mention the arrow picture stressed by Mac Lane and Eilenberg, although the notions "einander rechts" (sharing the same codomain) and "einander links" (sharing the same domain) are introduced for groupoid elements aka morphisms.
See here for a list of further early publications on groupoids.
Nowadays, groupoids are usually seen as special categories. (Curiously, in homotopy type theory, categories are seen as special $\infty$-groupoids.) But the definition of a groupoid has appeared 20 years before the definition of a category. This leads to many (related) questions:
- Why did it take 20 years?
- Does the study of groupoids have influenced the development of the notion of a category?
- Did Mac Lane and Eilenberg know the work on groupoids?
- Is Brandt's work rather unknown? (Why?) Or have you heard of it before?