You can use variables in Flowsteps and subject lines. What you run into is that Flowsteps can only use global variables, while those in templates are local to the template. So you will have to make the variable you want to use global first or choose your flowsteps.
The easy version: Flowstep conditions
You can create two, three or more flowsteps that contain your subject line. Each flowstep also has a Conditions checkbox, where you can trigger the flowstep only under certain conditions. This is how you trigger the right flowstep for the right mail.
The more complicated version: Data templates
Create a variable Global by using a separate Json template. You create one by choosing JSON Data type instead of html when creating a new template. In that template you then put code like this:
${toJson(subjectlines)}
If you use the template in your flow, you can use ${subjectlines.passwordmail} from that point in your subject flowstep, for example. Of course, you can do an include in your JSON template, so you can use information from another template.