Rules can timeout in a variety of scenarios. This article will explain common reasons why a rule times out, as well as provide multiple tools for troubleshooting and resolving this issue.
Here is an example of how a rule timeout might appear in the rule’s logs in the Rules Engine:
Typically, a rule times out because the amount of data being referenced is more than what the system can process. This can happen in multiple scenarios: the object the rule is based off of has a massive amount of data, resource utilization within your Gainsight instance is hitting its limit, or the rule’s query is not selective enough.
With these scenarios in mind, here a few actions you can take to help reduce the chances of a timeout when constructing a rule:
1. Use Filters Properly: Adding filters is a great way to make the query of the rule more selective, and to narrow down the amount of data the rule needs to access.
- The order of the filters within the rule’s configuration will determine the order of how they are applied in the data query.
- Any date filters should be added first. Narrowing down the date range, before the rule acts on other filters in the query, is the most organized way for it to pull information, and will reduce the chance of the rule timing out. Below is an example of how to correctly order filters to prevent timeout errors. Note that the date filter is placed first in the Setup Rule section
2. Split the rule if possible: If a single rule continues to timeout, sometimes multiple rules are the answer.
- The best way to accomplish this is to copy the rule with the exact same query, but then modify the filters so only a section of the data referenced is being handled by each rule.
- For example, you could have each rule only handle part of a date range referenced (remember to add this filter first); but you could also divide the rules by many of the other identifiers used within your original query.
- These rules could then be scheduled to run sequentially using the Rules Scheduler or using the Rules Chain feature.
3. Remove all unnecessary fields from the “Show” section of the rule: When configuring a rule, any field added to the “Show” section will be referenced when the rule performs its query. When attempting to resolve a timeout issue with a rule, you want to do everything possible to simplify this query. For this reason, you should only add fields to this section that are absolutely necessary for the rule to complete its function. All other fields should be removed.
4. Index all fields used by the rule filters: Indexing is the standard way to make sure the information within a database is organized properly and that the data can be accessed in a timely manner. You will likely need assistance from a Salesforce representative in order to complete this step.