Before the world was created, the Holy One, blessed be He, with His Name alone existed, and the thought arose in Him to create the world. He began to trace (the foundations of) the world before Himself, but it would not stand. They told a parable, To what is the matter like? To a king who wishes to build a palace for himself. If he had not traced in the earth its foundations, its exits and its entrances, he does not begin to build. Likewise the Holy One, blessed be He, was tracing (the plans of) the world before Himself, but it did not remain standing until He created repentance.
Before Creation There Was Only God and His Name
Pirkei DeRabbi Eliezer 3:2