It’s part of God’s unchanging nature to change his heart and intentions whenever people repent from their evil ways. The following is my translation of the text.
So he prayed unto Yahweh and said, “Oh Yahweh was not this my word when I was in my land? Therefore I fled before you unto Tarshish because I knew that you are a gracious God and compassionate, slow to anger and abounding with kindness and relenting from calamity. –Jonah 4:2
I was pleased to find this excerpt from Robert B. Chisholm Jr. in A Workbook for Intermediate Hebrew: Grammar, Exegesis, and Commentary on Jonah and Ruth (Grand Rapids, MI: Kregel Academic and Professional, 2006), 83.
The appearance of the participle in this list of divine characteristics suggests that God’s capacity to change his mind with respect to sending calamity … is typical of his nature, like the other attributes listed before this. In this regard see Jeremiah 18:7-8. God’s immutability (the doctrine that he is unchanging in his very essence or nature) logically demands that he be flexible in his relationships with humans. In other words, because he is immutably compassionate and predisposed to be merciful, he is willing to relent from sending calamity when human beings respond properly to his warnings. God makes plans and announces his intentions, but human response can and often does impact God’s decision as to what will actually take place.
I don’t see any reason for God not to change his mind, especially when we pray and repent. Unless one hold to a deterministic view of all things. Our prayers could alter God’s plan, yet according to his own will. The concept of “God’s changing his mind” allows God to enjoy a great amount of freedom to interacting freely and honestly with volitional agents. The passage in Jonah you mentioned is a fine example.