Custom logic is switched on per organization, on top of Dispositions. If Logic is missing from the Add value menu, it isn’t on for your organization yet. Your Bland partner can ask for it.
Prerequisites
- A disposition on the agent. See Build one
- An owner, admin, operator or prompter role to edit it, and an owner, admin or operator role to publish it. See Roles and permissions
How rules decide a label
- Rules are checked from the top. The first rule that matches gives the call its label, and the rest are skipped.
- A rule matches when All conditions are true, or when At least one condition is true. You choose per rule.
- Unclassified is always last. A call that matches no rule gets it.
- Custom logic runs after every other value in the disposition, so a rule can read their results.
- Rules run without a model. The cost estimate for a custom logic value is $0.
Build it
1
Add a custom logic value
In your disposition, open Add value and choose Logic, then Create custom logic. Give the value a name, such as Call outcome. Its key is how the result is named in the payload.
2
Add rules
Press Add rule. A value holds up to 23 rules. In the rule drawer:
- Conditions: what has to be true about the call. Add as many as you need.
- Condition matching: All conditions are true or At least one condition is true.
- Label: the name shown on the call, and a key with lowercase letters, numbers and underscores, up to 64 characters.
- Description (optional): when the label applies. It’s shown in conversation logs.
- Classification (optional): one of Goal achieved, Right party contact, Goal lost or No contact. It appears next to the label and in the result.
3
Order them
Drag rules to change their order, or choose Move up or Move down from a rule’s menu.
4
Publish
Publish the disposition. The rules start labeling calls the agent takes from then on. To label calls it already took, run a backfill.
Start from a template
Two ways to skip writing rules from scratch:- Before you add your first rule, Templates in the custom logic editor adds a starter set of rules: Outbound sales or Inbound support.
- When you create a disposition, the Outbound sales call outcomes and Inbound support call outcomes templates create a whole disposition with a custom logic value already in it. The outbound template also includes an Interest value that a model reads from the transcript, so that disposition does have a model cost.
Copy rules from another disposition
The Logic menu also lists the custom logic in the agent’s other dispositions. Pick one to copy its rules into this disposition. The copy is independent, so later edits to either one don’t affect the other. If the copied rules read a disposition value this disposition doesn’t have, the editor names it.Conditions
For variables and disposition values:
- Text comparisons ignore capitalization and surrounding spaces.
- “Does not equal” also matches a value that isn’t set.
- “Is greater than” and “is less than” match only when the value is a number.
- “Is any of” takes up to 20 values.
- A rule can’t read another custom logic value, or its own.
Tool conditions
Enter the tool’s exact runtime name. Each comparison checks the tool’s last attempt on the call:Example
A dental front desk that books cleanings with abook_appointment tool. The tool’s response mapping stores booking_confirmed, and the agent extracts caller_intent.
Rule 2 only catches calls where the tool ran without confirming, because a confirmed booking already matched rule 1.
See why a call got its label
In Conversations, the value gets a column and a filter named after it, for example Call outcome. Press a call’s label to open its Dispositions section with the rule that matched, for example:Rule 1 matched: Variable booking_confirmed equals trueA call with no matching rule shows “No rule matched.” The filter leaves messaging conversations out, and Export is unavailable while it’s on.
Read the result
The label arrives with the disposition’s other results on your post-call webhook. See Read the results. The value is an object:codeis the matched rule’s key, orunclassifiedwhen no rule matched.classificationis left out when the matched rule has none, and isunknownfor Unclassified.- The webhook doesn’t say which rule matched. That shows only in Conversations.
Common failures
Calls I tested in Chat have no label
Calls I tested in Chat have no label
Custom logic labels calls. A chat in the agent’s test panel isn’t a call, so nothing runs on it. Place a phone call to test. Custom logic doesn’t run on SMS or other messaging conversations either.
The label is Error on calls whose rules use a tool
The label is Error on calls whose rules use a tool
A tool condition needs the call’s complete tool history. When some of that history wasn’t recorded, the value errors rather than give a label it can’t trust. It does this whenever a tool condition is checked before the call matches a rule, so a tool condition in rule 1 affects every call.Rules that match before any tool condition still label normally. To avoid the error, map the tool’s response to a variable and test the variable, or put tool rules below the rules that catch most calls.In the webhook, the value arrives with
state set to error and the code result_error.Every call is Unclassified
Every call is Unclassified
Check the names in your conditions. Tool and variable names must match the agent exactly, and variable names are case-sensitive. Starter rules from a template use example names until you change them.
A call got a broader label than I expected
A call got a broader label than I expected
An earlier rule matched first. Open the label in Conversations to see which rule it was, then move the narrower rule above it.
Next steps
Dispositions
Delivery timing, webhooks, testing and backfills.
Conversations
Filter calls by label and see the rule that matched.