cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Actions

Learn about building complex business logic contextually within Flows
Filter
Filter by Labels
Select any of the labels below to filter results.
Filters applied...
flow overview
Sorted by:
Just like   Cloud code , Webhook actions are triggered using actions. Simply drag and drop them below any trigger and select the action. POST Request Whenever a webhook is triggered Flow.ai sends along data in JSON format to your callback url . { "type" : "action" , "verifyToken" : "b34768df-4768-4768-8cfe-0ac99db46ca9" , "threadId" : "99eb45ed85a0a00cef41f55aa03bea17" , "channelName" : "socket" , "query" : "hi" , "action" : "onboarding" , "params" : { }, "originator" : { "actorId" : "23249a99-a243-448b-asdf-daddd7bafb6c" , "userId" : "flowai|23249a99-1233-448b-ada1-daasafbafb6c" , "name" : "EN Bot" , "role" : "bot" , "profile" : { "description" : "Flow.ai" , "locale" : "en" , "picture" : "https://flow.ai/img/brains/flowai.svg" } }, "user" : { "name" : "Jane Doe" , "role" : "external" , "profile" : { "fullName" : "Jane Doe" , "firstName" : "Jane" , "lastName" : "Doe" , "email" : "jane@doe.ai" , "picture" : "https://..." , "locale" : "nl" , "timezone" : 2 , "gender" : "M" } }, "replyUrl" : "https://..." } Reference Property Description type By default this is:   action verifyToken The verify token you specified in the webhook configuration threadId The ID representing the thread that triggered the webhook call channelName Name of the channel on which the Webhook call was triggered query Optionally a user query that triggered this Webhook call action Each action triggering a Webhook call can customise this. See the Design app params Optional object with params retrieved by Flow.ai originator The sender of the action user The user that triggered the Webhook call replyUrl Unique url to be used to reply to this thread on the correct channel Action: You can control the value of   action , like in the example above (onboarding), from within the designer. This makes it easy to use a single endpoint with different actions. Params As with Cloud code you can expect a set of various params. For example a user shares a file or the   bot detects a named entity. { "type": "action", "verifyToken": "...", "threadId": "...", "channelName": "alexa", "query": "What is the weather like in Toronto?", "action": "get-weather-report", "params": { "city": [ { "match": "Toronto", "type": "system.query", "value": "Toronto" } ] }, ... } In the above example you can see that the engine extracted data and placed it into a params object. Each param is always a list (array) allowing multiple results. { "type": "action", "verifyToken": "...", "threadId": "...", "channelName": "amazon", "query": "What is the weather like in New York and Toronto?", "action": "get-weather-report", "params": { "city": [ { "match": "New York", "type": "system.query", "value": "New York" }, { "match": "Toronto", "type": "system.query", "value": "Toronto" } ] }, ... } Reference Property Description value The extracted value match Optionally, the piece of text that matched type Optionally, the type of data that was extracted Further reading Node.js webhook example project
View full article
by Khoros Staff Khoros Staff Jun 17, 2021
Labels (2)
0
40
This function allows you to use an existing   Stripe product's   SKUs   that could be purchased inside your   flow . Notes This method does not support   metadata . Prerequisites Enabling Checkout You need to enable the   Checkout client-only integration   within the Stripe   Checkout settings.   One-time purchase products Flow.ai supports only   One-time purchase products . Double check you have chosen the proper option when creating a   new Stripe product.   Usage example async payload => { const url = await payments.preparedPurchase.stripe({ key : 'your_stripe_publishable_key' , locale : 'nl' , collectAddress : true , submitType : 'donate' , items : [ { sku : 'sku_of_your_product' , quantity : 1 }, { sku : 'sku_of_your_another_product' , quantity : 3 } ], onSuccess : { eventName : 'bought' , params : [ new Param( 'category' , 'clothes' ) ] }, onFailure : { eventName : 'not bought' , params : [ new Param( 'category' , 'clothes' ) ] } }) const buttons = new Buttons( 'Purchase my items' ) buttons.addButton( new Button({ label : 'Click to purchase' , type : 'payment' , value : url })) const message = new Message( `Purchase items here ${url} ` ) message.addResponse(buttons) return message } Properties Property Type Example Description Required key string pk_test_XXXXXXXXXXX Your Stripe Publishable Key Yes collectAddress boolean true Whether Checkout should collect customer's   address   locale string nl By default, Checkout detects the locale of the customer’s browser and displays a translated version of the page in their language, if it is   supported. You can also provide a specific locale for Checkout to use instead   submitType string donate Submit type   of payment session   button.label string Click to purchase Label of the confirmation button   Success and Failure params You can include   onSuccess   and   onFailure   configuration which will be used in corresponding situations. Property Type Example Description Required eventName string bought Event name to trigger when items are successfully bought / purchase is rejected   params array new Param('productiId', 112234) Parameters that are set when the items are bought / purchase is rejected   Items The multiple select is based on a number of items. Each individual item should contain   sku   and   quantity   properties. Properties Property Type Example Description Required sku string sku_XXXXXXXXXXX SKU   of your product Yes quantity number 1 Amount of items to be purchased Yes  
View full article
by Khoros Staff Khoros Staff Jun 17, 2021
Labels (2)
0
37