@n8n-as-code/n8nac 2.0.1-next.7 → 2.1.0-next.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # @n8n-as-code/n8nac
2
2
 
3
- **OpenClaw access to the standard `n8n-as-code` skills and workflow stack.**
3
+ OpenClaw access to the standard `n8n-as-code` skills and workflow stack.
4
4
 
5
- Use OpenClaw to build, update, validate, and manage n8n workflows with the same `n8nac` CLI and AI context model used across the wider `n8n-as-code` project.
5
+ The plugin uses the same model as VS Code, Claude, and the CLI:
6
6
 
7
- ## v2 migration note
8
-
9
- Version 2 removes the facade-specific OpenClaw runtime tool path. The plugin now delegates instance, auth, project, tunnel, credential, and presentation operations to `n8n-manager`, while workspace sync context is stored through `n8nac workspace` in `~/.openclaw/n8nac/`.
10
-
11
- Documentation: [OpenClaw guide](https://n8nascode.dev/docs/usage/openclaw/) · [n8n-manager guide](https://n8nascode.dev/docs/usage/n8n-manager/) · [CLI workspace commands](https://n8nascode.dev/docs/usage/cli/#workspace)
7
+ | Group | Command | Purpose |
8
+ |---|---|---|
9
+ | Usage Principal | `n8nac env` | Workspace environments |
10
+ | Maintenance Workspace | `n8nac workspace` | Readiness, unified migration, upgrade |
11
+ | Instances Managées | `n8n-manager` | Local managed instances and tunnels |
12
12
 
13
13
  ## Install
14
14
 
@@ -16,168 +16,88 @@ Documentation: [OpenClaw guide](https://n8nascode.dev/docs/usage/openclaw/) · [
16
16
  openclaw plugins install @n8n-as-code/n8nac
17
17
  ```
18
18
 
19
- For prerelease testing, install the `next` dist-tag and use matching prerelease CLI commands in any manual shell steps:
19
+ For prerelease testing:
20
20
 
21
21
  ```bash
22
22
  openclaw plugins install @n8n-as-code/n8nac@next
23
- npx --yes n8nac@next workspace status --json
24
- npx --yes @n8n-as-code/n8n-manager@next instances list
23
+ npx --yes n8nac@next env list
24
+ npx --yes @n8n-as-code/n8n-manager@next instance list
25
25
  ```
26
26
 
27
- Do not mix an OpenClaw plugin installed from `@next` with `n8nac@latest`; bundled prerelease skills may reference CLI commands that are not in the stable release yet.
28
-
29
- If you previously installed `@n8n-as-code/openclaw-plugin`, remove the old install first so OpenClaw re-registers the plugin cleanly under `n8nac`:
27
+ If you previously installed `@n8n-as-code/openclaw-plugin`, remove the old install first:
30
28
 
31
29
  ```bash
32
30
  openclaw plugins uninstall n8nac
33
31
  openclaw plugins install @n8n-as-code/n8nac
34
32
  ```
35
33
 
36
- Restart the gateway. Runtime access, project selection, workspace sync, and
37
- workflow guidance are handled by the bundled `n8n-manager` and `n8n-architect`
38
- skills through their documented shell commands.
39
-
40
34
  ## Usage
41
35
 
42
- Once the runtime and workspace are configured through the skills, talk to OpenClaw:
43
-
44
- > "Create an n8n workflow that sends a Slack message when a GitHub issue is opened"
45
-
46
- > "Pull workflow 42 and add an error handler to it"
47
-
48
- > "What operations does the Google Sheets node support?"
49
-
50
- The plugin keeps its prompt hook lightweight. OpenClaw uses the bundled
51
- `n8n-manager` and `n8n-architect` skills for explicit n8n sessions. Those
52
- skills use the same shell commands as Claude, Codex, Cursor, VS Code, and other
53
- agents: `n8n-manager ...` and `n8nac ...`.
54
-
55
- ## CLI commands
56
-
57
- | Command | Description |
58
- |---|---|
59
- | `openclaw n8nac:status` | Show workspace status |
60
-
61
- ## Workspace
62
-
63
- All files live in `~/.openclaw/n8nac/`:
64
-
65
- ```
66
- ~/.openclaw/n8nac/
67
- n8nac-config.json ← workspace project/sync overrides only
68
- AGENTS.md ← lightweight agent bootstrap (written by n8nac update-ai)
69
- .agents/skills/ ← portable n8n-manager + n8n-architect skills
70
- workflows/ ← .workflow.ts files (your n8n workflows)
71
- ```
72
-
73
- Instances and API keys are not stored in this workspace. They live in the global
74
- `n8n-manager` configuration under `~/.n8n-manager`.
75
-
76
- To pin this workspace to one global instance, run `n8n-manager instances list`, then `n8nac workspace pin-instance --instance-id <instanceId>` from `~/.openclaw/n8nac/` or through the agent skill shell.
77
-
78
- ## Agent skills
79
-
80
- The plugin does not register a facade-specific agent tool. Agents should use
81
- the portable skills and shell commands directly:
36
+ Run setup, then restart the gateway:
82
37
 
83
38
  ```bash
84
- n8n-manager instances list
85
- n8nac workspace status --json
86
- n8nac list
87
- n8nac pull <workflowId>
88
- n8nac push <path-to-workflow.workflow.ts> --verify
89
- n8nac skills node-info <nodeName>
39
+ openclaw n8nac:setup
40
+ openclaw gateway restart
90
41
  ```
91
42
 
92
- `AGENTS.md` is not a configuration source of truth. It points agents to the
93
- local skills and to `n8nac workspace status --json`, which resolves the
94
- effective context through the backend.
43
+ Then ask OpenClaw for workflow work:
95
44
 
96
- ## Local development
97
-
98
- This section covers how to load the plugin from source during development so
99
- that changes take effect immediately without an npm publish cycle.
100
-
101
- ### 1. Link the plugin directory
102
-
103
- OpenClaw's `--link` flag registers a local path instead of installing a copy.
104
- jiti is used to run TypeScript directly, so no build step is needed.
105
-
106
- ```bash
107
- openclaw plugins install --link \
108
- /home/etienne/repos/n8n-as-code/plugins/openclaw/n8n-as-code
45
+ ```text
46
+ Create an n8n workflow that sends a Slack message when a GitHub issue is opened.
109
47
  ```
110
48
 
111
- What this does:
112
- - Adds the path to `plugins.load.paths` in `~/.openclaw/openclaw.json`
113
- - Registers a `source: "path"` install record bound to the plugin ID `n8nac`
114
- - No file copy — OpenClaw loads `index.ts` directly from the source tree
49
+ ## Workspace
115
50
 
116
- ### 2. Verify the plugin is registered
51
+ OpenClaw files live in `~/.openclaw/n8nac/`:
117
52
 
118
- ```bash
119
- openclaw plugins info n8nac
53
+ ```text
54
+ ~/.openclaw/n8nac/
55
+ n8nac-config.json
56
+ AGENTS.md
57
+ .agents/skills/
58
+ workflows/
120
59
  ```
121
60
 
122
- You should see status `loaded`, the bundled skills, and the `n8nac:status` CLI
123
- command. The plugin intentionally does not register a
124
- facade-specific agent tool.
61
+ `n8nac-config.json` stores workspace environments. API keys and managed local instance state stay local.
125
62
 
126
- ### 3. Configure runtime access through skills
63
+ Manual equivalent:
127
64
 
128
65
  ```bash
129
- n8n-manager auth set --url <url> --api-key-stdin
130
- n8n-manager projects list
131
- n8n-manager projects select <project-id-or-name>
132
- n8nac workspace set-sync-folder workflows
66
+ n8nac env add Dev --base-url <url> --sync-folder workflows/dev
67
+ n8nac env auth set Dev --api-key-stdin
68
+ n8nac env use Dev
133
69
  n8nac update-ai
134
70
  ```
135
71
 
136
- The OpenClaw plugin does not own setup orchestration. It exposes lightweight
137
- context and lets the portable skills manage global instances, secrets, projects,
138
- workspace overrides, `AGENTS.md`, and `.agents/skills`.
139
-
140
- ### 4. Iterate on the code
141
-
142
- - Edit any `.ts` file in `plugins/openclaw/n8n-as-code/`
143
- - **Restart the gateway** to reload: `openclaw stop && openclaw start` (or the
144
- equivalent service restart on your setup)
145
- - The `before_prompt_build` hook and CLI commands reload on
146
- gateway start
147
-
148
- ### 5. Check gateway logs
72
+ For a managed local instance:
149
73
 
150
74
  ```bash
151
- tail -f ~/.openclaw/logs/openclaw-$(date +%Y-%m-%d).log | grep n8nac
75
+ n8n-manager instance list
76
+ n8nac env add Local --managed-instance <id> --sync-folder workflows/local
152
77
  ```
153
78
 
154
- The plugin prefixes all `api.logger` calls with `[n8nac]`.
79
+ ## Agent Commands
155
80
 
156
- ### 6. Inspect the n8nac workspace
157
-
158
- ```
159
- ~/.openclaw/n8nac/
160
- n8nac-config.json ← workspace project/sync overrides only
161
- AGENTS.md ← lightweight bootstrap written by update-ai
162
- .agents/skills/ ← portable skills written by update-ai
163
- workflows/ ← .workflow.ts files
164
- ```
165
-
166
- To reset and redo setup from scratch:
81
+ Agents use the normal shell commands:
167
82
 
168
83
  ```bash
169
- rm -rf ~/.openclaw/n8nac
170
- n8nac workspace set-sync-folder workflows
171
- n8nac update-ai
84
+ n8nac env status
85
+ n8nac list
86
+ n8nac pull <workflow-id>
87
+ n8nac push <path-to-workflow.workflow.ts> --verify
88
+ n8nac skills node-info <node-name>
172
89
  ```
173
90
 
174
- ### 7. Unlink when done
91
+ ## Local Development
92
+
93
+ Register this directory with OpenClaw:
175
94
 
176
95
  ```bash
177
- openclaw plugins uninstall n8nac
96
+ openclaw plugins install --link /home/etienne/repos/n8n-as-code/plugins/openclaw/n8n-as-code
97
+ openclaw plugins info n8nac
178
98
  ```
179
99
 
180
- ---
100
+ Restart the gateway after changes.
181
101
 
182
102
  ## Source
183
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n-as-code/n8nac",
3
- "version": "2.0.1-next.7",
3
+ "version": "2.1.0-next.45",
4
4
  "description": "OpenClaw plugin for n8n-as-code — create and manage n8n workflows from OpenClaw",
5
5
  "keywords": [
6
6
  "n8n",
@@ -5,7 +5,9 @@ description: Use when the user explicitly wants to create, edit, validate, sync,
5
5
 
6
6
  # n8n Architect
7
7
 
8
- Use this skill for workflow engineering. Use the `n8n-manager` skill for instance, auth, runtime, tunnel, project-default, credential infrastructure, or workflow presentation work.
8
+ Use this skill for all n8n-as-code work: workspace readiness, migration, environments, managed local instances, tunnels, workflow authoring, validation, sync, push, and pull.
9
+
10
+ Use `npx --yes n8nac` as the primary interface. Use `npx --yes @n8n-as-code/n8n-manager` only for local managed runtime lifecycle, tunnels, and workflow presentation commands that are explicitly exposed by n8n-manager.
9
11
 
10
12
  ## Context Root Protocol
11
13
 
@@ -13,42 +15,171 @@ Use this skill for workflow engineering. Use the `n8n-manager` skill for instanc
13
15
  - Generated context root hint: not embedded. Use the shell launch directory or the workspace path explicitly given by the user.
14
16
  - Before any n8n work, first run `npx --yes n8nac update-ai` from the context root, then read `AGENTS.md`. `update-ai` is designed to create or refresh the n8n-as-code block without destroying existing user or agent instructions.
15
17
  - Use the exact `n8nac command` and `n8n-manager command` listed in `AGENTS.md`. Those context-root commands override the portable examples in this skill.
16
- - Run every `npx --yes n8nac workspace ...`, `npx --yes n8nac list`, `pull`, `push`, `validate`, `test`, and `update-ai` command from the context root unless the user explicitly gives another context root.
18
+ - Run every `npx --yes n8nac env ...`, `npx --yes n8nac workspace ...`, `npx --yes n8nac list`, `pull`, `push`, `validate`, `test`, and `update-ai` command from the context root unless the user explicitly gives another context root.
17
19
  - `AGENTS.md` is bootstrap context only, not a source of configuration truth.
18
- - Do not infer instance, project, sync folder, or workflow directory from `AGENTS.md`.
20
+ - Do not infer environment, project, sync folder, or workflow directory from `AGENTS.md`.
19
21
  - Before n8n work, resolve the effective context from the backend:
20
22
 
21
23
  ```bash
22
- npx --yes n8nac workspace status --json
24
+ npx --yes n8nac env status --json
23
25
  ```
24
26
 
25
27
  - Use the returned `workflowDir` for workflow files. Do not reconstruct it from `syncFolder`, `instanceIdentifier`, or `projectName`.
26
- - Never write `n8nac-config.json` by hand. Use `npx --yes n8nac workspace ...` commands.
28
+ - Never write `n8nac-config.json`, `~/.n8n-manager`, or n8n-manager secret files by hand.
29
+
30
+ ## Workspace Readiness
31
+
32
+ Use the unified migration preflight before resolving the effective environment. The dry-run is safe and reports whether any workspace migration is required:
33
+
34
+ ```bash
35
+ npx --yes n8nac workspace migrate --json
36
+ npx --yes n8nac env status --json
37
+ ```
38
+
39
+ - Treat `workspace migrate --json` as the source of migration need.
40
+ - Treat `env status --json` as the source of effective workspace readiness only after migration is not required or has been applied.
41
+ - Do not infer readiness from raw files, generated agent docs, or directory names.
42
+ - If migration is required, do not edit config files by hand or continue with environment/workflow work until it has been applied or explicitly deferred by the user.
43
+
44
+ ## Migration
45
+
46
+ Migration is one user-facing command. Do not reason about internal migration phases directly; summarize the report `operations` array when explaining what will change.
47
+
48
+ 1. Run the dry-run first:
49
+
50
+ ```bash
51
+ npx --yes n8nac workspace migrate --json
52
+ ```
53
+
54
+ 2. If the dry-run reports `status: "dry-run"`, `required: true`, or otherwise indicates pending changes, stop and ask once before applying it. Do not run `workspace migrate --write` unless the user already directly requested applying migration.
55
+ 3. After confirmation, apply migration and re-check readiness:
56
+
57
+ ```bash
58
+ npx --yes n8nac workspace migrate --write
59
+ npx --yes n8nac workspace migrate --json
60
+ npx --yes n8nac env status --json
61
+ ```
62
+
63
+ - Do not run `workspace migrate --write` without explicit confirmation unless the user already directly requested applying migration.
64
+ - When reporting a dry-run, summarize the unified `operations` list and ask for exactly one confirmation for `npx --yes n8nac workspace migrate --write`.
65
+ - Do not ask separately for different operation types. `npx --yes n8nac workspace migrate --write` applies the required migration as one operation.
66
+ - Do not run environment, workflow, or setup commands while `workspace migrate --json` still reports migration required.
67
+ - Managed local instances remain machine-global runtime resources.
68
+ - Workspace environments remain workspace-scoped and are managed through `npx --yes n8nac env ...`.
27
69
 
28
70
  ## Bootstrap Order
29
71
 
30
72
  1. `cd` to the context root.
31
73
  2. Run `npx --yes n8nac update-ai`, then read `AGENTS.md`.
32
- 3. Run `npx --yes n8nac workspace status --json`.
33
- 4. If the context root is not ready, inspect instances with `npx --yes @n8n-as-code/n8n-manager instances list`.
34
- 5. Reuse an existing instance when suitable.
35
- 6. If no suitable instance exists, stop and ask the user whether they want to reuse/configure an existing instance, create a managed local n8n instance, or connect an existing/remote n8n instance. Do not create infrastructure by default. If the user chooses a managed local instance, ask separately whether they want a public tunnel.
36
- 7. Ask for host/API key only for an explicitly remote or existing n8n instance.
37
- 8. Configure context-root overrides with:
74
+ 3. Run `npx --yes n8nac workspace migrate --json`.
75
+ 4. If migration is required, stop and ask for confirmation before `npx --yes n8nac workspace migrate --write` unless the user already requested applying migration.
76
+ 5. Run `npx --yes n8nac env status --json` after migration is not required or has been applied.
77
+ 6. If the context root is not ready, inspect managed local instances with `npx --yes @n8n-as-code/n8n-manager instance list`.
78
+ 7. Reuse an existing environment or managed local instance when suitable.
79
+ 8. If no suitable environment exists, stop and ask the user whether they want to connect a remote n8n URL or create/reuse a managed local n8n instance. Do not create infrastructure by default. If the user chooses a managed local instance, ask separately whether they want a public tunnel.
80
+ 9. Ask for host/API key only for an explicitly remote n8n environment.
81
+ 10. Configure the environment with:
82
+
83
+ ```bash
84
+ npx --yes n8nac env add <name> --base-url <url> --sync-folder workflows/<name>
85
+ npx --yes n8nac env auth set <name> --api-key-stdin
86
+ npx --yes n8nac env use <name>
87
+ ```
88
+
89
+ For a managed local instance:
90
+
91
+ ```bash
92
+ npx --yes n8nac env add Local --managed-instance <id> --sync-folder workflows/local
93
+ npx --yes n8nac env use Local
94
+ ```
95
+
96
+ 11. Run `npx --yes n8nac update-ai` after changing environments when the facade does not do it automatically.
97
+
98
+ ## Environments
99
+
100
+ Use `npx --yes n8nac env ...` for workspace environments, remote URLs, active environment, API-key binding, projects, and sync folders.
101
+
102
+ ```bash
103
+ npx --yes n8nac env status --json
104
+ npx --yes n8nac env list
105
+ npx --yes n8nac env add <name> --base-url <url> --sync-folder workflows/<name>
106
+ npx --yes n8nac env auth set <name> --api-key-stdin
107
+ npx --yes n8nac env use <name>
108
+ ```
109
+
110
+ - Prefer `--api-key-stdin` for API keys.
111
+ - Do not pass secrets inline in shell arguments.
112
+ - Do not ask for host/API key when the user wants a managed local Docker instance.
113
+ - Do not print API keys or credential secret values back to the user.
114
+ - If a command or flag is unfamiliar, run `npx --yes n8nac env --help` or `npx --yes n8nac env <subcommand> --help`.
115
+
116
+ Attach a managed local instance to the workspace with `npx --yes n8nac env ...`:
117
+
118
+ ```bash
119
+ npx --yes n8nac env add Local --managed-instance <id> --sync-folder workflows/local
120
+ npx --yes n8nac env use Local
121
+ ```
122
+
123
+ ## Managed Local Runtime
124
+
125
+ Use `npx --yes @n8n-as-code/n8n-manager` only for local managed instance lifecycle, tunnels, and workflow presentation commands that are part of the local runtime layer.
126
+
127
+ Inspect existing managed instances before changing local machine state:
128
+
129
+ ```bash
130
+ npx --yes @n8n-as-code/n8n-manager instance list
131
+ npx --yes @n8n-as-code/n8n-manager instance --help
132
+ npx --yes @n8n-as-code/n8n-manager config get
133
+ ```
134
+
135
+ Do not invent n8n-manager subcommands. Use `npx --yes @n8n-as-code/n8n-manager <subcommand> --help` when unsure.
136
+
137
+ When the context root is not configured and no suitable existing instance is available, stop and ask the user to choose. Do not create infrastructure by default.
138
+
139
+ Present these choices clearly:
140
+
141
+ - use an existing managed local instance if one is available;
142
+ - create a new managed local n8n instance;
143
+ - configure a remote n8n URL as a workspace environment through `npx --yes n8nac env`.
144
+
145
+ If the user chooses a managed local Docker instance, ask the tunnel question separately:
146
+
147
+ - without public tunnel: local n8n only, suitable for normal UI/API workflow work;
148
+ - with public tunnel: exposes the instance through a public URL, useful for webhooks/forms/chat triggers and remote callbacks.
149
+
150
+ Do not enable, refresh, or start a public tunnel unless the user explicitly requested public access, webhook testing, or approved the tunnel option. If public access is not needed, create/start the managed instance without `--tunnel`.
151
+
152
+ Only run these commands after the user has explicitly chosen the corresponding option.
153
+
154
+ Managed local instance without public tunnel:
155
+
156
+ ```bash
157
+ npx --yes @n8n-as-code/n8n-manager instance create
158
+ npx --yes @n8n-as-code/n8n-manager instance start <id>
159
+ npx --yes @n8n-as-code/n8n-manager instance list
160
+ ```
161
+
162
+ Managed local instance with public tunnel:
38
163
 
39
164
  ```bash
40
- npx --yes n8nac workspace pin-instance --instance-id <id>
41
- npx --yes n8nac workspace set-sync-folder workflows
42
- npx --yes n8nac workspace set-project --project-id <id> --project-name <name>
165
+ npx --yes @n8n-as-code/n8n-manager instance create
166
+ npx --yes @n8n-as-code/n8n-manager instance start <id>
167
+ npx --yes @n8n-as-code/n8n-manager tunnel start <id>
43
168
  ```
44
169
 
45
- For self-hosted n8n instances where the projects API is unavailable or returns 401/403, do not keep retrying project discovery. Use the standard personal project override unless the user gave another project:
170
+ Instance and tunnel operations are per managed local instance:
46
171
 
47
172
  ```bash
48
- npx --yes n8nac workspace set-project --project-id personal --project-name Personal
173
+ npx --yes @n8n-as-code/n8n-manager instance start <id>
174
+ npx --yes @n8n-as-code/n8n-manager instance stop <id>
175
+ npx --yes @n8n-as-code/n8n-manager instance remove <id>
176
+ npx --yes @n8n-as-code/n8n-manager tunnel start <id>
177
+ npx --yes @n8n-as-code/n8n-manager tunnel stop <id>
49
178
  ```
50
179
 
51
- 9. Run `npx --yes n8nac update-ai` after changing context-root overrides when the facade does not do it automatically.
180
+ - Do not delete local instance data unless the user explicitly asks for destructive deletion.
181
+ - If Docker is unavailable or the daemon is stopped, report the backend diagnostic and stop. Do not loop.
182
+ - If a command fails repeatedly, stop after two attempts and explain the backend diagnostic.
52
183
 
53
184
  ## Sync Discipline
54
185
 
@@ -63,7 +194,7 @@ npx --yes n8nac push <path-to-workflow.workflow.ts> --verify
63
194
  ```
64
195
 
65
196
  - `push` requires the full workflow file path, either absolute or context-root-relative. Do not pass a bare filename.
66
- - For a new workflow, create the file inside the `workflowDir` returned by `workspace status --json`, then confirm it with `npx --yes n8nac list --local`.
197
+ - For a new workflow, create the file inside the `workflowDir` returned by `env status --json`, then confirm it with `npx --yes n8nac list --local`.
67
198
  - If push/pull reports a conflict, use explicit resolution commands. Do not overwrite remote changes blindly.
68
199
  - `pull` and conflict resolution operate on a single workflow ID.
69
200
  - `list` is the lightweight command that covers all workflows at once.
@@ -275,7 +406,7 @@ npx --yes n8nac test <workflowId> --prod
275
406
 
276
407
  ## Workflow Presentation Contract
277
408
 
278
- `presentWorkflowResult` is the standard way to show a workflow to the user. It is part of the workflow authoring loop, even though the command lives in n8n-manager.
409
+ `npx --yes n8nac workflow present` is the standard way to show a workflow to the user. It is v4-environment aware and part of the workflow authoring loop.
279
410
 
280
411
  Run it whenever one of these is true:
281
412
 
@@ -285,16 +416,17 @@ Run it whenever one of these is true:
285
416
  - the user asks to show, open, present, display, or give the URL/link for a workflow.
286
417
 
287
418
  ```bash
288
- npx --yes @n8n-as-code/n8n-manager presentWorkflowResult --workflow-id <workflowId> --workspace-root <contextRoot>
419
+ npx --yes n8nac workflow present <workflowId> --json
289
420
  ```
290
421
 
291
422
  Rules:
292
423
 
293
424
  - Do not manually construct n8n workflow URLs.
294
425
  - Do not return an internal local n8n URL when a presentation URL is available.
295
- - Use the `url` returned by `presentWorkflowResult` as the user-facing URL.
426
+ - Use the `url` returned by `workflow present --json` as the user-facing URL.
296
427
  - If you do not know the workflow ID, run `npx --yes n8nac list` first and select the matching workflow.
297
- - If `presentWorkflowResult` fails, report the backend diagnostic and then provide the best direct n8n URL only as a fallback.
428
+ - Do not call `npx --yes @n8n-as-code/n8n-manager presentWorkflowResult`; it is a legacy runtime command and is not workspace-environment aware.
429
+ - If `workflow present` fails, report the backend diagnostic and then provide the best direct n8n URL only as a fallback.
298
430
  - Do this before the final response when the task created, changed, pushed, ran, or explicitly asks to show a workflow.
299
431
 
300
432
  ### Testability Protocol
@@ -357,7 +489,7 @@ npx --yes n8nac workflow activate <workflowId>
357
489
 
358
490
  For most workflow tasks:
359
491
 
360
- 1. Resolve context with `workspace status --json`.
492
+ 1. Resolve context with `env status --json`.
361
493
  2. Read `workflowDir` from the backend response.
362
494
  3. Inspect existing workflows with `list`.
363
495
  4. Pull before editing an existing workflow.
@@ -367,13 +499,13 @@ For most workflow tasks:
367
499
  8. Push with `--verify`.
368
500
  9. Test if the workflow is HTTP-triggered.
369
501
  10. Inspect executions when behavior is unclear.
370
- 11. Present the final workflow link with `presentWorkflowResult`.
502
+ 11. Present the final workflow link with `npx --yes n8nac workflow present <workflowId> --json`.
371
503
 
372
504
  ## Response Discipline
373
505
 
374
506
  - Explain concrete actions and command results, not generic capability.
375
- - When the user asks for an URL or visual inspection of a workflow, run `presentWorkflowResult` instead of composing a URL manually.
376
- - If setup is missing, use `n8n-manager` for instance/auth/runtime and `n8nac workspace ...` for context-root overrides.
377
- - Do not ask for host/API key until existing n8n-manager instances have been inspected.
507
+ - When the user asks for an URL or visual inspection of a workflow, run `npx --yes n8nac workflow present <workflowId> --json` instead of composing a URL manually.
508
+ - If setup is missing, use `n8nac env ...` for workspace environments and `n8n-manager` only for managed local instances.
509
+ - Do not ask for host/API key unless the user chooses a remote n8n environment.
378
510
  - Do not tell the user to run setup commands when you can run non-interactive commands yourself.
379
511
  - Stop after two repeated failures with the same diagnostic and report the backend error clearly.
@@ -1,116 +0,0 @@
1
- ---
2
- name: n8n-manager
3
- description: Use when the user needs n8n instance, runtime, tunnel, auth, project, credential, or workflow presentation management through n8n-manager.
4
- ---
5
-
6
- # n8n Manager
7
-
8
- Use this skill for global n8n instance management. `n8n-manager` is the source of truth for instances, runtime state, tunnels, API keys, managed owner credentials, default projects, and workflow presentation links.
9
-
10
- ## Responsibility Boundary
11
-
12
- - Generated context root hint: not embedded. Use the shell launch directory or the workspace path explicitly given by the user.
13
- - If `n8nac` is available, first run `npx --yes n8nac update-ai` from the context root, then read `AGENTS.md`. `update-ai` is designed to create or refresh the n8n-as-code block without destroying existing user or agent instructions.
14
- - Use the exact `n8n-manager command` and `n8nac command` listed in `AGENTS.md` when present. Those context-root commands override the portable examples in this skill.
15
- - Use `npx --yes @n8n-as-code/n8n-manager` for global instance, auth, runtime, tunnel, project-default, credential, and workflow-presentation operations.
16
- - Use `npx --yes n8nac workspace ...` only for context-root overrides such as pinned instance, sync folder, and project override.
17
- - Use `npx --yes n8nac` workflow commands only after the effective context is ready.
18
- - Never edit `n8nac-config.json`, `~/.n8n-manager`, or n8n-manager secret files by hand.
19
-
20
- ## Core Commands
21
-
22
- Inspect existing instances before changing state:
23
-
24
- ```bash
25
- npx --yes @n8n-as-code/n8n-manager instances list
26
- npx --yes @n8n-as-code/n8n-manager instances --help
27
- npx --yes @n8n-as-code/n8n-manager config get
28
- ```
29
-
30
- Do not invent n8n-manager subcommands. In particular, `instances create` and `--type local` are not valid. Use `instances add --mode ...` exactly as documented by `instances --help`.
31
-
32
- ## Unconfigured Context Root
33
-
34
- When the context root is not configured and no suitable existing instance is available, stop and ask the user to choose. Do not create infrastructure by default.
35
-
36
- Present these choices clearly:
37
-
38
- - use an existing n8n-manager instance if one is available;
39
- - create a new managed local Docker n8n instance;
40
- - connect an existing or remote n8n instance with user-provided credentials.
41
-
42
- If the user chooses a managed local Docker instance, ask the tunnel question separately:
43
-
44
- - without public tunnel: local n8n only, suitable for normal UI/API workflow work;
45
- - with public tunnel: exposes the instance through a public URL, useful for webhooks/forms/chat triggers and remote callbacks.
46
-
47
- Do not enable, refresh, or start a public tunnel unless the user explicitly requested public access, webhook testing, or approved the tunnel option. If public access is not needed, create/start the managed instance without `--tunnel`.
48
-
49
- ## Confirmed Setup Commands
50
-
51
- Only run these commands after the user has explicitly chosen the corresponding option.
52
-
53
- Managed local Docker without public tunnel:
54
-
55
- ```bash
56
- npx --yes @n8n-as-code/n8n-manager instances add --name <name> --mode managed-local-docker
57
- npx --yes @n8n-as-code/n8n-manager instances setup <id-or-name>
58
- npx --yes @n8n-as-code/n8n-manager instances start <id-or-name>
59
- npx --yes @n8n-as-code/n8n-manager instances status <id-or-name>
60
- ```
61
-
62
- Managed local Docker with public tunnel:
63
-
64
- ```bash
65
- npx --yes @n8n-as-code/n8n-manager instances add --name <name> --mode managed-local-docker --tunnel
66
- npx --yes @n8n-as-code/n8n-manager instances setup <id-or-name> --tunnel
67
- npx --yes @n8n-as-code/n8n-manager instances start <id-or-name>
68
- npx --yes @n8n-as-code/n8n-manager instances tunnel status <id-or-name>
69
- ```
70
-
71
- Remote or existing instances require user-provided credentials. Prefer stdin for API keys:
72
-
73
- ```bash
74
- npx --yes @n8n-as-code/n8n-manager auth set --url <url> --api-key-stdin --name <name>
75
- npx --yes @n8n-as-code/n8n-manager auth test --instance <id-or-name>
76
- ```
77
-
78
- Project selection is instance-level unless the context root explicitly needs a workspace override:
79
-
80
- ```bash
81
- npx --yes @n8n-as-code/n8n-manager projects list --instance <id-or-name>
82
- npx --yes @n8n-as-code/n8n-manager projects select <project-id-or-name> --instance <id-or-name>
83
- ```
84
-
85
- Self-hosted n8n may not expose the projects API or may return 401/403. In that case, do not retry project discovery. Use the n8n-architect workspace override path with the standard personal project unless the user gave another project:
86
-
87
- ```bash
88
- npx --yes n8nac workspace set-project --project-id personal --project-name Personal
89
- ```
90
-
91
- Runtime and tunnel operations are per instance:
92
-
93
- ```bash
94
- npx --yes @n8n-as-code/n8n-manager instances start <id-or-name>
95
- npx --yes @n8n-as-code/n8n-manager instances stop <id-or-name>
96
- npx --yes @n8n-as-code/n8n-manager instances restart <id-or-name>
97
- npx --yes @n8n-as-code/n8n-manager instances tunnel status <id-or-name>
98
- npx --yes @n8n-as-code/n8n-manager instances tunnel start <id-or-name>
99
- npx --yes @n8n-as-code/n8n-manager instances tunnel refresh <id-or-name>
100
- ```
101
-
102
- Present workflow results after creating, modifying, pushing, or running a workflow:
103
-
104
- ```bash
105
- npx --yes @n8n-as-code/n8n-manager presentWorkflowResult --workflow-id <workflowId> --workspace-root <contextRoot>
106
- ```
107
-
108
- ## Guardrails
109
-
110
- - Do not ask for host/API key before checking `instances list`.
111
- - Do not ask for host/API key when the user wants a managed local Docker instance.
112
- - Do not print API keys back to the user.
113
- - Do not delete runtime data unless the user explicitly asks for destructive deletion.
114
- - If Docker is unavailable or the daemon is stopped, report the backend diagnostic and stop. Do not loop.
115
- - If a command fails repeatedly, stop after two attempts and explain the backend diagnostic.
116
- - For workflow credentials, inspect the required credential type before asking for secret values.