Campaign smart functions
Reading contact metadata and storing the call result from the conversation flow.
Two smart functions connect the conversation flow with the campaign. Add them in a Function node (or the Start node) via Smart functions > Add smart function, and store their output in a variable.
Get campaign call metadata (get_campaign_call_metadata)
Load the contact's data (metadata) at the beginning of the call.
Update campaign call result (update_campaign_call_result)
Save the result of the call and decide whether the contact is called again.
Both functions work only in conversations started by a campaign (or in a call-back from a campaign contact, see below).
get_campaign_call_metadata
Returns the campaign record of the contact, including all columns from the uploaded file.

Phone number (phone_number)
yes
The contact's phone number. On an outbound call it is available in the PhoneNumber variable.
Number of days for user callback (days)
no
Default 2. See Call-backs below.
Output - stored e.g. in the variable campaign_call:
The uploaded columns are under metadata > metadata. Read them into separate variables, e.g.:
New variable name:
first_nameNew variable value:campaign_call["metadata"]["metadata"]["first_name"]
and use them in messages: "Good morning {first_name}, I am calling about contract {contract_id}."
Other useful fields: attempt (which attempt this is - e.g. a different greeting on a repeated call) and status (result of the previous attempt).

Call-backs
When a contact misses the call and calls back to the voicebot number, the inbound conversation has no campaign link. The function then searches the caller's conversations from the last days days (within the same organisation) and, if it finds the campaign call, returns its data. The flow can then finish the original task and save the result with update_campaign_call_result - a successful result also marks the contact as Processed.
update_campaign_call_result
Saves the result of the call to the campaign.

Status (status)
yes
Final status of the call, e.g. interested, not-interested, callback-requested, busy.
Call metadata (metaData)
no
Dictionary with data to store with the call, e.g. {"agreed": "yes", "preferred_date": "2026-10-20"}. The values also become variables in the conversation.
Custom retry delay (min) (custom_retry_delay)
no
Minutes until the next attempt for this contact - overrides the campaign setting for this one retry. Used only when the status is unsuccessful.
What the status does
Status listed in the campaign's Statuses, or
busy/no-answer/disconnected→ unsuccessful: the contact is called again (or moved to Failed if no attempts are left).Any other status → success: the contact is moved to Processed.
Output - a text message:
200 - Successfully updated
The result was saved.
501 - Metadata was updated but status_callback_url was not provided
The conversation is not a campaign call - only the variables were updated.
500 - Error while updating call ...
The result could not be saved.

Last updated
Was this helpful?