Let's use the same scenario as previously. In a help desk application, you want to translate tickets that have not been written in English to English so that support agents understand. Rather than doing this when tickets are stored or opened, the OpenWhisk action is triggered when new documents are stored in a Cloudant NoSQL database.

The documentation describes how to build this scenario. Essentially you need, in addition to the JavaScript action, a trigger and a rule. Invoke the following commands via the CLI and replace your credentials, namespace, and database name.