AnsweredAssumed Answered

Query Did Not Work in Workflow

Question asked by andreapasutti on Jan 3, 2017
Latest reply on Mar 27, 2017 by andreapasutti

I have a workflow that worked just fine until...


Workflow 1: Task goes to manager, manager checks which business lines need to approve the request, workflow queries the fields on the workflow task to get the business lines, then uses those results to query the Roles list to find the individuals for each business line, then routes the request to those individuals.


Change: Added 2 workflows to the workflow task list. The first one (Workflow 2) runs when a task is created, it secures the task so only the site owners and Assigned To can edit it. It also runs if the Assigned To changes. The second one (Workflow 3) runs when the status is Complete and sets the task to read-only. These need to be in place because the Assign To-Do task can be edited after it has been completed. We do not want to change out the task type in this workflow.


What happened: When the workflow queried the fields on the workflow task, it did not return a result and skipped the business line approval. When I manually entered the parameters in the query, it returned the correct result. The workflow also worked just fine before I made the Change.


So why didn't my query work during the workflow? I've isolated it to the specific query that gets the business lines that the manager checked when he completed the task. I think what happened is that Workflow 1 proceeded and tried to query the fields when Workflow 3 was attempting to secure the task and make it read-only.


Note: Querying a read-only task works because I was able to get the result when I manually entered the parameters.


I was not able to duplicate this issue in the Test environment. However, our Test environment is considerably slower and it's possible that Workflow 1 had enough time to query the task before Workflow 3 could run.


I have removed any new instances of Workflows 2 and 3 in Prod, but we do need to secure the tasks, so I will need to add them back in.


Anyone ever encountered this before?