Rules Engine: Introduce a "forced fail" function

Related products: None

Just because a rule completes successfully doesn’t mean it produced successful results.

For example, I have a rule that imports data from S3 and what we do with the data is dependent on the date value in a specific field.  I can include a filter on the action that says “Do X if ReportTime >= Subtract 2 days from Rule Date”

But if for some reason the ReportTime field comes through inaccurately, the actions (correctly) are not executed and the rule is flagged a success...but technically the execution of the rule is a failure because it didn’t perform the needed actions due to the erroneous imported data.

It would be pretty slick if there was a “forced fail” function where I could say “If ReportTime < Subtract 2 days from Rule Date” forcibly fail the rule.

That is just one use case - I could see this being used widely, especially to get ahead of potential data issues before the rules run. 

Can I modify my request from this post: 

to include conditional statements in Rule Logic as well, with this as a use case?


Hi @darkknight I want to make sure I understand the request fully. Are you using the S3 import rule in bionic rules? https://support.gainsight.com/SFDC_Edition/Rules_Engine/Admin_Guides/S3_Dataset_Task_in_Bionic_Rules

 

If so, it sounds like you’re looking for some mid point logic check that would be performed after the Setup Rule step and before the Setup Action step. Is that correct? Is the goal then to use the Rule Failure email notification to alert you of a problem in your source data?


@dan_ahrens in this particular use case, yes using the S3 Import rule.  Essentially you have the ask correctly.  Basically a way to configure rules so that not only will they not perform an action based on faulty data (which we can already do with filters) but also fail the rule so that we can be alerted when the actions weren’t performed because of the faulty data.

You may be thinking “why don’t you just build a Journey Program to email you when there is a data issue” but

A) many of our rules run at night so an email would be after the fact and the rule would have already run

B) sometimes the data issue could occur within the rule, due to a calculation that is happening mid-rule

C) it seems like double work to create JPs when it would be simpler for admins if we had a force fail option within the rule itself

Like I said above this is just one use case - there could likely be other applications for such an action.  Others may have additional ideas.

 


Thanks for clarifying. I did think of a JO at first, but a more elegant and real time solution would be to use the call external API action in that same rule to trigger a slack message (to a person or a channel) when this type of condition occurs. 

 

And if you had filters on the Setup Action steps, then if there was faulty data, then no actions would be taken. 

 

 

So the workflow would be somethinglike this:

  • S3 import task brings in the data
  • Setup actions only process if the filter criteria set by the admin is met
  • External slack message indicating an error is only sent if the filter criteria set by the admin is not met

@dan_ahrens  hmmm… I’ll admit I’m not up on the Call External API action.  I’ll dig into this and see if that will meet the need.   Thanks Dan!

 

 


It’s pretty powerful - you can basically interact with ANY other software tool that has API support directly from Rules Engine. 

 

Here’s the tutorial on how to send a slack message using that external API trigger from rules engine: https://support.gainsight.com/Gainsight_NXT/03Rules_Engine/03Tutorials/Post_Messages_to_Slack_with_Call_External_API_Action_Type


@dan_ahrens thanks. The one additional thing I can think of where the force fail would be helpful is in the event you have rule dependencies.  If we could force a rule to fail under a specific condition, we could prevent the child rules from running as well.  I still think it’s worth considering.