The flow of information from sensory stimuli to motor responses in the human brain can be flexibly re-routed depending on task demands. However, it has remained unclear which sequence of processes is involved in preparing the brain for an upcoming task. Here, we used a combination of fMRI and multivariate pattern classification to decompose the information flow in a task-switching experiment. Specifically, we present a time-resolved decoding approach that allowed us to track the temporal buildup of task-related information. This approach also allowed us to distinguish encoding of the task from encoding of target stimuli and motor responses, thus separating between different components of information processing. We were able to decode from parietal and lateral prefrontal cortex which specific task-set a subject was currently holding. Importantly, this revealed that the intraparietal sulcus encoded task-set information before prefrontal cortex, and it was the only region to encode the specific task-set before the relevant target stimulus was presented. This suggests that task-related information in parietal cortex does not rely on input from prefrontal cortex as previously suggested. In contrast, our findings suggest that parietal cortex might play a role in establishing task-sets in prefrontal cortex.