Skip to main content

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:

TriggerDescriptionAssigned to current_user
Agent as toolTriggered by another agent as a tool.The current_user of the triggering agent.
Agent block in custom toolTriggered by another agent as a block in a custom tool.The current_user of the triggering agent.
AppTriggered by the Agent Chat component.The current_user of the app. More information.
WorkflowTriggered by an Agent block in a workflow.The current_user of the workflow, which is an admin user. More information.
ChatTriggered by the Chat tab in Retool Agents.The user of the chat.
Email trigger from known userTriggered by an email from a Retool user with access to the agent.The Retool user who sent the email.
Email trigger from unknown emailTriggered 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, the current_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.

email

The email address.

Type string
Format Email Address
Configurability Read-only
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

firstName

The first name.

Type string
Format Plain Text
Configurability Read-only
Examples
"Jenny"

fullName

The full name.

Type string
Format Plain Text
Configurability Read-only
Examples
"Jenny Appleseed"

groups

A list of assigned permission groups.

Type array
Array values object
Configurability Read-only
Array Object Properties

id

The group ID.

Type string
FormatUUID
Configurability Read-only

name

The group name.

Type string
FormatUUID
Configurability Read-only

Examples
{
"id": "1234567890",
"name": "admin"
},
{
"id": "9876543210",
"name": "All users"
}

lastName

The last name.

Type string
Format Plain Text
Configurability Read-only
Examples
"Appleseed"

locale

The locale.

Type string
Format Plain Text
Configurability Read-only
Examples
"en"

metadata

Relevant metadata for the item.

Type array
Array values object
Configurability Read-only

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

sid

The unique, non-sequential ID.

Type string
FormatUUID
Configurability Read-only
Examples
"user_366e154sdfg34b9bdeds32936"