Compare pdfs across different activities/sequences

I have to read a folder of pdfs then compare certain extracted terms to another set of pdfs. How do I ensure that when it runs through each of these that the pdfs from one sequence are going to be compared to the right ones in the second sequence?

What means “right one”?

@J0ska it would mean same order number or same customer name or ID

Not sure I fully understand you business case.
But very likely I would split the process into two steps:
1/ Process first set of PDFs and store result into SQL working table
2/ Process second set of PDFs and compare/lookup in SQL working table

Alternatively use in memory datatable instead of SQL.