Helpdesk setup and onboarding
Helpdesk setup is a first-run path that turns a new site into a usable support workspace. A System Manager can secure the account, name the workspace, connect a support mailbox, invite agents, and then enter the agent desk with a guided welcome ticket.
Setup eligibility
The setup page is a site-level first-run experience. The backend exposes its pending state in boot data only for a System Manager on a Frappe Cloud v2 site whose Helpdesk setup flag is not complete; existing sites with real ticket history are treated as already set up. (helpdesk/…/index.py• L55-74, helpdesk/…/setup.py• L8-22, helpdesk/…/mark_existing_sites_set_up.py• L4-9)
Setup is available at /setup. The Vue flow starts at the password step when the framework account setup is still pending. Otherwise, it starts at workspace setup. A saved browser step can restore the last step after a return from an external sign-in page. (desk/…/index.ts• L142-152, desk/…/setup.ts• L32-71, desk/…/Setup.vue• L143-153)
Setup stages
The flow uses one shared state model for the step forms and the product preview. Optional stages can be skipped, while the password stage is required when the user still needs a local login password.
flowchart LR
A[Account password] --> B[Workspace identity]
B --> C[Support mailbox]
C --> D[Agent invitations]
D --> E[Setup completion]
C -. set up later .-> D
B -. skip setup .-> E
D -. skip and finish .-> E
E --> F[Welcome ticket in agent desk]
Account password
The password stage establishes the first local login password for the signed-up user. It checks password strength and confirmation before saving the password without ending other sessions. This stage is omitted when the framework site setup is already complete. (desk/…/SetupPasswordStep.vue• L1-14, desk/…/SetupPasswordStep.vue• L133-186, desk/…/SetupPasswordStep.vue• L189-209)
References: desk/…/SetupPasswordStep.vue• L1-14 desk/…/SetupPasswordStep.vue• L133-186 desk/…/SetupPasswordStep.vue• L189-209 desk/…/setup.ts• L54-71
Workspace identity
The workspace stage gives the support portal a company or team name and an optional public logo. The name and logo are saved to HD Settings, then become the shared identity for the customer portal, email replies, and the desk preview. (desk/…/SetupWorkspaceStep.vue• L1-14, desk/…/SetupWorkspaceStep.vue• L167-199, desk/…/SetupWorkspaceStep.vue• L201-225)
References: desk/…/SetupWorkspaceStep.vue• L1-14 desk/…/SetupWorkspaceStep.vue• L167-199 desk/…/SetupWorkspaceStep.vue• L201-225 desk/…/setup.ts• L94-99
Support mailbox
The mailbox stage connects the address that receives customer support email. Incoming messages from that account become Helpdesk tickets, so this stage links external mail service access to the ticket intake path. The provider picker supports one-click sign-in where available and manual account setup for providers that need account details. (desk/…/SetupEmailStep.vue• L1-9, desk/…/SetupEmailStep.vue• L12-21, desk/…/SetupEmailStep.vue• L142-171, desk/…/SetupProviderPicker.vue• L24-57, desk/…/SetupProviderPicker.vue• L223-296)
Provider choice changes the connection path. Google Workspace can require an administrator to allow Frappe before OAuth can proceed. Personal Gmail uses an app password in the manual path. Custom accounts use their mail settings, while outgoing-only accounts can send but do not turn replies into tickets. (desk/…/SetupProviderPicker.vue• L59-221, desk/…/SetupProviderPicker.vue• L337-399, desk/…/SetupProviderPicker.vue• L401-519, desk/…/SetupEmailStep.vue• L50-64)
After a connection, the flow shows a short import phase. It then lets the user continue while the first messages enter the ticket system. If no mailbox is connected, the user can continue with setup and connect one later from Settings. (desk/…/SetupEmailStep.vue• L66-137, desk/…/SetupEmailStep.vue• L154-169, desk/…/SetupEmailStep.vue• L219-228, desk/…/setup.ts• L101-120)
References: desk/…/SetupEmailStep.vue• L1-9 desk/…/SetupEmailStep.vue• L12-21 desk/…/SetupEmailStep.vue• L50-64 desk/…/SetupEmailStep.vue• L66-137 desk/…/SetupEmailStep.vue• L142-228 desk/…/SetupProviderPicker.vue• L24-57 desk/…/SetupProviderPicker.vue• L59-221 desk/…/SetupProviderPicker.vue• L223-296 desk/…/SetupProviderPicker.vue• L337-519 desk/…/setup.ts• L101-120
Agent invitations
The invitation stage adds support agents by email and assigns each invite an agent role. The flow normalizes addresses, removes duplicates, sends valid pending invites, and keeps successful rows marked as sent so a retry does not send them again. Disabled users remain visible as failed invites and do not block already successful invitations. (desk/…/SetupTeamStep.vue• L1-25, desk/…/SetupTeamStep.vue• L185-217, desk/…/SetupTeamStep.vue• L251-295)
Invitations use the framework's email invitation service with a Helpdesk return path. Helpdesk limits the roles that a System Manager can grant and creates the Helpdesk agent record when the invited user accepts. (desk/…/SetupTeamStep.vue• L297-313, helpdesk/hooks.py• L111-129)
References: desk/…/SetupTeamStep.vue• L1-25 desk/…/SetupTeamStep.vue• L136-183 desk/…/SetupTeamStep.vue• L185-217 desk/…/SetupTeamStep.vue• L251-313 helpdesk/hooks.py• L111-129
Completion and desk entry
Completion is a server boundary rather than only a Vue screen change. The client calls helpdesk.api.setup.complete_setup on Finish or Skip. The backend checks the System Manager role, finishes the framework setup when the site still needs it, marks HD Settings.setup_complete, and returns the oldest welcome ticket for the first desk route. (desk/…/setup.ts• L219-253, helpdesk/…/setup.py• L25-54)
The completion call is retried if the first save fails before the user enters the desk. This keeps the setup flag and the next route aligned. A framework setup error is logged, but Helpdesk still records its own setup as complete so the user is not trapped in the first-run flow. (desk/…/setup.ts• L238-252, helpdesk/…/setup.py• L40-55)
The final dialog summarizes the connected mailbox and invited agents. It can also collect optional setup feedback. The desk opens with the welcome ticket when one exists, giving the new agent a concrete view of ticket activity, replies, internal comments, assignment, priority, status, and service timers. (desk/…/Setup.vue• L79-97, desk/…/SetupDoneDialog.vue• L130-195, helpdesk/…/welcome_ticket.py• L54-90)
References: desk/…/setup.ts• L219-253 desk/…/Setup.vue• L79-97 desk/…/SetupDoneDialog.vue• L130-195 helpdesk/…/setup.py• L25-55 helpdesk/…/welcome_ticket.py• L54-90
Agent-desk experience
The setup preview connects each choice to the product surface it affects. Workspace identity appears on the portal and desk. A connected mailbox changes the preview from sample work to an arriving ticket. An invited agent becomes the visible assignee and can appear as the first reply after the invite is sent. (desk/…/SetupPreview.vue• L519-529, desk/…/SetupPreview.vue• L624-645, desk/…/SetupPreviewDesk.vue• L614-624)
The initial desk experience centers on the ticket list and the ticket workspace. The list shows work state, assignment, response target, priority, and creation time. The ticket view then shows the customer conversation beside the controls an agent needs to reply, comment, assign, set priority, and inspect service targets. (desk/…/SetupPreviewDesk.vue• L117-150, desk/…/SetupPreviewDesk.vue• L185-328, desk/…/SetupPreviewDesk.vue• L331-465, desk/…/SetupPreviewDesk.vue• L469-589)
The setup page also previews the customer-facing portal. This makes the onboarding result visible as one system: the customer can find help articles and raise a ticket, while the agent receives and works on that ticket in the desk. See Agent desk platform for the broader desk model. (desk/…/SetupPreview.vue• L214-452)
References: desk/…/SetupPreview.vue• L519-645 desk/…/SetupPreview.vue• L214-452 desk/…/SetupPreviewDesk.vue• L117-150 desk/…/SetupPreviewDesk.vue• L185-328 desk/…/SetupPreviewDesk.vue• L331-465 desk/…/SetupPreviewDesk.vue• L469-624
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the boot flag, setup route, and
HD Settings.setup_completetransition aligned. A mismatch can send a user back to setup after the desk opens. - Keep the mailbox connection result aligned with the import-progress state. The desk preview and completion summary use that shared state to decide whether a first ticket is visible.
- Keep invitation role values aligned with Helpdesk's allowed invitation roles and the post-accept agent creation hook.
- Keep the completion API's returned ticket contract aligned with the route opened by
openDesk. - Keep external-provider return handling aligned with the saved setup step and the
email_oauthquery marker.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A non-System Manager calls the completion API | The site setup flag is not changed | The backend enforces the System Manager role before completion |
| The framework setup callback fails | Framework setup remains incomplete even though Helpdesk can leave first-run setup | Log the framework error and inspect the framework setup state separately |
| A mailbox is skipped | Email cannot create new tickets until a mailbox is connected later | The UI requires an explicit confirmation and points to Settings |
| Google Workspace has not allowed Frappe | OAuth cannot connect the support mailbox | Show the admin approval steps or use the manual setup path |
| An invite targets a disabled user | That invite fails while other valid invites can succeed | Keep failed addresses visible and do not resend rows already marked sent |
| The completion request fails before the route change | The user may leave without a saved Helpdesk setup state | Retry the completion request before opening the desk |
Key files
| File | Why to read it |
|---|---|
| helpdesk/…/setup.py | Defines when first-run setup is pending and how the server closes it. |
| helpdesk/…/index.py | Shows how setup state reaches the Vue application boot data. |
| desk/…/setup.ts | Defines the shared stage order, state, skip behavior, completion call, and desk handoff. |
| desk/…/Setup.vue | Shows the user-facing setup shell and how the stages are composed. |
| desk/…/SetupWorkspaceStep.vue | Shows how the public workspace identity is saved. |
| desk/…/SetupEmailStep.vue | Shows how mailbox connection and import readiness enter the setup flow. |
| desk/…/SetupProviderPicker.vue | Shows the provider choices and the OAuth or manual connection paths. |
| desk/…/SetupTeamStep.vue | Shows invitation validation, role grouping, retries, and partial success. |
| helpdesk/hooks.py | Defines invitation role limits and the post-accept Helpdesk hook. |
| desk/…/SetupPreview.vue | Shows how onboarding choices map to the portal, login, and desk views. |
| desk/…/SetupPreviewDesk.vue | Shows the first-run agent list and ticket workspace experience. |
| helpdesk/…/welcome_ticket.py | Defines the first ticket that introduces the agent to Helpdesk. |
| helpdesk/…/test_setup.py | States the backend guarantees for eligibility, completion, permissions, and existing sites. |