Skip to main content

The Current User object

You can reference the current_user object when a workflow is manually run from the workflow IDE or triggered from a classic app by a user. The evaluated current_user in workflows is an admin in your organization's instance or space. This differs from classic apps and agents, where the current_user is evaluated as the current, logged-in user. Unless a workflow has a service user, workflows are run as an admin role to ensure that when workflows are run without access to the current, logged-in user (such as when triggered by schedule or webhook), sufficient access to any resource on the control flow is guaranteed.

Change the current user​

By default, current_user in a workflow is an admin. You can change which user current_user represents in the following ways:

When a workflow has a run identity and a schedule, webhook, query, Retool Event, or publicly shared app trigger starts a run, current_user is the workflow's service user instead of an admin. Child workflows that the run calls use the same service user.

A service user isn't a person, so email, firstName, lastName, and sid are null. The fullName property holds the service user's name, groups contains the service user's group, and metadata contains your organization's default user attribute values. Refer to Service users for workflows for more information.

Runs that don't use a service user behave as described at the top of this page.

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
Defaultnull
Examples
falsejenny@example.com

externalIdentifier​

The external identifier. This value is null if you are not using API-based authentication.

Type string
Configurability Read-only
Defaultnull

firstName​

The first name.

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

fullName​

The full name.

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

groups​

A list of assigned permission groups.

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

id​

The group ID.

Type string
FormatUUID
Configurability Read-only
Defaultnull

name​

The group name.

Type string
FormatUUID
Configurability Read-only
Defaultnull

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

lastName​

The last name.

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

locale​

The locale.

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

metadata​

Relevant metadata for the item.

Type array
Array values object
Configurability Read-only
Defaultnull

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
Defaultnull
Examples
falsehttps://example.com/photo.jpg

sid​

The unique, non-sequential ID.

Type string
FormatUUID
Configurability Read-only
Defaultnull
Examples
false"user_366e154sdfg34b9bdeds32936"