WorkflowTriggerTaskStatus stuck in Pending
Hello,
For quite some time now, I have used a technique to get around the SuiteScript limitation that a User Event cannot trigger another User Event, but utilizing the N/task module and Workflow Action Scripts. I submit a Workflow Trigger task for a certain record, and have logic in the Workflow Action script to either Load/Save the record OR if it makes sense, I just add the any user event logic into the Workflow Action script.
My big issue I just ran into for the first time is that my WorkflowTriggerTasks are successfully submitted, but the WorkflowTriggerTaskStatus is stuck in Pending. I just checked on Task ID that was submitted 2 days ago, and still the task status is Pending.
- Is there a way in the UI to view all “Pending” Workflow Tasks? Or do I just have to check the status in the Debugger?
- What causes the Workflow to go to a status of “Pending”? Is there some time of metric like Governance or Concurrency that would let me know how many Workflow Tasks I can submit in a given amount of time? Is this like the old Scheduled Script queues?
The logic in the workflow action script is pretty business critical, so if I cannot get this resolved, I may re-architect it to run in an MR script, every 15 minutes. obviously, not ideal for processes that need to be near-real time.
NetSuite Debugger code:
require(['N/task'], function (task) { var taskId = 'WFTRIGGER_0568697b176b1604071704690b76725250010104771466681245_99xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; var myTaskStatus = task.checkStatus({ taskId: taskId }); var x = 0; })