Skip to main content

Rule

Rules help you automate certain parts of your workflow. Each rule contains:

  1. A set of conditions that match on incoming conversations, and;
  2. A set of actions that will be performed on matching conversations.

To fetch all rules and their conditions:

query Rules {
rules {
nodes {
createdAt
creator {
id
}
description
id
name
position
state
updatedAt
}
}
}

By default rules are sorted by their user-defined row order. To sort by name instead:

query Rules {
rules ( orderBy: { field: NAME, direction: ASC } ) {
nodes {
id
}
}
}
type Rule implements Node, Timestamped {
actions(
after: String
before: String
first: Int
last: Int
): RuleActionConnection
conditions(
after: String
before: String
first: Int
id: ID
last: Int
orderBy: ConditionOrder
): RuleConditionConnection
createdAt: DateTime!
creator: Agent
description: String
id: ID!
lastRunAt: DateTime
matchType: RuleMatchTypes!
name: String!
position: Int!
scheduleSettings: FeatureTemplateRuleScheduleSettings
scheduleType: ScheduleType
state: RuleState!
stopUpcoming: Boolean!
totalExecutions: Int!
triggers(
after: String
before: String
first: Int
last: Int
): RuleTriggerConnection
updatedAt: DateTime!
}

Fields

Rule.actions ● RuleActionConnection object common

Actions associated with this rule.

Rule.actions.after ● String scalar common

Returns the elements in the list that come after the specified cursor.

Rule.actions.before ● String scalar common

Returns the elements in the list that come before the specified cursor.

Rule.actions.first ● Int scalar common

Returns the first n elements from the list.

Rule.actions.last ● Int scalar common

Returns the last n elements from the list.

Rule.conditions ● RuleConditionConnection object common

The Conditions that this rule uses to filter Conversations

Rule.conditions.after ● String scalar common

Returns the elements in the list that come after the specified cursor.

Rule.conditions.before ● String scalar common

Returns the elements in the list that come before the specified cursor.

Rule.conditions.first ● Int scalar common

Returns the first n elements from the list.

Rule.conditions.id ● ID scalar common

The specific Condition ID to fetch

Rule.conditions.last ● Int scalar common

Returns the last n elements from the list.

Rule.conditions.orderBy ● ConditionOrder input common

Sort order of results

Rule.createdAt ● DateTime! non-null scalar common

The date and time that the object was created.

Rule.creator ● Agent object common

The agent that created the rule.

Rule.description ● String scalar common

A description of the rule.

Rule.id ● ID! non-null scalar common

Rule.lastRunAt ● DateTime scalar common

The last time this rule was executed.

Rule.matchType ● RuleMatchTypes! non-null enum common

The match type of the Rule Conditions e.g. any, all

Rule.name ● String! non-null scalar common

The name of the rule.

Rule.position ● Int! non-null scalar common

The position that the rule should appear in when listed.

Rule.scheduleSettings ● FeatureTemplateRuleScheduleSettings object common

The schedule type settings.

Rule.scheduleType ● ScheduleType enum common

The schedule of the rule.

Rule.state ● RuleState! non-null enum common

The state of the rule.

Rule.stopUpcoming ● Boolean! non-null scalar common

True to stop upcoming rules; false otherwise.

Rule.totalExecutions ● Int! non-null scalar common

The amount of times this rule has executed.

Rule.triggers ● RuleTriggerConnection object common

Triggers associated with this rule.

Rule.triggers.after ● String scalar common

Returns the elements in the list that come after the specified cursor.

Rule.triggers.before ● String scalar common

Returns the elements in the list that come before the specified cursor.

Rule.triggers.first ● Int scalar common

Returns the first n elements from the list.

Rule.triggers.last ● Int scalar common

Returns the last n elements from the list.

Rule.updatedAt ● DateTime! non-null scalar common

The date and time that the object was last updated.

Interfaces

Node interface common

An object with an ID.

Timestamped interface common

An object with timestamp fields for when it was created and last updated.

Member of

EmailMessage object ● FacebookMessage object ● ForwardedMessage object ● Message interface ● Note object ● Reply object ● RuleConnection object ● RuleCreatePayload object ● RuleEdge object ● RuleUpdatePayload object ● SummaryMessage object ● TwitterMessage object ● WidgetMessage object

Implemented by

Actor union