The Query Model stage requires that the input stage of your dataflow has defined the input fields that are accessed using data ("input"). Furthermore, any input fields or output fields accessed using the data command need to be defined in the Fields tab in the input and output stages. Otherwise, they will not appear as input and output fields in other stages in your dataflow.