Flow’s Attributes

Attributes are a key part of your automations. They allow you to store information temporarily and reuse it across your workflows.

With Attributes, your AI Agent can capture data such as user input, phone numbers, or order IDs, and then use this information to deliver personalized and context-aware responses. Attributes can also be passed between different AI Agents, enabling more advanced, connected automations.

In this tutorial, we’ll explore how Attributes work and how you can use them to build smarter, more engaging AI workflows.

Attributes can be used in many different Actions. Here are some examples:

Chatgpt task This Action brings the power of ChatGPT into your Flow. One use case is using an Attribute called {{user_language}} in the ChatGPT Task to generate a response in the user’s language.

Ask Knowledge Base Another useful Action is Ask Knowledge Base. It can use an Attribute like {{lastUserText}} to retrieve information from the Knowledge Base based on the user’s last question.

Capture user reply This Action is handy when you want to capture information from the user, for example their email address. The conversation pauses until the user replies, and the value is stored in an Attribute such as {{UserEmail}}. Later, you can reuse UserEmail in other Actions, for instance to send a message or dispatch an email.

There are many more examples.

Now let’s take a closer look at the categories of Attributes:

  1. User defined attributes

  2. Most used attributes

  3. System defined attributes

  4. Uploaded documents attributes

  5. Uploaded image attributes

  6. Lead attributes

  7. Dynamic attributes

User defined attributes

User defined attributes are especially useful when you need to collect user data or receive data from external web services (for example, Web Requests or ChatGPT tasks).

You can create a user defined attribute by clicking the {} icon, available wherever attributes can be used. For example, you can open a Reply Action and click the {} icon in the lower right corner of the text box to define a new attribute.

From there, you can select one of the attributes listed under the User defined section. In this example, we’ll use gpt_reply.

This means the response generated by the Chatgpt task will be stored in the gpt_reply attribute. Then, by using a Reply Action, the content of gpt_reply can be sent back to the user.

Most used attributes

The Most used category contains special attributes that are frequently applied in conversations.

  • lastUserText (String) The last text entered by the user. This value is overwritten each time the user replies.

  • user_country (String) The user’s country, as detected by Tiledesk.

  • user_city (String) The user’s city, as detected by Tiledesk.

  • user_language (String) The user’s language, detected from the user’s browser settings.

  • transcript (String) The full transcript of all messages exchanged with the AI Agent during the conversation.

System defined attributes These are attributes automatically provided by Tiledesk during a conversation:

  • department_name (String) The name of the department where the AI Agent is active.

  • department_id (String) The ID of the department where the AI Agent is active.

  • project_id (String) The ID of the project the AI Agent belongs to.

  • last_message_id (String) The unique ID of the last message sent.

  • conversation_id (String) The unique ID of the conversation.

  • chatbot_name (String) The name of the AI Agent.

  • chatbot_token (String) A token you can use to invoke Tiledesk APIs. This token is continuously renewed during the Flow, and each token expires 4 hours after being issued.

  • user_id (String) The unique ID of the user in the Tiledesk database.

  • user_agent (String) The web user agent of the device where the conversation started.

  • chatChannel (String) The channel of the conversation, e.g. web, whatsapp, facebook, telegram.

  • user_source_page (String) The page where the conversation is running. Available only on the web channel.

  • chat_url (String) The URL of the chat, which you can share with a colleague. Use the Invite human Action to invite a human agent to this chat.

  • user_ip_address (String) The user’s IP address, when available.

  • ticketId (String) The ticket ID automatically assigned to each conversation.

Uploaded documents attributes

These attributes are available when a user uploads a document during a conversation:

  • lastUserDocumentAsAttachmentURL (String) The public URL to access the uploaded document as an attachment. Empty if no document is uploaded. Use this attribute to provide a download link for end-users. The URL expires after 5 minutes.

  • lastUserDocumentURL (String) The public URL to access the uploaded document. Empty if no document is uploaded. The URL expires after 5 minutes.

  • lastUserDocumentName (String) The name of the uploaded document. Empty if no document is uploaded.

  • lastUserDocumentType (String) The type of the uploaded document. Empty if no document is uploaded.

Uploaded image attributes

These attributes are available when a user uploads an image during a conversation:

  • lastUserImageURL (String) The public URL to access the uploaded image. Empty if no image is uploaded. The URL expires after 5 minutes.

  • lastUserImageName (String) The name of the uploaded image. Empty if no image is uploaded.

  • lastUserImageType (String) The type of the uploaded image. Empty if no image is uploaded.

  • lastUserImageHeight (String) The height in pixels of the uploaded image. Empty if no image is uploaded.

  • lastUserImageWidth (String) The width in pixels of the uploaded image. Empty if no image is uploaded.

Lead info attributes

These attributes provide information about the user stored in Tiledesk Contacts or passed through authentication:

  • currentPhoneNumber (String) The phone number used in the current conversation (for example from WhatsApp or SMS channels).

  • userPhone (String) The user’s phone number stored in Tiledesk Contacts.

  • userEmail (String) The user’s email stored in Tiledesk Contacts.

  • userLeadId (String) The contact ID of the user in Tiledesk Contacts.

  • userCompany (String) The company name of the user in Tiledesk Contacts.

  • userFullname (String) The full name of the user in Tiledesk Contacts.

  • decodedCustomJWT (JSON) The JWT used by the user to authenticate with Custom (Strong) authentication. To display the decoded JWT JSON, use the LiquidJS syntax to stringify the object.

    Example:

{
    "iat": 1727252***,
    "sub": "userexternal",
    "aud": "https://tiledesk.com/projects/6406e34727b57500120b1***",
    "_id": "6406e34727b57500120b1bd6_745408***",
    "firstname": "Andrew",
    "lastname": "Flavor",
    "email": "**@***.us",
    "profile": "Admin",
    "classified": "true",
    "id": "6406e34727b57500120b3bd8_745408***",
    "fullName": "Andrew Flavor"
}
  • strongAuthenticated (String) Indicates if the user authenticated with Custom (Strong) authentication. Values are “true” or “false.”

Dynamic attributes

These attributes are generated dynamically during the conversation:

  • timestamp (Number) The current timestamp in milliseconds (Number format).

  • now (ISO date) The current date in ISODate format, for example: 2024-09-25T10:14:41.638Z (String format).

  • UUID (String) A dynamically generated UUID based on UUIDv4, with dashes removed.

  • UUIDv4 (String) A dynamically generated standard UUIDv4.

Creating a new attribute

You can also create a completely new attribute to use in your workflows. Follow these steps:

  1. Click on the { } icon.

  2. At the bottom of the page, click on + Add a custom attribute. (image)

  3. A pop-up window will appear where you can define the name of your new attribute.

  4. Once created, the attribute will be available and ready to use in your Flows.

Set Attributes and Delete Attributes

Both of these Actions are available under Flow actions and are directly related to managing Attributes.

Set Attributes This Action is useful when you want to assign a value to an Attribute, whether dynamic or static. For example:

  1. You can ask a Chatgpt task to extract a tracking code from the conversation transcript.

  2. The result is stored in the Attribute gpt_reply.

  3. Using Set Attributes, you can then save this value into a new Attribute you created earlier, such as TrackingID.

Delete Attributes This Action allows you to remove the value of an Attribute. It’s helpful when you no longer need certain data in your Flow and want to clear it.

With Attributes, you can store, update, and manage data across your Flows, making your AI Agents more dynamic and personalized.

By combining Actions like Set Attributes and Delete Attributes, you gain full control over how information is captured, reused, or cleared, giving you the flexibility to build smarter automations.

Last updated