# Flow’s Attributes

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

<figure><img src="/files/Bc2VIlLM3uXcByEB7PBk" alt=""><figcaption></figcaption></figure>

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.<br>

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](/ai-chatbots-and-automation/actions-explained/chatgpt-task.md) to generate a response in the user’s language.

<figure><img src="/files/jFtA39eOBeaymCgrfw21" alt=""><figcaption></figcaption></figure>

**Ask Knowledge Base**\
Another useful Action is [Ask Knowledge Base](/ai-chatbots-and-automation/actions-explained/ask-knowledge-base.md). It can use an Attribute like {{lastUserText}} to retrieve information from the Knowledge Base based on the user’s last question.

<figure><img src="/files/2SynANYOw3PxHVguiUK7" alt=""><figcaption></figcaption></figure>

**Capture user reply**\
This Action is handy when you want to [capture information from the user](/ai-chatbots-and-automation/actions-explained/capture-user-reply-action.md), 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](/ai-chatbots-and-automation/actions-explained/send-email.md).

<figure><img src="/files/hcInxjwyOYuvDOK6TOcN" alt=""><figcaption></figcaption></figure>

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](/ai-chatbots-and-automation/actions-explained/reply-action.md) 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.

<figure><img src="/files/Fe21noI4Sa7RWcVMpjrU" alt=""><figcaption></figcaption></figure>

#### **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.

<figure><img src="/files/EA4R8AbXBDfIescQIiwY" alt=""><figcaption></figcaption></figure>

**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.

<figure><img src="/files/ksEsiHyBS5mgMmcCAmZY" alt=""><figcaption></figcaption></figure>

#### **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.

<figure><img src="/files/gIkYF9S1h2bHPhWcWhjf" alt=""><figcaption></figcaption></figure>

#### **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.

<figure><img src="/files/DJU5k3FciBv4YviBCOIS" alt=""><figcaption></figcaption></figure>

#### **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.”

<figure><img src="/files/GmjKLruC1MmwSTz1K6Zd" alt=""><figcaption></figcaption></figure>

#### **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.

<figure><img src="/files/PeRYJMsk1nYNHhzw26fJ" alt=""><figcaption></figcaption></figure>

**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.

<figure><img src="/files/R0WWPeFBncx7HuBoVyy1" alt=""><figcaption></figcaption></figure>

**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**.

<figure><img src="/files/YHpu1xjTWipkRCrmsBxZ" alt=""><figcaption></figcaption></figure>

**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.

<figure><img src="/files/2KCHimiIsibC1Jm2abq3" alt=""><figcaption></figcaption></figure>

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

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.tiledesk.com/ai-chatbots-and-automation/visual-builder-101/flows-attributes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
