The Current User object
Information about the current user of the agent.
The current_user
object can be populated with the details of an admin user or the currently authenticated user. The assignment of the current_user
object depends on how the agent is invoked. In general, the current_user
is assigned to the currently authenticated user. However, when you trigger an agent from a workflow, use a workflow as a tool, or trigger an agent by an unknown email, the current_user
is populated as an admin user.
Refer to the following table for more information about who is assigned to the current_user
role:
Trigger | Description | Assigned to current_user |
---|---|---|
Agent as tool | Triggered by another agent as a tool. | The current_user of the triggering agent. |
Agent block in custom tool | Triggered by another agent as a block in a custom tool. | The current_user of the triggering agent. |
App | Triggered by the Agent Chat component. | The current_user of the app. More information. |
Workflow | Triggered by an Agent block in a workflow. | The current_user of the workflow, which is an admin user. More information. |
Chat | Triggered by the Chat tab in Retool Agents. | The user of the chat. |
Email trigger from known user | Triggered by an email from a Retool user with access to the agent. | The Retool user who sent the email. |
Email trigger from unknown email | Triggered by an email that cannot be matched with a Retool user who has access to the agent. | An admin user. |
Reference the following examples:
- A workflow uses the Invoke Agent block to call an agent named Vacation Plan, and Vacation Plan calls another agent named Get Weather. The
current_user
of the workflow is an admin user. Therefore, thecurrent_user
objects of Vacation Plan and Get Weather are both also populated with an admin user. - An agent called Marketing Assistant is called using the Agent Chat app component. Marketing Assistant calls another agent named Discount Decider. The
current_user
of Marketing Assistant and Discount Decider are both populated with the app's authenticated user.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
Examples
jenny@example.com
externalIdentifier
The external identifier. This value is null
if you are not using API-based authentication.
Type | string |
Configurability | Read-only |
Examples
"Jenny"
Examples
"Jenny Appleseed"
Array Object Properties
Examples
{
"id": "1234567890",
"name": "admin"
},
{
"id": "9876543210",
"name": "All users"
}
Examples
"Appleseed"
Examples
"en"
profilePhotoUrl
The profile photo URL. Available when using SSO authentication and is supplied by the IdP (Identity Provider).
Type | string |
Format | URL |
Configurability | Read-only |
Examples
https://example.com/photo.jpg
Examples
"user_366e154sdfg34b9bdeds32936"