# Create user account

The Create user account action node creates a new [user](/reference/security/users.md) in the solution or can optionally update an existing user. [Roles](/reference/security/roles.md) can be assigned to determine the user's permissions. A welcome email can be automatically triggered, enabling the user to login immediately.

## Usage

This action node is used when you would like client users to be able to give other people access to the apps in a solution. For example, a client user with a custom *Administrator* role may be granted the permission to add users with a *Coordinator* role.

Users in a solution must have unique email addresses. The default behavior of Create user account is to throw an error (UserAccountAlreadyExistException: Appfarm error code 14007) when run with an email that is already assigned to user in the solution. To allow existing users, and optionally update their User object, select the **Accept Existing User** checkbox.

When the action node successfully completes, the User object is immediately created in the database. It is not necessary to persist any changes.

{% hint style="warning" %}
**Important**

* The user running this action node must have a role with the appropriate permissions to create a new user and assign any selected role. Read more under [Users](/reference/security/users.md#permissions).
* The appropriate user account manipulation properties must be enabled for the relevant [environment](/reference/configuration/environments.md#user-account-manipulation).
  {% endhint %}

## Properties

<table><thead><tr><th width="225">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Email</strong></td><td>The user's email address. Must be unique in the solution. If the email is already registered in the solution and <strong>Accept Existing User</strong> is not selected, the action node will fail.</td></tr><tr><td><strong>First Name</strong></td><td>The user's first name.</td></tr><tr><td><strong>Last Name</strong></td><td>The user's last name.</td></tr><tr><td><strong>Phone</strong></td><td>The user's phone number.</td></tr><tr><td><strong>Role Memberships</strong></td><td>The <a href="/pages/-MiQU63VSfRMAmQC-Y_w">roles</a> that the user should be a member of.</td></tr><tr><td><strong>Accept Existing User</strong></td><td>Run the action node even if a user with the specified <strong>Email</strong> already exists in the solution. If this property is not selected and the user does already exist, the action node will fail. See <a href="#usage">Usage</a> for more information.<br><br>If <strong>Add to Data Source</strong> is configured, the User object will be added there. The welcome email will <em>not</em> be sent, even if <strong>Send Welcome Mail</strong> is selected.</td></tr><tr><td><strong>Update User Properties</strong></td><td><em>Available if</em> <strong>Accept Existing User</strong> <em>is selected.</em><br>Update an existing user with the <strong>First Name</strong>, <strong>Last Name</strong>, and <strong>Phone</strong> values.</td></tr><tr><td><strong>Add Roles</strong></td><td><em>Available if</em> <strong>Accept Existing User</strong> <em>is selected.</em><br>Add the roles selected under <strong>Role Memberships</strong> to an existing user.</td></tr><tr><td><strong>Add to Data Source</strong></td><td>Add the User object to the selected <a href="/pages/-MiR9-S9HfgyfS92rP2V">data source</a>. If the data source is many-cardinality, the object will be added. If the data source is single-cardinality, the object will replace any existing object.</td></tr><tr><td><strong>Send Welcome Mail</strong></td><td>Send an email with a login link. This email template can be customized in a <a href="/pages/-MiQTkrEGdaj-5fd-poz#mail-templates">Login configuration</a>, or overridden for this action node only by selecting <strong>Override Welcome Mail</strong>.</td></tr><tr><td><strong>Override Welcome Mail</strong></td><td><p><em>Available if</em> <strong>Send Welcome Email</strong> <em>is selected.</em></p><p>Override the subject and body of the welcome email.</p></td></tr><tr><td><strong>Password Link TTL</strong></td><td><p><em>Available if</em> <strong>Override Welcome Email</strong> <em>is selected.</em></p><p>Specify how long the reset password or login link in the welcome email will be valid, in seconds, up to a maximum of 1 week. The default is 86,400 seconds (24 hours).</p></td></tr><tr><td><strong>Login Link Redirect Path</strong></td><td><em>Available if</em> <strong>Override Welcome Email</strong> <em>is selected.</em><br>Redirect the user to the specified path after they click the login link. The path must start at the domain root, for example: <code>/READABLE_ID/VIEW_NAME/SUBVIEW_NAME?URL_PARAM=value</code>.</td></tr><tr><td><strong>Subject</strong></td><td><em>Available if</em> <strong>Override Welcome Email</strong> <em>is selected.</em><br>Override the subject of the welcome email.</td></tr><tr><td><strong>Body Text Template</strong></td><td><em>Available if</em> <strong>Override Welcome Email</strong> <em>is selected.</em><br>Override the plain text email body. See <a href="/pages/-MiQTkrEGdaj-5fd-poz#mail-templates">Login configuration</a> for available parameters.</td></tr><tr><td><strong>Body HTML Template</strong></td><td><em>Available if</em> <strong>Override Welcome Email</strong> <em>is selected.</em><br>Override the HTML email body. See <a href="/pages/-MiQTkrEGdaj-5fd-poz#mail-templates">Login configuration</a> for available parameters. A <strong>Body Text Template</strong> is also required when you specify an HTML template.</td></tr></tbody></table>


---

# 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://docs.appfarm.io/library/action-nodes/create-user-account.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.
