workflow to write nxs file