# Accounts and people

GoRunner knows your customers and their people by your ids, and makes each one the first time a login code names it.

| In your app | In GoRunner | Made by |
| --- | --- | --- |
| A customer | An **account**: its own organization, with a default workspace, its own data, encryption key and audit log. | The first login code that names it, or [Create or update an account](https://docs.gorunner.io/embed/api/accounts/put-account). |
| A team inside a customer | A **workspace** in that account. Most partners never need one. | A login code with `workspace: { id, name }`, or [Create or rename a workspace](https://docs.gorunner.io/embed/api/workspaces/put-workspace). |
| A user | A **person**, with a role in each workspace they use. | The first login code that names them, or [Create or update a person](https://docs.gorunner.io/embed/api/people/put-user). |

Later login codes keep names up to date. Ids are 1 to 255 bytes of UTF-8, with no control characters, compared exactly; names are up to 200 characters. An id may contain `/`, so escape it in a path.

**What if two of my apps share one installation?**

The ids belong to the installation, not to a key: every partner key names the same accounts and people. Keep each app’s ids apart with a prefix, such as `contoso:co-77`. Otherwise a code from one app can sign a person in to another app’s customer.

## Accounts

- **Active**: As normal.
- **Suspended**: Its workflows stop starting, and its people can look but not change anything. Nothing is lost. See [Suspend an account](https://docs.gorunner.io/embed/usage-suspension-deletion#suspend).
- **Deleted**: Its sessions end, and new login codes for it are refused with `409 ACCOUNT_DELETED`. It can be restored for 30 days.

Active and suspended accounts count against the license’s organization limit, and their workspaces against its workspace limit. A new account or workspace past one is refused with `403 ORG_LIMIT` or `403 WORKSPACE_LIMIT`, and so is restoring one. Your customers’ people never take a seat.

For one account, [Create or update an account](https://docs.gorunner.io/embed/api/accounts/put-account) also sets:

- `turnOff`: Switches off for this account. See [Three levels](https://docs.gorunner.io/embed/switches#three-levels).
- `pieces`: The apps it may use. `null` is the installation’s list; `[]` leaves only the steps every workflow has.
- `assistant.monthlyTokens`: Its own monthly allowance for [the assistant](https://docs.gorunner.io/embed/the-assistant).
- `limits.concurrentRuns`: Its runs at once, below.

## Runs at once

A limit on how many of an account’s runs go at once, so one busy customer can’t fill your workers. Runs over it wait in line. The customer sees them as **Queued**, with their place, such as “2nd in line · the account runs 10 at once”; your server’s run reads say `queued`.

- **From your server**: `"limits": { "concurrentRuns": 10 }` on the account: a whole number, `0` for no limit, or `null` for the installation’s default.
- **From the Platform**: The customer’s record › **Limits…** › **Runs at once**. It says who set it last, such as “Set by your app on 9 Oct”. The last change counts.
- **The default**: **Platform › Settings › General**, **Runs at once per organization**. Empty is no limit.

Which account goes first, held runs and how many may wait: [Runs at once › The rules](https://docs.gorunner.io/build/runs-at-once#the-rules). To empty one workflow’s line, use [Cancel a workflow’s waiting runs](https://docs.gorunner.io/embed/api/workflows/cancel-waiting-runs).

## Workspaces

A login code without a workspace signs the person in to the account’s default workspace. One account per customer, with its default workspace, suits most partners.

Name a workspace when a customer’s teams must not see each other’s workflows. It is made the first time a code names it, and needs a name then. A person works in one workspace at a time, and can have a different role in each.

The default workspace can’t be deleted (`409 DEFAULT_WORKSPACE`). Deleting any other is permanent, and signs its people out of it.

**Why not put every customer in one account?**

It works, but one account is one suspension, one audit trail, one set of shared templates and one place in the license’s organization limit. An account per customer keeps all four apart.

## People and roles

A person is one of your users, known by your id across the installation. The same person can be in several accounts. Their name is shown to others. An email, if you send one, is for contact only: it never identifies them and never signs them in.

- `viewer`: Sees workflows, runs and connections.
- `operator`: And runs workflows, tries a step, and cancels or deletes runs.
- `editor`: And builds, publishes and deletes workflows, and adds, changes and removes connections.

Nobody in an account is its admin or owner: the account is yours to manage. The [switches](https://docs.gorunner.io/embed/switches) narrow what a role allows.

- **Changing a role**: A login code with another role changes it. Their sessions in that workspace end and renew at the new role. [Give a person a role](https://docs.gorunner.io/embed/api/people/put-member) does it without a sign-in.
- **Removing someone**: [Remove a member](https://docs.gorunner.io/embed/api/people/remove-member) ends their sessions there at once. [Delete a person](https://docs.gorunner.io/embed/api/people/delete-user) removes them from everything. They get back in only with a new login code.

## Where your staff see them

In **Platform › People**, under **Your app’s people**, each is marked **Signs in through your app**, and **Last seen** reads **In your app**. Platform admins whose reach covers your customers see the email your app sent, marked as a contact address. It is never shown during a staff visit. Inside, each person has a placeholder address, `u-<GoRunner’s id>@embed.invalid`.

One person of the installation’s own, **Embedded accounts**, owns your customers’ accounts and never signs in. It is left out of the list unless asked for, and marked **Service**.

## Related

- [Login codes and sessions](https://docs.gorunner.io/embed/sign-in-and-sessions): How a code signs a person in
- [Usage, suspension and deletion](https://docs.gorunner.io/embed/usage-suspension-deletion): Billing counts, and pausing a customer
- [Partner API](https://docs.gorunner.io/embed/api): Accounts, workspaces and people from your server

Source: https://docs.gorunner.io/embed/accounts-and-people
