ruLog in to Senler

Data and variables in an agent

Summary

Agent instructions can use four kinds of data:

  • lead data — built-in fields of the current customer, such as ID, name, phone, channel, and other fields from the lead card;
  • lead variables — custom project fields that store a separate value for each customer, such as city or order status;
  • dialog variables — fields of one conversation, such as the deal being discussed; another dialog with the same customer can have a different value;
  • project variables — one value shared by the whole project, such as an office address or current promotion code.

Choose Agents in the left menu, find the agent in the list, and open its settings.

  • Insertion modes let you supply a value immediately or leave it for the agent to read when needed. Choose the mode through @ → Variables in the instructions.
  • Variable permissions determine which fields the agent can independently read or change during a dialog. Configure them on the Tools tab.
  • Updating variables with an agent lets the agent save customer answers and update counters and lists according to its instructions.

Open @ → Variables. The catalog separates built-in lead data and custom variables by scope.

Data and variables in an agent. 1. catalog
1. catalog

A project, lead, or dialog variable can be created from its section of the @ catalog when the member has creation permission. A reference to it appears in the instructions after creation. The field is created immediately and remains in the project even if you later cancel the agent setup.

Project variables

Project variables store shared persistent information: plans, links, rules, contacts, addresses, promotion codes, or legal terms. The value of {{project.variable_name}} is the same in every project dialog.

Lead variables

Lead variables store custom data for one customer: city, segment, order status, interest, most recent product, or next contact date. The value of {{lead.variable_name}} comes from the current lead.

Dialog variables

A dialog variable stores a value for the current conversation. For example, {{dialog.deal_id}} inserts the ID of the deal being discussed here. The value persists between agent replies and automation runs but is not automatically copied to another conversation with the same customer.

In a group dialog, the field belongs to the whole conversation. Use lead variables for a participant's personal data. See dialog variable settings for creation and dialog information for manual editing.

Check and publish the changes

  1. Wait for the agent draft to save after changing instructions or permissions.
  2. Test the agent: ask a question that requires the selected field and check the result. If writing is allowed, use sample data — the test may change it.
  3. When the result is satisfactory, publish the new version. Saving the variables dialog does not update the published agent on its own.

For a substitution, try {{dialog.deal_id}}: first fill in the deal number in the intended dialog, then send a question about the deal number in the same conversation. Another dialog may not have that value. When testing in a separate conversation, check its own data.