Skip to main content
A custom function can fire a pre-call webhook — a notification sent to a URL of your choice before the tool’s main API call runs. A common use case is a tool that transfers the call, where your system needs to receive the transfer reason before the transfer happens.
The pre-call webhook is fire-and-forget. A slow or failing webhook endpoint never blocks or fails the function call itself.
The built-in Transfer Call tool supports the same pre-call webhook fields, fired before the transfer happens.

How it works

1

LLM decides to call the tool

The LLM produces the arguments for your custom function as usual.
2

Bolna fires the pre-call webhook

If the tool has a pre_call_webhook_param configured, Bolna first POSTs the pre-call webhook to the resolved URL.
3

The main API call runs

The tool’s main function call then executes exactly as it normally would.

Configuring the webhook body

pre_call_webhook_param is a JSON template that is completely independent from the tool’s main param. You can reference any argument the LLM produced for the tool using the same %(field)s substitution syntax used by param. Static values are passed through as-is.
In the example above, %(reason)s is replaced with the LLM’s argument for this tool call, while "channel": "voice" is a static value passed through unchanged.

What your endpoint receives

The webhook body is the same execution record you receive on the post-call execution webhook (execution id, agent id, telephony details, status, etc.), merged with the fields from your pre_call_webhook_param:
Because the call is still in progress when the pre-call webhook fires, fields that are only finalized at call end (transcript, cost, summary) won’t be complete yet.

URL resolution rules

pre_call_webhook_param is the master switch. If it is not set, no pre-call webhook fires — even if pre_call_webhook_url is configured. The agent’s normal post-call webhook is unaffected.
Agent-level URL fallback: when pre_call_webhook_param is set without a pre_call_webhook_url, the pre-call webhook is sent to your agent’s configured Webhook URL. If you already use that endpoint for post-call execution webhooks, it will now also receive pre-call webhooks. Distinguish them by the in-progress status and the extra fields from your pre_call_webhook_param.

UI configuration

In the agent dashboard, the custom tool configuration (on the Tools Tab) has two optional inputs that map to these fields:
  • Pre-call webhook URL — the endpoint to notify (pre_call_webhook_url).
  • Pre-call webhook parameters — the JSON body template with %(field)s substitution (pre_call_webhook_param).
Both save with the tool and round-trip on edit.