New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Automation rules #3195
Comments
Params structure we are getting at backend [API]{
automation_name: "Some Name"
automation_description: "Some Description"
automation_event: "Conversation Created"{dropdown}
automation_conditions [
{
select attribute: BROWSER_LANGUAGE/COUNTRY/MESSAGE_CONTENT/STATUS/ASSIGNEE/TEAM
select operator: IS/IS NOT/EQUALS TO/NOT EQUAL TO/CONTAINS/ DOES NOT CONTAINS'
select value: en
}
]
automation_actions: [
Send Message: { Message: value },
Add Label: [ priority_customer ],
Assign best agents: [ Mutiselct of agents ]
Update Custom Attributes: [
attribute_key: attribute_value
]
Pin the conversation: /* future scope */
]
} ExamplesExample 1: {
automation_name: "Paid Plan: Conversation Automation"
automation_description: "Silver Paid Plan, Customer Conversation Automation"
automation_event: "Conversation Created" {dropdown}
automation_conditions: [
{
automation_conditions_attribute: plan /* Custome Attribute */
automation_conditions_operator: EQUALS TO
automation_conditions_value: Silver
},
{
automation_conditions_attribute: Country /* Custome Attribute */
automation_conditions_operator: EQUALS TO
automation_conditions_value: USA
}
]
automation_actions: [
Send Message:
{
Message: 'Welcome to the chatwoot platform.'
},
Assing to team : "Customer Success"
Add Label: [ priority_customer ],
Assign Best Agents: [ 1,2,3,4 ] /* Dropdown Agent Names */
Update Additional Attributes: [
intiated_at: Time.now
]
]
} Example 2: {
automation_name: "Chinese support"
automation_description: "Assign the conversation to chinese support team if the language is chinese"
automation_event: "Conversation Created" {dropdown}
automation_conditions: [
{
automation_conditions_attribute: browser_language
automation_conditions_operator: eq
automation_conditions_value: cn
}
]
automation_actions: [
Assing to the team: "Chinese support team"
]
} Example 3: {
automation_name: "Update company name"
automation_description: "Update company name conversation is started from company email id"
automation_event: "Conversation Created" {dropdown}
automation_conditions: [
{
automation_conditions_attribute: message
automation_conditions_operator: present
automation_conditions_value: @company.com
}
]
automation_actions: [
Update additional attributes: company name
]
} Example 4: {
automation_name: "Conversation is related mobile"
automation_description: "Assign the conversation to Jack conversation is related mobile"
automation_event: "Conversation Created" {dropdown}
automation_conditions: [
{
automation_conditions_attribute: message_content
automation_conditions_operator: contains
automation_conditions_value: mobile,
}
]
automation_actions: [
Assing to a person: Jack
]
} Example 5: {
automation_name: "Career related questions"
automation_description: "Send message to career related messages"
automation_event: "Conversation Created" {dropdown}
automation_conditions: [
{
automation_conditions_attribute: label
automation_conditions_operator: eq
automation_conditions_value: career,
query_operator: 'OR',
},
{
automation_conditions_attribute: label
automation_conditions_operator: eq
automation_conditions_value: job,
query_operator: 'OR',
}
]
automation_actions: [
Send message: "Hey, Thank you for your interest. We don't have an open position available in chatwoot at the moment. If you could send your resume to hello@companyname.com, we would reach out if a matching position opens up in the future. Thank you again, and we wish you all the best in your job search"
]
} |
Supported operators
|
Automation events1. Conversation Created
2. Conversation Resolved
3. Assigned
4. Label Added
5. Label Removed
6. Conversation Snoozed
7. Conversation Auto Resolved
8. Conversation Muted
9. Team Assigned
10. New message created (Incoming/Outgoing) Automation conditions1. Select inbox (Option to select all or some inboxes)
2. Status - Open / Resolved / Pending / Snoozed / All
3. Contact - Contact or None
4. Team
5. Label or Labels
6. Message (Support regex)
7. Assignee - Person or None
8. Custom attributes (Contact or Conversation)
9. Additional attributes (Browser, City, Country_code, referer)
10. Contact fields (email, name, phone_number, last_activity_at, identifier)
11. Working hours Automation actions1. Send Message
2. Send Email
3. Resolve Conversation
4. Add Label
5. Update custom/additional attributes
6. Remove label
7. Snooze Conversation
8. Assign to agent
8. Assign to team
9. Send Transcript
10. Add support for sending webhook event |
@muhsin-k @aswindevps @pranavrajs @tejaswinichile can you add automation action to send interactive session message so customer can replay by clicking the button and save his replay on custom attributes so we can implement local chat bot example : |
@muhsin-k |
@voko3456 It's pretty early to quote if we can fulfill your requirement mentioned here #3195 (comment) in the next release, but we can have an initial message to send to the customer,
After that how would we save the customer response, will take some time to decide. But thanks for the requirement we would like to have that in our support system we would track that requirement in the different ticket. |
Back End
|
@sojan-official We can do it without gem too but it will just fatten the models. Here are some examples:
Please let me know if you think otherwise. |
@tejaswinichile Sounds like a good direction. we already have pubsub mechanism in chatwoot using the wisper gem. Line 75 in a34bb56
We can refactor and enhance the current list of events to support all the required event types. Line 3 in a34bb56
We can also add an automation listener which will react to these events based on the account configuration
|
@sojan-official Okay then I will use the same gem. Thanks :) |
Front End
|
@muhsin-k |
MVP for automation rule:Event: Message Created Supported Condition:
Supported Actions:
Event: Conversation Created Supported Condition:
Supported Actions:
Event: Conversation Updated Supported Condition:
Supported Actions:
|
One update: automation_actions: [
Send Message: { Message: value },
Add Label: [ priority_customer ],
Assign best agents: [ Mutiselct of agents ]
Update Custom Attributes: [
attribute_key: attribute_value
]
Pin the conversation: /* future scope */
] Would look like this: automation_actions: [
{
action_name: send_message,
action_params: 'Welcome aboard!'
},
{
action_name: add_label,
action_params: [priority_customer, finance_query]
},
{
action_name: assign_agents,
action_params: [1,2,3,4]
},
update_custom_attributes: [
{ attribute_key_1: attribute_value_1 },
{ attribute_key_2: attribute_value_2 }
]
] @muhsin-k Please take note of this change. |
@tejaswinichile @muhsin-k please don't forget to add the most important action is to send webhook when custom attributes updated or label added |
Notes: Assign Best Agent: We assign only one agent, so the agent's dropdown would have a single selection. Send email to the team: The team should be part of the account. This will require 2 params, one for team ids and the other for the email content. |
@tejaswinichile @muhsin-k potential use case When phone number attribute of a contact gets updated 'Create conversation in an external Inbox with a specific message'
ref: https://discord.com/channels/647412545203994635/719548534302441565/920414786691432548 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Problem
There will be tons of repeatable tasks for any team that can be automated — like assigning a specific type of conversation to the right team or adding correct labels.
Ex: Suppose an agent receives a message from a premium customer in their chatwoot dashboard. Then, an agent can add the label "priority conversation" based on their plan and prioritize them. Now this flow is carried out manually. This kind of issue can solve by adding automation rules.
Automation can replace and automate existing processes that require manual effort. You can do many things with automation, including adding labels and assigning conversation to the best agent. So the team focuses on what they do best and spends more time on manual tasks.
Automation helps,
Solution
Automation rules consist of three parts, event, conditions, and actions. The list of defined actions will be performed sequentially when matching all the conditions after the specified event is triggered. As simple as "when, If this, then that."
Engineering Spec
Back End
Data Model
Automation
Front End
Todo
Success metrics
Questions
Frontend
The text was updated successfully, but these errors were encountered: