Substitution in instructions
Add the customer or project data the agent needs. Substitute a small value required for every reply. Keep data needed only occasionally as a reference for the agent to read when necessary.
Open the agent instructions.
Current dialog data
When a rule depends on the customer's name, phone number, or exact identifier, select the field under Lead data. For example, the Senler Lead ID and the user ID in the connected channel are different values.
System data is selected for the lead associated with the current event. If that event has no separate lead, the dialog's primary lead is used. In a group chat, the inserted value belongs to the current lead; it does not represent every participant at once.
Insert data into instructions
- Place the cursor at the required position in the agent instructions.
- Select
@below the editor and open Variables. - In the catalog, choose Project variables, Lead variables, Dialog variables, or Lead data.

- Find the field. Variable lists support search; Show more loads the next part of the list.
- In this catalog, select the field, then the insertion mode. A tag with the selected mode appears in the instructions.

Choose a mode
- Variable reference identifies the variable by name and data scope without supplying its contents. The agent can read the value with a tool when needed. For example, order history does not need to accompany a simple greeting. To let the agent save a result to this variable, separately allow reading and writing and describe what to save.
- Name and value supplies the current value and variable name immediately, without a separate tool read. The data is appended after the main instruction text; the variable identifier remains at the tag's position. When a variable is mentioned several times in this mode, its value is supplied once. This suits an order status or the customer's plan.
- Value only substitutes the current contents at the tag's position, without the variable name. For example: "Introduce yourself as a consultant for", followed by a tag containing the store name. If this tag appears several times, its value is repeated at each position. Choose this mode when the data should form part of a sentence and the variable name is unnecessary there.
Built-in lead data supports Name and value and Value only. Reading by reference applies to custom project, lead, and dialog variables.
To change the insertion mode, click the variable tag in the instructions.

Choose another option in the mode menu.

Current values are used when preparing a response. Changing a value does not require inserting the tag into the instructions again.
Costs and caching
Name and value and Value only send the contents to the model with the instructions, even when the reply does not need them. Large values consume more input tokens and can increase costs. If the data does not fit the selected model's context, the request fails instead of silently truncating the value.
For data that is not needed in every reply, use a reference: the agent can request a specific object field or a portion of text. Data returned by a tool also uses context, but is not supplied in advance merely because the tag is present.
Models that support caching may process a matching beginning of a request at a reduced cost. The substitution modes affect this differently:
- Name and value appends values after the main text. Changing a value does not change the text before that block, preserving a longer unchanged beginning of the request.
- Value only changes the text at the insertion point. If the value changes, content from that point onward may need processing without a cache discount. This matters especially when changing data appears near the beginning of long instructions. Manual
{{...}}templates behave the same way.
Preserving the same beginning does not guarantee caching: conditions depend on the model and its provider. Place fixed rules before changing data where possible. Check actual usage and the share of cached input tokens in credit history.
Conditions in the text
You can write a {{...}} template manually. For example, {{lead_data.first_name}} inserts the current lead's name, or an empty value when no name is available. This substitution requires no separate tool permission and grants no write access. Like Value only mode, the template inserts the value directly into the instruction text.
A {{#if ...}} block selects one of two instruction variants:
{{#if lead_data.first_name}}
Address the customer by name: {{lead_data.first_name}}.
{{else}}
First ask how to address the customer.
{{/if}}
In this example, a present name selects the first fragment, while a missing name selects the fragment after {{else}}. For other data types, note that the condition is also false for the number 0, the boolean false, an empty array [], an empty object {}, and a whitespace-only string. The string "0", in contrast, selects the first fragment.
Do not use this condition as a universal “value is set” check: a zero balance, for example, is a known value but selects the else branch. Replace the text in both branches with rules for your task.
System lead data
Lead data provides these fields. The table also shows the notation for manual substitution:
| Field | Inserted value |
|---|---|
{{lead_data.id}} |
Internal Senler Lead ID |
{{lead_data.first_name}} |
First name |
{{lead_data.last_name}} |
Last name |
{{lead_data.full_name}} |
Full name assembled from the available name fields |
{{lead_data.username}} |
Username in the channel, when available |
{{lead_data.email}} |
|
{{lead_data.phone}} |
Phone number |
{{lead_data.avatar_url}} |
Avatar URL |
{{lead_data.channel_id}} |
Internal connected channel ID |
{{lead_data.channel_type}} |
Channel type |
{{lead_data.external_user_id}} |
User ID on the channel side |
{{lead_data.language_code}} |
Lead language code |
{{lead_data.lead_source}} |
Lead creation source |
{{lead_data.lead_type}} |
Lead type |
{{lead_data.created_at}} |
Lead creation date and time |
{{lead_data.updated_at}} |
Lead last update date and time |
These fields come from the current lead card and are not created manually. Dates are inserted in a system format containing the date, time, and time zone. If a person needs a friendlier date, tell the agent how to display it.
For a manager notification, use {{lead_data.full_name}} for the client's name, {{lead_data.channel_type}} for the platform, and {{lead_data.channel_id}} for the internal Senler channel ID. The external user ID is in {{lead_data.external_user_id}} and belongs to the user's platform. When sending to another dialog, select the run's lead and dialog data so the notification contains the client's details, rather than the recipient's.
Instruction examples
Addressing the customer by name:
When the name is present, address the customer by name: {{lead_data.first_name}}.
Passing the correct identifier to an external tool:
When a tool requires the internal Senler Lead ID, use {{lead_data.id}}.
When it requires the channel user ID, use {{lead_data.external_user_id}}.
Do not substitute one identifier for the other.
Shared project data:
End the response with the current address: {{project.office_address}}.
A variable reference and a value substitution are different
Selecting a custom variable through @ grants read access in the agent draft in all three modes. If you later disable that permission, the tag is marked unavailable and does not supply the value. Removing the tag does not revoke the permission: check variable permissions.
Allow writing separately to let the agent change a value. Neither a tag nor a {{...}} template is an action by itself: describe when to use the data next to it. Check the result in testing, then publish the agent.