app-builder
Load before calling the apps tool. Use when the user wants to build or change an n8n App: a small web app, form, dashboard, tracker or other browser UI that n8n hosts. Also load when the conversation lists app targets or a pending app.App Builder
An n8n App is a static browser app (Vue 3 and Vite). n8n stores its source,
builds it in a sandbox and hosts the build on the apps domain. The apps tool
puts the source of an app into your sandbox workspace and saves it back. You
edit the files with the workspace tools.
What an app can do today
- Apps run in the browser only. They cannot call n8n workflows, data tables or
agents yet. Keep data in component state or
localStorage. - Use only the dependencies of the scaffold:
vue,viteand@vitejs/plugin-vue. You cannot changepackage.jsonorpackage-lock.json. Write routing, state and UI components yourself. - Use relative URLs or
location.origin. Never hardcode a host: the preview and the published app run on different hosts. - Do not add page or theme configuration. Put styling in the source.
Scaffold
A new app starts from this source:
index.htmlloads/src/main.js.src/main.jsmountssrc/App.vueon#app.vite.config.jsuses the Vue plugin.package.jsonandpackage-lock.jsonare fixed.
Add components under src/. Keep files small and focused.
Workflow
- Create or open the app.
- New app: call
createwith a name and a namespace. The namespace is the subdomain label of the app URL: lowercase letters, digits and single hyphens. Derive it from the name. - If the conversation lists a pending app, create it with
create. n8n reuses the pending id. - Existing app: use the
appIdfrom the conversation context. If the conversation has no id, calllist(optionally with asearchtext) and pick the app by name. If several apps match, ask the user which one. Then callopen. createandopenreturn the app folder,apps/<appId>.openkeeps a folder that is already open, with your uncommitted edits.
- New app: call
- Edit the folder in batches. Read with
workspace_read_filesand change files withworkspace_edit_files. Put all the files of one step into one call, not one call for each file. Use the single-file tools only for a single file. Read only what you need: usegrepto find text, and read line ranges of large files.workspace_edit_filesruns every operation and reports each one, so fix only the operations that failed. Never changepackage.jsonorpackage-lock.json. - Build before you commit. In the app folder, run
npm cionce, thennpm run build. Fix every error and build again until the build passes. Usenpm ci, notnpm install:npm installcan changepackage-lock.json, and n8n then rejects the commit. - Commit once for each finished change. A commit saves the folder (without
node_modulesanddist) as one version, and n8n builds it again. Never commit half-done work: every commit is a version. - Check the build. A commit returns
buildStatus. Onfailed, readdiagnostics(stage, message, log), fix the source and commit again. After three failed builds in a row, stop and explain the problem to the user.
If a commit reports that the app draft changed, someone else saved a newer
version. Your folder is kept. Note your changes, call discard to load the
newer draft, and apply your changes again. discard keeps node_modules, so
you do not need to run npm ci again.
Several apps
One conversation can build several apps for one requirement, for example a
public dashboard and an admin app. Create one app for each audience or access
level. Each app has its own folder. Commit each app separately and always pass
the right appId.
Publishing and access
You cannot publish apps. Tell the user to publish with the Publish button of the app. A new app is visible to the members of its project. The user can change this in the app settings.