Rule Triggers
Updated
Rule Triggers are initiated to prompt content in the platform to run through the Rule Engine according to the configuration of that rule trigger. Rules that do not have a rule trigger will execute on content according to the rule type. Rule Triggers can be especially useful when you would like a rule to apply to messages outside of the typical rule set-up.
For instance, if you would like a queue rule to execute on a large number of older messages, you can use a rule trigger to initiate the rule. Without the trigger, the queue rule would execute on messages only when they enter a given queue.
Like rules, triggers have their own conditions that apply to when they will execute on messages. Below, we'll take a look at the configurations that you can use in Rule Triggers.
To Create a Rule Trigger
Click the New Tab icon . Under the Sprinklr Social tab, click Manage Rule within Triage.
Locate a rule to which you would like to apply a trigger, hover over the Options icon next to the rule name and select Edit.
To set a Rule trigger, select the Options icon in the top right corner of the Rule window and select Manage Triggers.
On the Manage Triggers pane, click Create New to create a rule trigger. For more information, see Rule Trigger — Field Descriptions.A trigger is set on a rule to determine conditions under which the rule should be enabled.
You can also set Trigger Type to determine if your trigger is Restricted and will run at a set frequency but will only check that an entity meets the conditions of the rule once, Unrestricted, which will continue to pick up messages until the trigger is satisfied, or Restricted Definite Time, which will run one time on all applicable messages beginning at the trigger start date.
Set the date range and, if creating a restricted trigger, the frequency of your trigger. Be sure to select Enable if you wish to put your trigger into effect, and click Add Trigger in the bottom right corner.
Rule Trigger — Field Descriptions
Field | Description | ||
Name | Enter a unique name for the Trigger. | ||
Description | Enter a brief description about the Trigger. | ||
Type of Triggers | |||
Type of Triggers | Select one of the trigger type to delete the behavior of trigger. For more information, see Trigger Types.
| ||
Trigger Conditions: Entities to be run through this rule will be picked based on these conditions. | |||
Select all Messages Modified in last | Messages will only be considered for the Rule if those messages were modified within the Message Modified Time Duration range selected and will subject to the Rule frequency. For example, if a Rule Trigger's frequency is set for every 7 days, with a Message Modified Time Duration of 2 days, the associated Rule will only affect messages posted within the 2 days prior to the Rule triggering every week. | ||
Account | The account of the selected social media channel. | ||
Assign By | Assign a case with the available conditions. | ||
Assignment Order | By default, it considers the ascending order, which means that it will consider from the older messages to the newer messages. Descending - It considers from the newer message to the older message. | ||
Assignment Present | Whether the message has been assigned to anyone. | ||
Brand has responded to message from Sprinklr | Whether the message is posted after the account is added in Sprinklr. | ||
Channel | The social media channel. | ||
HashTag | Refers to the words or phrases that come after the “#” symbol that is included in the messages. For example, #ilovesprinklr.
| ||
Is Message Archived | Whether the message is archived or not. | ||
Message Type | Refers to the engagement type in a social media channel. For example, Facebook comment, Twitter Re-tweet, Twitter Sent Direct Message. | ||
Message creation time is after | Select the Time and Date to run the trigger after the mentioned time. | ||
Message creation time is before | Select the Time and Date to run the trigger before the mentioned time. | ||
Message has conversation | Whether the post has comments and threads associated to it. | ||
Persistent Searches | Select the persistent search from the drop-down list. | ||
Post Type | Whether the message is posted by the Brand account, the Fan account, or the Advocate account. | ||
Priority | Select priority from the low, high, lowest, highest, medium. | ||
Sentiment | Select neutral, positive or negative sentiment. | ||
Source Type | Select Source Type. | ||
Spam | Whether the message is spam. | ||
Status | Select the status of the message from the drop-down list. | ||
Duration: Select time duration of trigger during which it will execute the rule. | |||
Start Date | Select the start date to activate the Trigger. The start date must be less than the end date. | ||
End Date | Select an end date to stop the Trigger. The end date must be greater than the start date. | ||
Frequency: Select frequency at which this trigger will run during the specified time duration. | |||
Run this trigger at an interval of every | Set the time interval to make Trigger run on a message. For example, if you want the trigger to run frequently in a short interval of time, select Seconds and then select 5 Seconds. | ||
Enable Trigger Checkbox | Select to make the Trigger active.
|
Trigger Types
The Rule Engine offers several Trigger Types which can help you select the right execution for Rules that you create. Below, we'll explore the different types of Rule Triggers and how they operate on Rules:
One-Time Trigger for Retrospective and Ongoing Use
One-time Triggers for retrospective and ongoing use will run on the Rule's entity (the message, profile, asset, etc. that the Rule applies to) one time according to the Trigger's frequency. When the Rule Trigger is executed on an entity according to its set frequency and that entity doesn't meet the Trigger conditions, the Rule Trigger will not be executed on that entity again.
Time Agnostic Triggers
Time Agnostic Triggers will run on the Rule's entity (the message, profile, asset, etc. that the Rule applies to) an unlimited number of times according to the Trigger's frequency. When the Rule Trigger is executed on an entity according to its set frequency and that entity doesn't meet the Trigger conditions, the Rule Trigger will be executed on that entity indefinitely according to its set frequency.
One-Time Triggers for Retrospective Use Only
One-time Triggers for retrospective use only will run only once on all applicable messages, not at any set frequency.
When to choose what type of trigger
One-Time Trigger for Retrospective and Ongoing Use
As mentioned above, this trigger will pick the message only once on the message irrespective of whether the action has taken place or not. This would be used on workflow which is of a straight forward and on going use cases that that doesn’t involve loops or retrotagging very old messages.
Example: If you want to add all messages to a queue where sentiment is positive, the rule setup would look like the following screenshot.
The trigger will pick all the message from the source queue configured and it will check if sentiment is positive. If it is so, then it will add to the queue given in the action.
Note: In this trigger it is not a mandate to remove from the source queue. Irrespective of the action is executed or not the message can stay in the source queue.
For the above use case, you can also use time agnostic trigger but you have to remove from the source queue if using time agnostic trigger. If your workflow demands not removing from the source queue, then you have to use "One-Time Trigger for Retrospective and Ongoing Use”. Else, you can also use "Time agnostic trigger” to achieve above use case.
Time Agnostic Trigger
As mentioned above, this trigger will pick the entity and keeps on executing unless it doesn’t meet the trigger conditions. Most likely, this would be used on workflow that does involve a loop.
Example: Consider the use case is to assign cases to the available agent. The rule setup might look like the following.
Supposedly, if a case came in at 8PM and there is no agent available at that time, the trigger will keep on executing the case until it has been removed from the source queue(used as trigger condition). If no agent comes online for 1hr then the rule will keep on executing the cases till then. If the agent comes online at 9:05PM, the rule will assign the case to the agent and remove the case from the source queue.
This is an example of loop mode which you cant able to achieve with the help of One-Time Trigger for Retrospective and Ongoing Use. The One-Time Trigger for Retrospective and Ongoing Use trigger will pick the case only once. If no agents available then the condition fails and cases will never get assigned to agent because will not get picked again.
Note: In time agnostic trigger, it is mandatory that you have to remove the entity from the source queue after the action is executed. If you do not remove it, then you will not be able to enable the trigger. The trigger will throw an error while enabling(screenshot attached below). The reason is that if you don’t remove from the source queue, the case will get picked and get assigned to the agent. This will go on in an indefinite loop. So it is mandatory to remove the entity from the source queue once the desired action takes place.
One-Time Triggers for Retrospective Use Only
This trigger type will be used when you have to process the old entities, mainly for retrotagging the old messages.
Example: Suppose, today's date is 17th October, 2022 and you want to pick all the old messages from 17th October, last year, and add to a queue/tag a CF.
For this use case we have to use One-Time Triggers for Retrospective Use Only. This can pick all the old message and execute it against the condition & action defined in the rule.
Note: Defining source queue is not mandate here. This can work without source queue as well. You cannot define any frequency. The frequency is set it in the backed by default.
Limitations
Conditions do not have icons as they do in the Rules Engine.
Clicking 'Trigger' on a Rule does not show that there are existing Triggers applied to the Rule.
There is no way to view all Triggers applied to a rule simultaneously.
Messages Published from the platform, routed to a Queue via a Rule, and then a Queue Rule triggered does not reflect in the Audit Trail. (Only shows Outbound Audit Trail).
Triggers for messages within a specific date range in the past are not currently supported.
Cannot have a Trigger run on messages brought into the system during a specific date range; instead, the Trigger runs all messages in the environment against the rule during the specified date range.