I thought I would share the progress of my project. I shared it on LinkedIn but this audience is much more technical so I'd love to get some feedback.
I'm creating a solution that will track changes to Genesys Cloud flows using GitHub. Once in GitHub I can then do interesting stuff when a flow changes such as:
- Create Slack notifications for each change with change comparisons
- Linting on expressions / catch common spelling mistakes
- Alert of messages that stray from the brand voice
- etc
Solution so far
The solution which I've diagrammed above is:
- The Genesys EventBridge Integration listens to the
v2.flows.{id}
topic. - A Rule within Event Bridge listens for Publish events using the Event Pattern:
{
"detail-type": ["v2.flows.{id}"],
"detail": {
"eventBody": {
"currentOperation": {
"actionStatus": ["SUCCESS"],
"actionName": ["PUBLISH"]
}
}
}
}
- These Publish events then trigger an EventBridge API destination, which in turn calls the GitHub API for triggering a workflow with the
Flow ID
&Published Flow Version
- The workflow then:
- Uses the Platform API endpoint
/api/v2/flows/{flowId}
to get details about the flow and who made the change- This endpoint only contains details about the last author who made the change, which means there is potential for a timing issue. Will look to see what is being used in the Architect UI to list Change Authors against a flow
- Uses the NPM package
purecloud-flow-scripting-api-sdk-javascript
to export the flow to YAML - Commits the YAML, flow version, author of the change to Git repo
- Uses the Platform API endpoint
- The commit will then trigger other GitHub Actions that can do lots of fun and interesting inspections etc against the updated flow. I haven't started these yet but I will likely wrap these in a CLI so anyone else can easily use them.
I was hoping to remove the need for EventBridge by using Process Automation with a Trigger on v2.flows.{id}
but this topic isn't supported yet.
Please do let me know if you can see improvements I can make - of which I am sure there are many.