Polypeptides can self-assemble into hierarchically organized fibrils consisting of a stack of individually folded polypeptides driven together by hydrophobic interaction. Using a coarse-grained model, we systematically studied this self-assembly as a function of temperature and hydrophobicity of the residues on the outside of the building block. We find the self-assembly can occur via two different pathways - a random aggregation-folding route and a templated-folding process - thus indicating a strong coupling between folding and assembly. The simulation results can explain experimental evidence that assembly through stacking of folded building blocks is rarely observed, at the experimental concentrations. The model thus provides a generic picture of hierarchical fibril formation. © 2013 American Physical Society.