Finish node for all subjects

How can I tell nipype to finish a node for all subjects before moving on to the next node of the workflow?
For example with the workflow below, how can I force nipype to run the gunzip node for all three subjects, before running flirt?

subjects = ['001','002', '003']

infosource = Node(IdentityInterface(fields=['sub']), name="infosource")
infosource.iterables = [('sub', subjects)]

wf = Workflow(name="wf", base_dir='\data\')

templates = {'func': os.path.join('{sub}', 'func.nii.gz')}
select_files = Node(SelectFiles(templates), name='select_files')
gunzip = Node(Gunzip(), name='gunzip')

                (infosource, select_files, [('sub', 'sub')]),
                (select_files, gunzip, [('func', 'infile'))],
                ######run gunzip node for all subjects before continuing#######

                (gunzip, flirt, [('out_file','in_file')]),

Ahoi hoi @mri,

I’m not sure, but I think, one option could be to define a function node that takes
all unzipped .nii as input (waiting till all are there) and then passes them to flirt.
With that it would act as a dummy function/node that triggers flirt only after all subjects’ data were unzipped.
Your question goes into the direction of what was asked here, with nipype being a “dataflow framework”.

HTH, cheers, Peer

Thank you Peer, I’ll try that.