genesys-cloud-functions
Industrialized deployment of Genesys Cloud Functions
A GitHub template to develop, test, package and automatically deploy Genesys Cloud Functions through Terraform (Cx as Code) and GitHub Actions CI/CD pipelines.
- Period
- 2025-Q1 — ongoing
- Role
- Design & development
- Platforms
- genesys-cloud
Context
Genesys Cloud Functions arrived in early 2025. This type of Data Action makes it possible to embed and run code directly inside your Genesys Cloud organization. Thanks to serverless, all the code hosting is delegated to the platform.
💡 The full template is available on my GitHub: github.com/antoningar/genesys-cloud-functions. You can clone it to start your own functions with the CI/CD already in place.
Problem
Serverless solves hosting, but not the lifecycle: testing, validating, packaging and then deploying a function remains a manual, repetitive and error-prone operation. To focus on the code rather than on delivery, everything around the function needs to be industrialized.
Approach
A GitHub template that lays down a complete chain, from development to deployment:
function/the function code in TypeScript (a factorial calculation as an example), with its BDD tests (Cucumber), lint and build.terraform/the Cx as Code part: themypurecloud/genesyscloudprovider deploys the function as a Function Data Action (input/output contract,nodejs22.xruntime, handler,.ziparchive). State is managed in a Terraform Cloud (HCP) backend..github/workflows/the pipelines that orchestrate everything.

Deployment follows the Git workflow:
- When a Pull Request is opened / updated the function CI runs a secret scan (gitleaks), the tests, the lint and the build; the Terraform CI packages the function into a
.zip, runsterraform init/validate/planand posts the plan as a PR comment for review. - When the PR is merged the CD repackages the function and runs
terraform apply -auto-approve, which automatically deploys the function into the org.
Result
- Code is systematically tested and validated before reaching
main. - The infrastructure plan is visible and reviewed directly in the PR, before any change.
- On merge, the function is deployed with no manual intervention, in a reproducible way.
- The focus stays on the code: delivery is fully automated.
Technical stack
- Genesys Cloud Functions (Function Data Actions, Node.js 22 runtime)
- TypeScript for the function code, BDD tests with Cucumber, lint and build
- Terraform +
mypurecloud/genesyscloudprovider (Cx as Code), Terraform Cloud (HCP) backend - GitHub Actions: function CI (gitleaks, test, lint, build), Terraform CI (plan as PR comment), Terraform CD (apply on merge)
The template on GitHub
The full template is available open source: github.com/antoningar/genesys-cloud-functions. The repository contains the example function, the Terraform project (Cx as Code) and the ready-to-use GitHub Actions pipelines — clone it to start a new function with automated deployment already wired up.
Going further
Exporting Genesys Cloud prompts to CSV with a Function
Cleaning up Genesys Cloud agent scripts with a Function
Infrastructure as Code
My other work