Bot will run every Friday for each month with the dates as below
When Bot runs first and second Friday – pulls previous month from 16th to 29th or 30th or 31st depending on the month
When Bot runs third and fourth Friday – pulls current month from 1st to 15th
For December month when bot runs on fifth Friday - Pull the current month from 1st to 15th
First loop through dates and check which is the first friday of the month using dayofweek() function. Then use addsays to find all fridays…from there you have the logic that you need already
PFA the xaml with sample on how to do that. I have done the same logic what is mentioned above to get the first Friday and then add 7 days to it to get all Fridays. I did it using current month .you can replicate for all months
That is all logic with if you need to implement. Day after getting first friday say dates then dates.adddays(n*7) will give you each friday when n is 0,1 pull data from previous 16 to 31
When n is 3,4 or 5 pull from 1 to 15 of current month