Function Blocks allow you to execute actions based on AI and user inputs. Please contact us if you want to add any function block for custom integration.

Schedule a Callback

Schedules a callback with the customer, passing additional context.

Inputs

  • Greetings_message – Greeting message voice agent will say to the customer, this will override initial prompt defined for the use case. This can be linked to a connecting block (AI generated greetings meesage based on previous conversation) or manually written. Data linkage will override the written text.
  • Conversation_context – Pass previous conversation context to the voice agent.
  • Scheduled_Time – Set the time for the callback. This follows ISO date format YYYY-MM-DDTHH:MM:SSZ.
  • Bot_Number – Phone number to be used to call the customer. This can be linked to a connecting block or selected from dropdown option. Data linkage will override pre-selected dropdown option.
  • Use_Case – Voice agent that will handle the callback. This can be linked to a connecting block or selected from dropdown option. Data linkage will override pre-selected dropdown option.
  • Customer_Number – Customer’s phone number.
  • Customer_Details: Customer’s details such as name, email in JSON format
  • Agent_Options: If provided, these will override settings as defined in the Voice Agents section. E.g. if you want to change the language, voice, initial prompt, etc.
  • No_Of_Retries: Number of retries if call failed if provided
  • Retries_After_In_Hrs: Retry interval (in hrs) if provided
  • Start_Working_Hour: 24 hour format (HH:MM), If provided call made before start hours will rescheduled at start hour of the day.
  • End_Working_Hour: 24 hour format (HH:MM), If provided call cannot be made after the end work hour and if call made after end hours will rescheduled at start hour of the next day.
  • Timezone: Call between start working hour and end working hour in timezone if provided [Default: Asia/Kolkata]

Outputs

  • Callback_scheduled – Confirms if the callback was successfully scheduled - True or False.

Send WhatsApp

Sends a WhatsApp message to the customer.

Interakt

Inputs

  • Customer_Number – Customer’s phone number.
  • Provider – Select your service provider for sending messages - Interakt.
  • api_key – Enter the API key for authentication.
  • template_name – Select the WhatsApp message template.
  • template_language_code – Select the language code for the template.
  • header_values – Dynamic variables for template headers (e.g., [“Renewal Due”, “Policy Update”]).
  • body_values – Dynamic variables for the message body (e.g., [“John”, “123456”]).
  • button_values – Dynamic variables for any buttons in the message.

Outputs

  • Message_success: Confirms if the WhatsApp message was successfully sent - True or False.

Gupshup

Inputs

  • Customer_Number – Customer’s phone number.
  • Provider – Select your service provider for sending messages - Gupshup.
  • user_id – Enter the user id for authentication.
  • password – Enter the password for authentication.
  • template_id – Provide the WhatsApp message template.

Outputs

  • Message_success: Confirms if the WhatsApp message was successfully sent - True or False.

Send Email

Sends an Email to the customer.

Standard email providers

Inputs

  • To – Customer’s email address.
  • CC – Additional email addresses you want to keep in loop, multiple entries to be separated by ;.
  • Subject – Subject of the email. This can be linked to a connecting block (AI generated subject based on previous conversation) or manually written. Data linkage will override the written text.
  • Email_Body – Content of the email. This can be linked to a connecting block (AI generated email body based on previous conversation) or manually written. Data linkage will override the written text.
  • Email Provider – Select your service provider for sending email - Gmail, Outlook, Zoho, Godaddy.
  • From Email – Company Email ID from which you want to send an email to the customer.
  • Password – Enter the password for authentication.

Outputs

  • Email_success: Confirms if the Email was successfully sent - True or False.

Custom email provider

Inputs

  • To – Customer’s email address.
  • CC – Additional email addresses you want to keep in loop, multiple entries to be separated by ;.
  • Subject – Subject of the email. This can be linked to a connecting block (AI generated subject based on previous conversation) or manually written. Data linkage will override the written text.
  • Email_Body – Content of the email. This can be linked to a connecting block (AI generated email body based on previous conversation) or manually written. Data linkage will override the written text.
  • Email Provider – Select your service provider for sending email - Gmail, Outlook, Zoho, Godaddy.
  • From Email – Company Email ID from which you want to send an email to the customer.
  • Password – Enter the password for authentication.
  • SMTP Host – Enter your service provider SMTP host name e.g., smtp.gmail.com
  • SMTP Port – Enter your service provider SMTP port number e.g., 467
  • SMTP TLS Secure – Select TLS security protocol of your service provider - Enabled, Disabled.

Outputs

  • Email_success: Confirms if the Email was successfully sent - True or False.

Smart Filter

Sends an Email to the customer.

Inputs

  • Field – Select a field to apply the filter. Multiple fields can also be linked from outputs of other blocks.
  • Condition – Define a filtering condition (e.g., =, contains, >).
  • Value – Enter the value to filter by.
  • Add more – Apply multiple conditions simultanuously with AND or OR operators.

Outputs

  • Filtered Results: Returns only the fields that match the specified filter conditions.

Webhook Block

Sends events to client side applications. Webhooks enables your workflow to respond to external events.

Inputs

  • URL – Webhook URL to send the events to.
  • Data – Data or events to send through webhook, data outputs from other blocks can be linked as inputs.

Outputs

  • Success_message: Confirms if the Data was successfully sent - True or False.

Client side set up

Webhook URL Requirements:
Your webhook endpoint must meet the following conditions:

  • Accept POST requests only.
  • Accept and parse application/json request bodies.
  • Respond with JSON using Content-Type: application/json.
  • Use proper HTTP status codes to indicate success or failure.

What does the Webhook receive?
The webhook node sends the following payload to the provided URL:

POST /your-webhook-endpoint
Content-Type: application/json

{
  "data": { ... }, // Custom data - all the connected blocks data passed to the webhook
  "timestamp": 1713784015226, // Current Unix timestamp in milliseconds
  "hash": "generated_hash" // A SHA256 or HMAC SHA256 hash for authentication
}

How to validate the Webhook Request Authenticity? (Optional but Recommended)
When a secret is provided, an HMAC SHA256 hash is generated using that secret and the timestamp. This hash ensures the authenticity of the sender.

Validation Snippet with Secret:

import { createHmac } from 'crypto';

function validateWithSecret(requestBody, secret) {
  const { timestamp, hash } = requestBody;

  const expectedHash = createHmac('sha256', secret)
    .update(String(timestamp))
    .digest('hex');

  return expectedHash === hash;
}

Timestamp Validation (Optional but Recommended)
To guard against replay attacks:

  • Check that the timestamp is within 10 minutes (600,000 ms) of current server time.
  • Reject requests too old or too far in the future.
function isTimestampValid(timestamp) {
  const now = Date.now();
  return Math.abs(now - timestamp) <= 10 * 60 * 1000;
}