What’s the best way to trace how a WF is being tri...
# suiteflow
j
What’s the best way to trace how a WF is being triggered? I have a WF that runs on copy/create of transaction. All this WF does for now is log a message showing the user and recordtype. I can see it’s happening on Sales Order but the user is blank. How can I tell where the WF is getting triggered?
m
I would turn on Workflow Logs and Instance History. Then you can review each record with a blank user and see if an error occured
Ususlly this happens when a scheduled script or system function is running to update/create the record
and the user would be -System- which a WF can't use to set a user field value
Or the user is not matching the entity type of the User field. (For example if you use Customer Center and the Customer is creating the sales order and your user field is an Employee field, it will show an error because it can't set a customer in that user field
j
problem is I have no idea what record is triggering it
and I tried doing search of wf instance history but it just times out even if I only search over like the past hour or so.
whatever’s triggering it is running 24/7
I wonder if it’s the spider scheduler or something
m
Do you want the record to only be created when updated via UI? If so you can change the context to only create your custom record when edited in the UI (or CSV too if needed). Then anything happening from background processes wont trigger the workflow
j
turns out something in our “web store” is triggering a “create sales order” wf. We have nothing in the web site that makes a sales order…. we don’t sell online like that.
no idea what’s happening.
m
Wow. Crazy
j
this is such a rabbit hole. All I’m trying to do is solve a problem with a DIFFERENT wf that should run on copy/create of a transaction. It was not running for dropshipped purchase orders, so NS support told me to change the trigger type to “All” from “Before Record Load” (because apparently the latter doesn’t run for dropship). I was a bit paranoid of doing this so made second WF to test when it would run, second WF just logs that it’s running, and it’s running like ALL THE FRICKING TIME WHEN NOBODY IS DOING ANYTHING.
So something is hitting “create” on sales order….somewhere.
n
@jen How about having the Workflow trigger type as All and then the logging State's trigger type as "after submit" (or whichever)?
j
I just want to know what’s making our system think a sales order is in create mode
n
and for your logging (which I think you might already have, just be logging to text fields for now).
j
every 10 seconds
all night
n
could people or bots be using website Add to Cart function?
j
we have no cart
no online sales
just informational site
n
For the workflow instance search try scheduling it as an email (which might still error I guess) or try Summarizing the search results by Grouping Date Created (Day) and counting the instances for now. If that works add some other columns to group and see if that shows something.