I have a fairly complicated script written using the JSOM in Javascript that synchronizes two lists based on user behavior. At one point a user interacts with a SharePoint form that, on closing, triggers a workflow to initiate. After the workflow has been triggered, the script updates a series of fields and should go on its merry way.
However, this is not happening. Instead, whilst I am able to get the item the workflow is operating upon, the moment I call the query to update it, everything hangs until the workflow completes, at which point the JSOM finishes executing asynchronously and does its thing. This would be fine, except I need the changes to be there when the workflow looks for them - that's why it is pausing in the first place.
Does anyone have any ideas off hand as to how to prevent the workflow and script from getting in each other's way?