Skip to main content
Tokens are visual representations of CognigyScript expressions that you store and reuse in Cognigy.AI. Cognigy.AI has a selection of default Tokens that are associated with Input, Context, and Profile objects.
Tokens automatically include curly brackets in the script. For this reason, you don’t need to wrap the CognigyScript in the Script field or the Tokens in text fields with curly brackets.

Restrictions

  • Only Node text fields with the token icon support Tokens.

Working with Tokens

In Manage > Tokens, you can view, create, and delete Tokens as well as copy their Reference ID. Tokens include the following information:
  • Name — the Token name displayed in Nodes and the Token Management Menu.
  • Script — the CognigyScript expression used to access the data. You don’t need to wrap the CognigyScript expression in {{ }}.
  • Type — the category of the Token in the search list:
    • Input — access to the data in the Input object.
    • Context — access to the data in the Context object.
    • Profile — access to the data in the Profile object.
    • Custom — specific CognigyScript expression with access to the data in one or more Cognigy objects. For example, "Should your order " + context.customerOrderAmount + " be sent to " + profile.address + "?".
You can also create and use Tokens in the Node editor or create Tokens from JSON editors.
Deleting a Token doesn’t remove the CognigyScript from the Nodes that used the deleted Token.

Default Tokens

Cognigy.AI provides a selection of default tokens that you can readily use in your Flows.
TokenTypeDescriptionTarget path
AI Agent DescriptionInputThe description of the AI Agent, used to give context about the AI Agent’s role.context.ai.description
AI Agent Image URLInputThe URL of the AI Agent’s avatar.context.ai.imageUrl
AI Agent InstructionsInputSystem-level instructions used to guide the AI Agent’s behavior during conversations.context.ai.instructions
AI Agent Knowledge StoreInputThe Knowledge Store assigned to the AI Agent, used for answering questions based on external documents.context.ai.knowledgeStore
AI Agent NameInputThe display name of the AI Agent shown to users during conversations.context.ai.name
AI Agent OutputInputThe response sent by the AI Agent after processing the prompt and context.input.aiAgentOutput
AI Agent Reference IDInputThe unique ID of the AI Agent used internally to identify and reference the specific AI Agent configuration.context.ai.referenceId
AnswerInputDisplays the extracted Input. For example, if the user is asked for a number and the answer was I like the number 7 the extracted answer is 7.input.result
Available AgentsInputDisplays the current available agents in your system.input.availableAgents
ChannelInputDisplays the current used channel. For example, adminconsole.input.channel
Current Flow NameInputDisplays the current used Flow name.input.flowName
Current TimeInputDisplays the current time. For example, 2024-01-08T15:14:59+01:00input.currentTime.ISODate
DataInputDisplays the data payload of the message.input.data
ExecutionInputRepresents the number of processed Inputs for this conversation.
The first user message in a conversation has an execution value of 1, the second one has an execution value of 2, then 3 and so on.
input.execution
First Attachment URLInputAttachments are an array pointing to the URL of the first element.input.attachments[0].url
First Currency SlotInputArray pointing to input.slots.input.slots.MONEY[0].value
First Date SlotInputArray pointing to input.slots.input.slots.DATE[0].start.ISODate
First Email SlotInputArray pointing to input.slots.input.slots.EMAIL[0]
First Number SlotInputArray pointing to input.slots.input.slots.NUMBER[0]
First Percentage SlotInputArray pointing to input.slots.input.slots.PERCENTAGE[0]
Handover StatusInputNo data is displayed when handover is not defined.
Indicates status:
  • completed - the handover was finished by the agent.
  • cancelled - the user has cancelled the Handover request.
  • error - an error occurred when requesting the handover.
input.handover.status
Input IDInputDisplays the input ID of the last answer.input.inputId
IntentInputDisplays a recognized Intent when intents are defined.input.intent
Intent ScoreInputDisplays the score rate between 0 and 1 of a recognized intent.input.intentScore
KSearch:TopK TextsInputDisplays the output of the Knowledge Search Node to the user.input.knowledgeSearch?.topK?.map(result=>result?.text).join('')
LanguageInputDisplays the language code for the active NLU language. For example, en-US.input.language
Last Question ResultInputDisplays the extracted Input as the answer to an AI Agent question. For example, I want to order a pizza.input.result
LLM Prompt ResultInputThe response sent from the LLM, for example in the Search Extract Output or LLM Prompt Nodes.input.promptResult
Microsoft:SSO Request StatusInputUsed for Teams Single Sign-On (SSO). Indicates status:
  • pending - token just requested.
  • declined - token invalidated.
  • completed - SSO token received.
input.data.microsoftSsoPermissionRequest
Microsoft:SSO TokenInputThe Microsoft Graph API SSO token can be used for Graph API calls.input.data.microsoftSsoToken
ModeInputDisplays the type of the message. For example, Text only.input.mode
Session IDInputDisplays the unique session ID of your conversation.input.sessionId
StateInputDisplays the state. For example, default.input.state
TextInputDisplays the text you edited in the text field of a Node.input.text
TypeInputDisplays the type. For example, Statement.input.type
UnderstoodInputIndicates true/false.input.understood
URL TokenInputThe URL token of the Endpoint. The identifier after the last / in the Endpoint URL.input.URLToken
User IDInputDisplays the user ID.input.userId
VG: Caller CountryInputDisplays the caller’s country.input.data.numberMetaData.country
VG: Caller Country CodeInputDisplays the caller’s country code.input.data.numberMetaData.countryCallingCode
VG: Caller NumberInputDisplays the caller’s number.input.data.numberMetaData.number
VG: Caller Number TypeInputDisplays the caller’s number type.input.data.numberMetaData.type
VG: Caller URLInputDisplays the caller’s URL.input.data.numberMetaData.url
xApp PIN Page URLInputDisplays the PIN Page URL.input.apps.baseUrl
xApp Session PINInputDisplays the Session PIN.input.apps.session.pin
xApp Session URLInputDisplays the Session URL.input.apps.url[]
Short-Term MemoryContextDisplays the short-term memory of the conversation, as defined in the AI Agent Node settings.context.shortTermMemory
Accepted GDPRProfileIndicates true/false; means accepted / not accepted.profile.accepted_gdpr
AgeProfileDisplays the customer’s age.profile.age
BirthdayProfileDisplays the customer’s birthday.profile.birthday
Customer NumberProfileDisplays the customer number.profile.customerNumber
EmailProfileDisplays the customer’s email address.profile.email
First NameProfileDisplays the customer’s first name.profile.firstname
GenderProfileDisplays the customer’s gender.profile.gender
GoalsProfileDisplays the defined tasks.profile.tasks
Last NameProfileDisplays the customer’s last name.profile.lastname
LocationProfileDisplays the customer’s location.profile.location
Prevent Data CollectionProfileIndicates, if available, true/false; shows whether data collection is active or not.profile.prevent_data_collection
Profile PictureProfileContains the URL to a profile picture.profile.profilepic

Create and Use Tokens in the Node Editor

By clicking token in a text field, you open the Token list. You can search for a Token in the search field at the top or scroll through the Token types. To create a Token, click plus-transparent.

Create Tokens from JSON Editors

To create a Token from a JSON editor, right-click a CognigyScript expression and select Create Token from JSON Path. The selected CognigyScript expression is added to the Script field. If you highlight any code snippet and create a Token from the JSON path, the highlighted code is added to the Name field.

Example

The default Token named Text represents {{input.text}}. The following image shows the Text Token in a Node and the corresponding CognigyScript expression after it:
I