> For the complete documentation index, see [llms.txt](https://docs.appfarm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.appfarm.io/library/action-nodes/create-user-account.md).

# Create user account

The Create user account action node creates a new [user](https://docs.appfarm.io/reference/security/users.md) in the solution or can optionally update an existing user. [Roles](https://docs.appfarm.io/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.

{% hint style="info" %}
Showroom: [Create user account example](https://showroom.appfarm.app/action-nodes/create-user), with its setup in Appfarm Create ([register](https://showroom.appfarm.app/sign-up) for access).
{% endhint %}

## 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 **Allow existing** 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](https://docs.appfarm.io/reference/security/users.md#permissions).
* The appropriate user account manipulation properties must be enabled for the relevant [environment](https://docs.appfarm.io/reference/configuration/environments.md#user-account-manipulation).
  {% endhint %}

{% hint style="warning" %}
**Important: public sign-up apps**

If the action node runs in an app where people sign themselves up:

* Never assign privileged roles in **Role memberships**.
* Don't combine **Allow existing** with **Update details** or **Add roles**. Anyone who knows an email address could then change that user.
* Keep **Link TTL** short. The link in the welcome email logs the user in.
* Don't put text the user entered in **Subject**, **Body text** or **Body HTML**.
  {% endhint %}

## Properties

<table><thead><tr><th width="225">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Skip in Dev/Test</strong></td><td>When selected, the action node is skipped when it runs on development data (the Development and Test environments), so no user accounts are created while you build and test.</td></tr><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>Allow existing</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 number</strong></td><td>The user's phone number.</td></tr><tr><td><strong>Role memberships</strong></td><td>The <a href="https://docs.appfarm.io/reference/security/roles.md">roles</a> that the user should be a member of.</td></tr><tr><td><strong>Allow existing</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</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 details</strong></td><td><em>Available if</em> <strong>Allow existing</strong> <em>is selected.</em><br>Update an existing user with the <strong>First name</strong>, <strong>Last name</strong>, and <strong>Phone number</strong> values.</td></tr><tr><td><strong>Add roles</strong></td><td><em>Available if</em> <strong>Allow existing</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</strong></td><td>Add the User object to the selected <a href="https://docs.appfarm.io/reference/apps/data/data-sources.md">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="https://docs.appfarm.io/reference/configuration/login.md#mail-templates">Login configuration</a>, or overridden for this action node only by selecting <strong>Custom welcome mail</strong>.</td></tr><tr><td><strong>Custom welcome mail</strong></td><td><p><em>Available if</em> <strong>Send welcome mail</strong> <em>is selected.</em></p><p>Override the subject and body of the welcome email.</p></td></tr><tr><td><strong>Link TTL</strong></td><td><p><em>Available if</em> <strong>Custom welcome mail</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>Redirect path</strong></td><td><em>Available if</em> <strong>Custom welcome mail</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>Custom welcome mail</strong> <em>is selected.</em><br>Override the subject of the welcome email.</td></tr><tr><td><strong>Body text</strong></td><td><em>Available if</em> <strong>Custom welcome mail</strong> <em>is selected.</em><br>Override the plain text email body. See <a href="https://docs.appfarm.io/reference/configuration/login.md#mail-templates">Login configuration</a> for available parameters.</td></tr><tr><td><strong>Body HTML</strong></td><td><em>Available if</em> <strong>Custom welcome mail</strong> <em>is selected.</em><br>Override the HTML email body. See <a href="https://docs.appfarm.io/reference/configuration/login.md#mail-templates">Login configuration</a> for available parameters. A <strong>Body text</strong> is also required when you specify an HTML template.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.appfarm.io/library/action-nodes/create-user-account.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
