The Current User object
Information about the current logged-in or authenticated user.
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:
- Service user
- Current user
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.
There is a public beta feature that allows your organization to run workflows as the logged-in user when workflows are manually run from the workflow IDE or triggered from a classic app by a user. Please be aware that, even with this beta feature activated, any workflow invoked via a webhook, query, or classic app trigger or by another workflow still assigns current_user as an admin user, unless the workflow has a service user and a schedule, webhook, or query trigger starts the run.
To set the current_user to null on automatic workflow run, reach out to your account manager.
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
falsejenny@example.com
externalIdentifier
The external identifier. This value is null if you are not using API-based authentication.
| Type | string |
| Configurability | Read-only |
| Default | null |
Examples
false"Jenny"
Examples
false"Jenny Appleseed"
groups
A list of assigned permission groups.
| Type | array |
| Array values | object |
| Configurability | Read-only |
| Default | null |
Array Object Properties
Examples
false{
"id": "1234567890",
"name": "admin"
},
{
"id": "9876543210",
"name": "All users"
}
Examples
false"Appleseed"
Examples
false"en"
metadata
Relevant metadata for the item.
| Type | array |
| Array values | object |
| Configurability | Read-only |
| Default | null |
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 |
| Default | null |
Examples
falsehttps://example.com/photo.jpg
Examples
false"user_366e154sdfg34b9bdeds32936"