Violet Conversation Sample

by salesforce



violet-samples is a list of example voice app/bot scripts (powered-by violet-conversations). This project is configured to create a skill at the alexa/einstein end point.

Deploy Script Notes Deploy scripts/basicCalculator.js Basic Arithmetic Calculator Deploy scripts/financeCalculator.js Split bills, calculate tips & find out how many payments will need to be made on a mortgage Deploy scripts/sf-leadsAndOpportunities.js Access your Salesforce Sales Leads and Opportunities Deploy scripts/sf-cases-employee.js Access your Salesforce Service Cases (for employees) Deploy scripts/sf-cases-customer.js Access your Salesforce Service Cases (for customers) Deploy scripts/sf-knowledge-base.js Search a Salesforce Knowledge Base Deploy apps/todo/script.js Manage your todo list powered by Quip Deploy scripts/diabetes-stoplight.js Diabetes support at home for patients by implementing Stoplight tool Deploy apps/restaurants/script.js A sophisticated tool to help you find restaurants close by powered by the Yelp API apps/dfSessions/script.js An event information kiosk (built for Dreamforce)

Table Of Contents

Getting Started

This project contains a number of Scripts that we have built and can be used as the basis of your Voice Application. To use the Scripts, they need to run in the cloud so that Amazon's voice servers can access it. These can also be run locally via a non-voice (web-only) interface.


  • Install Node v6 or greater - if you need to maintain an older version of node, consider using nvm.

  • Get the code: If you want the latest fixes, we would recommend to get this via git: git clone You can alternatively get the latest release.

  • Download dependencies: npm install

  • Environment variables: If you are using the Salesforce integration plugin (as used by the Leads & Opportunities Script) you will need to set up variables (for more information see the Persistence plugin information).

  • Run locally: node <path_to_script> (the script will print the path to the url for the web interface).

    You can also run the full server by doing: npm start but you will need to setup the SCRIPT_NAME environment variable so that the engine knows which script to run (the default value is ../scripts/sf-leadsAndOpportunities.js).

    Local execution is used to ensure that there are no syntax errors, to view intent schemas (for the interaction model) and supported utterances, as well as for testing the script logic.


The code already has a Procfile so it is easy to deploy to heroku). When deploying make sure to configure the environment variables on the deployed server. Heroku lets you do this by typing something similar to (you will need to use the right values for XXX):

heroku create
git push heroku master

Once deployed you will need to use your servers settings to create a new skill at Amazon's Skill Configuration Site. The skill will be using a Custom Interaction Model, will need values from the services skill configuration page.

For step-by-step instructions - see here:

If you want to share a Voice Application that you have created without publishing, you might want to consider using a shared Amazon Developer account.


Guidelines on contributing to Violet are available here.