Workflow Not Running, no errors in log?

Just trying to assign newly created leads (UI or contact form) to a specific user. Should be dead simple but it apparently doesn’t work.

Am I an idiot?

  • runs on save (no cron involved)
  • new records only
  • repeat enabled (although not sure why that would affect the onsave case)
  • no conditions
  • single modify-record, assign action

I’ve created a bunch of test leads since, no assignment happening.

Hey,

hmmm, Very odd, I’ve recreated your Workflow and it appears to work as expected:



If you check the “Process Audit” Subpanel on the Workflow record, it is empty?:


How are you currently creating these Leads, is it through the Lead Module’s “Create Lead” action?
Or Elsewhere?

Yep. Empty.

These test leads were created through the Lead Module’s create lead UI. Nothing weird.

Running .20 so should be latest. Have added some custom fields (Leads, Accounts, Contacts, Opportunities) but have not removed any fields. Have customized the various views (edit/detail/list/quick-create) to re-organize and streamline which fields are shown.
Have done some code-customization around the convert-lead screen but not to any modules…so nothing that should have broken something between Leads and Workflows.

It seems like this workflow isn’t even running (process audit empty) when creating a Lead. Shouldn’t be dependent on cron being setup for this case.

Not sure why this is broken.

Hey,

Thanks for the clarifications!

It doesn’t sound like any of those customisations would be enough to cause issues with Leads/Workflow…


Could you perhaps try the same workflow on another module, one that hasn’t had Customisations? (ie, Targets)
It would be worth ruling out if this is an issue with only Leads<->Workflow, or something else


Some other things that may be worth checking:

  • Do you perhaps have any other Workflows on Leads that could be conflicting with this?
  • Are you aware if you CRM has any custom Logic Hooks for Leads, that could be conflicting with this?
  • Are there any relevant Errors in the SuiteCRM error log, when you are creating new leads? (Anything related to Workflow/Leads?)

Yes you don’t need cron for this.
Do you see any errors in the Suitecrm.log file? (located at root)

Yes there is one other workflow also on leads. and on that one I see in the process audit that it has been running on these test leads I created. So why is this workflow preventing the second one from running?

Screenshots below.

Sorry I thought I mentioned that. No recent errors in the suitecrm.log.

Can you combine both into One WF and see if that helps in triggering.

1 Like

Check also php_errors.log, the one defined in your php.ini

Hey. So it turns out php-fpm doesn’t catch worker stderr by default. Updated the logging config and converted a lead.

# tail -f /var/log/php7.2-fpm.log
[26-Jul-2021 09:24:39] WARNING: [pool www] child 3102500 said into stderr: "NOTICE: PHP message: PHP Notice:  Undefined index: SweeterCalc in /opt/apps/suitecrm/modules/AOW_Actions/FormulaCalculator.php on line 108"
[26-Jul-2021 09:24:39] WARNING: [pool www] child 3102500 said into stderr: "NOTICE: PHP message: PHP Notice:  Undefined property: Lead::$date_entered in /opt/apps/suitecrm/modules/AOW_WorkFlow/AOW_WorkFlow.php on line 644"
[26-Jul-2021 09:24:39] WARNING: [pool www] child 3102500 said into stderr: "NOTICE: PHP message: PHP Notice:  Undefined property: Lead::$date_entered in /opt/apps/suitecrm/modules/AOW_WorkFlow/AOW_WorkFlow.php on line 645"

So the first workflow (assigning due-date) is erroring and apparently the error isn’t being caught/handled so there is no indication in the UI that that workflow is failing. I guess that workflow failing prevents other workflows from running.

Indeed, deleting the broken workflow causes my assignment workflow to start working.
Pretty annoying though that workflows can error and those errors are not caught and reported to the UI.
Also, unless the workflows are designed to be dependent on each other (e.g. don’t run B until A runs), which they don’t appear to be as there is no way to add a dependency in a workflow on another workflow (“run: after another workflow finishes”)… one workflow failing shouldn’t prevent others from running right?

Agreed, the error handling and reporting in Workflows needs some improvement…

PHP Notices are very common and don’t normally cause processes to fail, so I woulnd’t take it for granted that those are the actual problems breaking your workflow. But they are good clued to go and check the code, though.

Yeah well I knew that set-due-date workflow wasn’t working right anyway (1, 2)…so I just deleted it and that definitely resolved the issue.

I didn’t check the code but pretty clear correlation to deleting the workflow that was erroring and the other starts to run (process audit said it wasn’t running at all before).

I understand v8 is a big re-write? So I am hoping the re-architecture will result in a cleaner and less buggy code base. Pretty shocked at some of the stuff I’ve seen (massive/deep if/else chains and tons of special cases hard-coded into the code base)…not saying that is SuiteCRM’s fault…likely legacy Sugar stuff. So crossing my fingers that v8 will be a big improvement.

v8 has waaay better quality code in the new parts, but don’t overestimate the scope of that upgrade. There’s no big corporate team working on this. It’s basically a UI change, and it sets up the proper foundations for the future architecture.

But 97% of code stays the same, and yes, it’s quite ugly at some points. Not all, luckily.