KeriFlow Components

Public
Connector
AfricasTalking USSD

This component registers an HTTP Route for USSD services and sends request data next. It stores controller instance in the message.refs.controller property. You must respond to the REST response component.

< IMPORTANT:
The component works only with a defined Proxy endpoint in the Flow settings. < URL:
The URL must be relative to the defined Proxy endpoint. So if the endpoint is /users/ and the desired address is http://example.com/users/find then the value must be /find

Services
API Request

The component makes a HTTP request. The response data will be serialized as the payload.

Response:

{
    status: Number,
    headers: { key: value },
    cookies: { key: value },
    host: String,
    body: String/Object/Buffer
}
Services
ChatGPT

This component can talk to ChatGPT. openai

# input

Input will depend on selected model

- __CPT 3.5 Turbo__
```js

// Object
{
messages : [{ role: 'user', content: 'Text' }]
}

// or


// Array
[{ role: 'assistant', content: 'Text' }]
```

- __Whisper__
```js

// Object
{
path : 'path-to-file'
}

// or


// String
'path-to-file'
```

- __Other__
```js

// Object
{
text : 'your question'
}

// or


// String
'your question'
```


# output

Output also depends on selected model
- __CPT 3.5 Turbo__
```js
'Response from assistant'
```

- __Whisper__
```js

// Object
{
text : 'transcipted text'
}
```
- __Other__
```js

// String
'your question'
```
Flow
Conditions

Source and Path

Use the Source dropdown to select where to look for the value to use in the conditions check. Set a Path if the value is not the data itself. It supports dot notation: position.longitude or sensor.0.value for arrays, it does not support sensor[0].value. Expression supports javascript syntax. Should return a value which will be used in condition check as data. Available variables: data, session, variables Expressions example:

data.value - variables.offset

Conditions

Each of the Conditions corresponds to an output in the exact same order. First condition -> First output.

Operator Not all operators work on all data types. For example it is not possible to use &gt; or &lt; for strings, etc. index of only works for data of type array or string. Expression operator In this case the type field is ignored and the expression in the value field must return true or false. Available variables: data, session, variables. Expressions operator example:

data.value &gt; variables.threshold;

or with a conditions

if (typeof data.value !== 'number') return false; else return data.value &gt; parseInt(variables.threshold);

Expression type The expression in the value field must return a value which will be used in the given operation. Available variables: data, session, variables. Expressions example:

data.value - variables.offset

Between operator only works with datatype number and the value must be two comma separated values. e.g.: 2,4 so the condition becomes val &gt; 2 &amp;&amp; val &lt; 4

Debug
Counter

The component counts incoming messages.

Triggers
Crontab

The component can make a trigger in the specific time and date.

Cron string: * * * * *

Meaning of each * explained bellow, in order from left to right:

  • minute 0 - 59
  • hour 0 - 23
  • day of month 1 - 31
  • month 1 - 12
  • day of week 0 - 6 and 0 is Sunday
0 16 * * *      -&gt; trigger every day at 16:00
20 19 * * *     -&gt; every day at 19:20 and 19:40
* * * * *       -&gt; trigger every minute
0 20 * * 1      -&gt; every monday at 20:00
Debug
Debug

The component prints incoming data into the JSON format.

Triggers
Delay

The component delays processing of a message.

Triggers
Flashback

The component remembers the data for repeating the action.

Flow
Catalog

readme

Flow
Confirm

readme

Flow
Input

readme

Flow
Menu

readme

Flow
Message

readme

Flow
Secure Pin

readme

Flow
Keyword

WhatsApp Keywrord

Static

The whatsapp keyword can be juste a word, or a sentence, eg. buy, delivery, location.

Dynamic

WhatsApp keyword can be dynamic, so can handle multiple cases, for example: buy {item}, delivery {district}, remittance {operator} {customer}. The dynamic part must be enclosed in braces { and }.

Flow
Link

The component can teleport (input) message to another teleport (output) component.

Debug
Logs

