This example project illustrates how to use Smooch's pipelines feature to coordinate a bot and a human agent (and attach interesting metadata to messages).
Smooch's messaging pipelines allow you to define a series of message processors running on an external host, which have the ability to attach metadata to messages before forwarding them to webhooks for final delivery.
An API user can define one or many processors to execute in a specified sequence (called a pipeline) in response to a user message. The API user first creates a processor telling Smooch the location of the server. The integrator may then add the processor to one or many pipelines, and choose in that order it executes relative to the other processors in the pipeline.
- Clone this repo
npm install
- Using .env.example as a template create a .env file
npm start
to start the web server- Deploy this service on a proxy (such as ngrok)
- Modify pipeline_config.json to point to a series of complete URLs where webhooks can be sent to your processors. The defaults are
- /processors/skip
- /processors/echo
- /processors/sentiment
- /processors/dialog which map to endpoints in index.js.
npm run deploy
to deploy the pipline configuration to Smooch
You can inspect the configuration by running npm run show
.