I have a site workflow which I intend to run every night on a schedule. The workflow queries a list and pulls data as per the filter. When it finds more than it loops through the rows and assigns a FLEXI task for every list item. In my test case I have two flexitasks (two list items) and after I respond to the first one I receive another task. After I respond to the second flexi task, the workflow fails.
Error: SWF workflow has ended unexpectedly.
I have no idea how to troubleshoot even though I have several log history actions to check values. Please help. Thanks in advance
maybe verbose logging may help you out at least a bit, if you did not already activate it. It is quite useful for the comparison of workflow variables before and after each Iteration and you do not have to print everything manually into the workflow history. See this link on how to activate it: Nintex Workflow - Verbose Logging - Vadim Tabakman
Additionally you could have a look at the ULS logs for SharePoint/Nintex. Just analyze the logs at the time your workflow fails.
I meant to say if the workflow is already running, we cannot make same workflow to run multiple times on same time.
But as Marian Hatala said it might be the case only with Lists & library workflows not with site level workflows.