As the FlowStream worker runs, the component records significant information. The component can reveal hidden bugs or performance issues. The component stores data in the logs/* directory.

Triggers
Minutely

The component triggers data into the Flow in every minute.

Triggers
Notify

This component captures data on the /notify/ endpoint.

Output data:

{
    "method": String,
    "query": Object,
    "body": Object,
    "headers": Object,
    "cookies": Object,
    "url": String,
    "ip": String
}
Debug
Print

The component prints incoming data in a JSON format.

Triggers
Queue

A simple persistent queue for the incomming messages.

Databases
Google Sheet

Execute SQL Query on ReadOnly public Google Sheet

## SQL Query

  -- -- Aviable column
  -- [row]          -- INT the row number 
  -- [rowNumber]    -- INT the row number 
  -- [col]          -- TEXT the colume name in upper case (Ex. A) 
  -- [colNumber]    -- INT the col number 
  -- [index]        -- TEXT the cell index in upper case (Ex. A1) 
  -- [value]        -- TEXT OR DOUBLE the value of the cell
  -- -- Aviable table
  -- [sheet{index}] -- The spreadsheet from position (Ex. [sheet1],[sheet3])
  -- [Sheet Label]  -- The spreadsheet from label (Ex. [Table Number], [Super Sheet 007])
  -- Nb. Column Table and Names must be between brack ([]) 

  SELECT [value] FROM [Sheet Label] where [index] = "A1"

## How access to your google sheet

  • Open your Google Sheet
  • Click File > Publish to the web…
  • Click on Link then Select Entire Document and Web page
  • Copy link
  • Click Publish
Connector
Telegram

How Connect Your Telegram

Obtain API ID and API KEY

  1. Login into your telegram account
  2. Then click "API development tools" and fill your application details (only app title and short name required)
  3. Finally, click "Create application"

> Never share any API/authorization details, that will compromise your application and account.

When you've successfully created the application, you can get Api Id and Api Key.

Create a new Telegram bot with BotFather

  1. Start a new conversation with the BotFather.
  2. Send /newbot to create a new Telegram bot.
  3. When asked, enter a name for the bot. (the name must end with the word "bot").
  4. Copy the Telegram bot's access token.

Configure

  1. Set API ID
  2. Set API KEY
  3. Set Phone Number
  4. Set Password
  5. Apply, you will receive the code
  6. Open configuration ans set the phone code
  7. Apply and click on *Connection
Triggers
Timer

The component triggers data into the Flow in the specified interval.

Flow
Transformer

With this component you can easily modify incoming data. Then the data content is delivered.

Example 1:

// "data" is a reference to message data
data.name = data.name.toUpperCase();

Example 2:

data = data.toUpperCase();

Example 3:

data.client = session.inputs.phone;
data.label = session.menus.home.label;
Triggers
Trigger

The component triggers data into the Flow.

Connector
Whatsapp

How Connect Your WhatsApp

  1. Open WhatsApp on your phone
  2. Tap on Menu > Settings > and select Linked Devices
  3. Tap on Link a Device
  4. Point your phone to the QR code

How handle message

  1. Add a keyword component
  2. Double click on component to open configurations
  3. Choose the keyword added previously
Services
Email

readme

Services
Google Search

This component can google any keyword you want.

Configuration

  • Language (optional) : Search language;
  • Limit (optional) : Limit number of results.

Input

  • Object | String : input expects data: String or data.text: String as search keywords.

Output

  • Array of found results:
Databases
MongoDB

Query editor

// db = client.db("db-name"); database instance
// collection = use("db-name").collection('collection-name'); collection instance
// data; data from the incomming object
// session; session from connector (can be empty)
// variables; variables object
var myCol = client.db('testDb').collection('players');
const cursor = myColl.find({});
const allValues = await cursor.toArray();

return allValues; // send  allValues to the next component 

(MongoDB Documentation)[https://www.mongodb.com/docs/drivers/node/current/fundamentals/crud/query-document/]

Payments
MyPayga

The component allow your send payments to more than 300 million mobile, bank and card account holders across Africa.

Databases
MySQL

Execute MySQL Query

MySQL Query

SELECT * FROM tblname
Services
OpenWeather

This component can retieve weather data from OpenWheatherMap;

Input

    {
        query: {String},             // Optional, City name, Country code, State code e.g: London, Ouagadougou, sk
        lon: {String},           // Optional, Longitude
        lat: {String},           // Optional, Latitude
        lang: {String},           // Optional, Output language e.g: `en`, `de`, `sk`, `fr` etc...
        units: {String},         // Optional, standard, metric, imperial
        date: {String},         // Optional,  Timestamp (Unix time, UTC time zone), e.g. date=1586468027.
    }
Payments
Pvit

The component allow your send payments to more than 300 million mobile, bank and card account holders across Africa.

Components