/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 singleonExecute function:
Parameters
input
Contains the current session context:
Campaign input variables β Variables sent with a campaign (e.g. Example
name, id) are automatically available in input.sessionContext.variables. No extra setup required.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:WhatsApp Flow handler example
WhatsApp Flows send aninit action first, then data_exchange actions as the user navigates screens. Route on action and screen:
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βsdata output fields to session variables for use in downstream nodes.
