Skip to main content
Custom variables let you write an assistant once and personalize every call. Instead of hard-coding a name, an appointment, or an account number into the system prompt, you reference a placeholder like {{customer_name}} and supply the value per call — from your API request, a campaign lead, an inbound enrichment webhook, or the platform’s built-in system context.

Reference syntax

Reference a variable with double braces — the preferred, JSON-safe form:
The legacy single-brace form {customer_name} is also resolved, but only for keys that are actually known (a defined or system variable). This keeps literal braces — for example JSON in a tool body — intact. Any placeholder whose key is unknown is left untouched.

Defining variables on an assistant

Each assistant carries a list of variable definitions. A definition has:
Keys are validated on save: invalid format, a collision with a reserved system variable, a duplicate key, or a missing label are all rejected.

Where variables are substituted

Values are substituted at call start, before the model or flow runs, in these fields:
  • Assistant system prompt
  • Assistant first message (greeting)
  • Flow node start.greeting
  • Flow node agent.instructions
  • Flow tool node request URL and header values
So a tool node can call https://app.famulor.de/api/user/orders/{{order_id}} or send Authorization: Bearer {{api_token}} with per-call values.

Value sources & precedence

A value can arrive from several places. At call start the worker resolves each key with this precedence, highest first:
  1. Explicit — values passed with the call: API make-call variables, or a campaign lead’s custom fields mapped onto matching keys.
  2. Inbound variable-webhook — enrichment fetched at call start (see below).
  3. System variables — filled by the platform from call context.
  4. Default — the definition’s default_value.
A placeholder with no value at any level is left as-is.

Explicit values via the API

Campaign leads → variables

In a campaign, each lead carries free-form custom fields (leads.custom_fields). At dial time, a lead’s custom field is mapped onto a variable with the same key. So a CSV column becomes a variable:
Here the customer_name and appointment_date columns populate {{customer_name}} and {{appointment_date}} for each call. Give a lead-sourced variable source: "lead" to document the intent.

System variables

These keys are always available and filled by the worker at call start. They are reserved — you cannot define a custom variable with one of these keys.

Inbound variable-webhook

For inbound calls you often don’t know the caller in advance. Configure a variable-webhook on the assistant (variable_webhook_url + variable_webhook_secret) and the worker calls it at call start to enrich variables — for example, looking up a customer by their caller number.

Request

The worker sends a POST with a JSON body:
The raw request body is signed with HMAC-SHA256 using the assistant’s variable_webhook_secret, sent in the header:

Response

Return the variables to merge:
These values merge over system variables and defaults, but under any explicit dispatch values. The call is timed out at ~5s; a failure is non-fatal — the worker logs it and continues with the values it already has.

Native automation (alternative)

Instead of a custom variable_webhook_url, you can create an Automation with trigger Inject input variables (call.variables) bound to the assistant. At call start the worker runs that automation synchronously and expects a Return variables action (same { variables: {…} } shape). If no matching active automation exists, the classic webhook URL is used as fallback.

Verifying the signature

Always compute the HMAC over the raw request body bytes, not over a re-serialized object — re-serialization can change whitespace or key order and break the signature. Use a constant-time comparison.

Example request

API & MCP

  • GET /v1/assistants/{id}/variables — read the assistant’s variable definitions; scope assistants:read.
  • PATCH /v1/assistants/{id}/variables — replace the variable definitions; scope assistants:write.
  • MCP tools: get_assistant_variables, set_assistant_variables.
Full REST reference lives at docs.famulor.io. Use {{key}} everywhere you want a per-call value, keep keys snake_case, and give every variable a sensible default_value so calls degrade gracefully when a source is missing.