It is the subject.
Previous Question
Which sentence has a gerund phrase as an object of a preposition?
Next Question
In "They were busy planning the trip," 'planning the trip' is: