Zendesk Guide serves as a sophisticated knowledge base, empowering users to leverage institutional knowledge effectively. It allows individuals to establish a customizable help center and customer portal. This article outlines the implementation of a bidirectional event orchestration pattern utilizing AWS services alongside Amazon EventBridge’s third-party integration with Zendesk. The example centers around support ticket events to develop a customer self-service knowledge repository, leveraging the EventBridge partnership with Zendesk to expedite the expansion of a customer help center.
The illustrations here are part of a serverless application named FreshTracks, constructed in Vue.js, which showcases SaaS integrations with Amazon EventBridge. For a hands-on experience, visit the FreshTracks application and submit a query.
The backend components for this integration have been organized into a distinct example application, available in this GitHub repository.
Application Overview
The process of routing Zendesk events through Amazon EventBridge is as follows:
- A user searches the knowledge repository via an embedded widget in the web application.
- If no answer is found, the user submits their question through the web widget.
- Zendesk receives the question as a support ticket.
- When the support ticket is resolved, Zendesk emits events.
- These events are streamed into a custom SaaS event bus in EventBridge.
- Event rules are applied to match events and direct them to an AWS Step Functions Express Workflow.
- The Express Workflow orchestrates Lambda functions to gather additional information about the event using the Zendesk API.
- A Lambda function employs the Zendesk API to publish a new help article from the support ticket data.
- The new article becomes searchable via the website widget for other users.
Prior to deploying this application, you must obtain an API key from Zendesk.
Creating the Zendesk API Resource
To interact with your Zendesk account from AWS, you need to generate an API token. Here’s how:
- Log into the Zendesk dashboard.
- Click the Admin icon in the sidebar, then navigate to Channels > API.
- Select the Settings tab, ensuring Token Access is activated.
- Click the + button adjacent to Active API Tokens.
Once generated, make sure to copy and store the token securely, as it won’t be displayed again after closing the window.
Configuring Zendesk with Amazon EventBridge
Step 1: Setting Up Your Zendesk Event Source
- Navigating to your Zendesk Admin Center and select Admin Center > Integrations.
- Click Connect in the events Connector for Amazon EventBridge to configure your event source.
- Input your AWS account ID and select the appropriate Region to receive events.
- Click Save.
Step 2: Associating the Event Source with a New Event Bus
- Access the AWS Management Console and go to services > Amazon EventBridge > Partner event sources.
- Select the corresponding radio button next to the new event source and click Associate with event bus.
- Confirm your choice by clicking Associate.
Deploying the Backend Application
Once the event source is linked with a new partner event bus, you can deploy backend services to receive events. For setup instructions, refer to the README.md file in the GitHub repository. Ensure to provide the custom event bus name and Zendesk API credentials with the –parameter-overrides option during deployment.
For example:
sam deploy --parameter-overrides ZendeskEventBusName=aws.partner/zendesk.com/123456789/default ZenDeskDomain=MydendeskDomain ZenDeskPassword=myAPITOken ZenDeskUsername=myZendeskAgentUsername
You can find the name of the new custom event bus in the EventBridge console.
Routing Events with Rules
When there’s an update to a support ticket in Zendesk, multiple events are streamed to EventBridge, including:
- Agent Assignment Changed
- Comment Created
- Status Changed
- Brand Changed
- Subject Changed
An EventBridge rule filters these events. The AWS Serverless Application Model (SAM) template outlines the rule with the AWS::Events::Rule
resource type, directing the event downstream to an AWS Step Functions Express Workflow. The EventPattern is defined as follows:
ZendeskNewWebQueryClosed:
Type: AWS::Events::Rule
Properties:
Description: "New Web Query"
EventBusName:
Ref: ZendeskEventBusName
EventPattern:
account:
- !Sub '${AWS::AccountId}'
detail-type:
- "Support Ticket: Comment Created"
detail:
ticket_event:
ticket:
status:
- solved
tags:
- guide
Targets:
- RoleArn: !GetAtt [ MyStatesExecutionRole, Arn ]
Arn: !Ref FreshTracksZenDeskQueryMachine
Id: NewQuery
Tickets must possess two specific tags (web_widget and guide) for this pattern to match. These tags are defined as separate fields to establish an AND matching rule. A new comment on a support ticket triggers the event.
The Step Functions Express Workflow
The application redirects events to a Step Functions Express Workflow defined within the SAM template:
FreshTracksZenDeskQueryMachine:
Type: "AWS::StepFunctions::StateMachine"
Properties:
StateMachineType: EXPRESS
DefinitionString: !Sub |
{
"Comment": "Create a new article from a zendeskTicket",
"StartAt": "GetFullZendeskTicket",
"States": {
"GetFullZendeskTicket": {
"Comment": "Get Full Ticket Details",
"Type": "Task",
"ResultPath": "$.FullTicket",
"Resource": "${GetFullZendeskTicket.Arn}",
"Next": "GetFullZendeskUser"
},
"GetFullZendeskUser": {
"Comment": "Get Full User Details",
"Type": "Task",
"ResultPath": "$.FullUser",
"Resource": "${GetFullZendeskUser.Arn}",
"Next": "PublishArticle"
},
"PublishArticle": {
"Comment": "Publish as an article",
"Type": "Task",
"Resource": "${CreateZendeskArticle.Arn}",
"End": true
}
}
For more insight into these procedures and additional resources, check out this excellent guide on Amazon’s fulfillment center safety and training. Additionally, if you’re keen on deepening your understanding of similar topics, this link leads to a valuable post worth reading.
Tags: 9097372855, chanci turner, Idell Turner, amazon, VGT2
Leave a Reply