If you have steps that require retaining your sort steps, you can revert to the original sort order by adding this transform step:
NOTE: Source row information may be lost after operations such as joins, unions, and aggregations are performed. In these cases, you cannot sort by the source row information. You may be able to generate a column of source row number earlier in your recipe.
Then, you can create the header with the following simple step:
If you need to retain the sort order and not revert to the original, you can do the following to the previous example data: