I wrote a workflow to query a SQL database, then do a search repository using the database fields. If the search finds documents, it goes down one path (found) and if it doesn't find anything, it goes down another path (not found). This is based on the search repository result count token.
The issue that I'm having is that sometimes, the workflow isn't finding any files even when it should. If you manually search in Laserfiche (using the same search syntax but putting in the variable values and using a template search manually), you can find results, but the result count in workflow shows as 0. If I go back and run the workflow on one specific line that it said not found for when it should be found, it works as expected and goes down the found path. I also tried adding a second search once it said not found the first time, but that didn't help. And I tried a delay after each row to see if it was just trying to run to quickly, but that also did not work.
I'm not sure what to do at this point to get it to work. Any ideas/suggestions would be appreciated.