Skip to main content
Tools are JavaScript functions you create and manage in the Tools section of Connectly (/tools). Each tool is versioned, deployable, and reusable across multiple flows. Tools also automatically receive a public HTTPS URL you can use as a WhatsApp Flow data-exchange endpoint, with end-to-end encryption handled by Connectly.
For a full walkthrough of creating, authenticating, testing and publishing tools in the dashboard, see the Tools overview. This page focuses on the JavaScript tool code reference.

Tools section

The Tools section has four tabs:

Tool structure

Every tool exports a single onExecute function:

Parameters

input

Contains the current session context:
Campaign input variables β€” Variables sent with a campaign (e.g. name, id) are automatically available in input.sessionContext.variables. No extra setup required.
Example sessionContext.variables when a campaign is sent with custom variables:

config

Contains secrets configured for the tool:

Return value

Tools must return a tuple [data, outcome]:

Versioning and deployment

Tools support versioning. Use the version selector in the editor header to manage releases, and click Deploy to publish a new version. Previous versions remain available for rollback.

Testing tools

Each tool has a built-in Test panel on the right side of the editor. Paste a mock JSON payload into the input field and click Run Test to execute the tool and inspect the output and logs without triggering an actual campaign.

Tool URL as a WhatsApp Flow endpoint

Every tool is automatically assigned a public URL:
You can use this URL directly as the data-exchange endpoint for a WhatsApp Flow. Connectly handles E2E encryption transparently β€” no key management required in your tool code.

WhatsApp Flow handler example

WhatsApp Flows send an init action first, then data_exchange actions as the user navigates screens. Route on action and screen:
See WhatsApp Flow endpoints for the full data-exchange protocol.

Monitoring executions

The Executions tab shows a log of every tool call with filters for:
  • Tool β€” narrow to a specific tool
  • Status β€” filter by success or error
  • Time range β€” 15 min, 30 min, 1h, 6h, 1d, 2d, 3d, 7d, 15d, or custom
  • Execution ID / Session ID / Room ID β€” look up a specific call from a campaign run

Using a tool in a flow

In the Campaign Builder, add a Tool node and select the tool you want to call. Map the tool’s data output fields to session variables for use in downstream nodes.