@n8n-as-code/skills 1.10.1-next.7 → 2.0.0-next.56
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 +2 -0
- package/dist/agent-skills/n8n-architect/SKILL.md +379 -0
- package/dist/agent-skills/n8n-manager/SKILL.md +116 -0
- package/dist/assets/n8n-credentials-ontology.json +24962 -0
- package/dist/assets/n8n-docs-complete.json +1 -1
- package/dist/assets/n8n-knowledge-index.json +1 -1
- package/dist/assets/n8n-nodes-index.json +7711 -5
- package/dist/assets/n8n-nodes-technical.json +15417 -5
- package/dist/assets/workflows-index.json +1 -1
- package/dist/commands/skills-commander.d.ts.map +1 -1
- package/dist/commands/skills-commander.js +32 -5
- package/dist/commands/skills-commander.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/services/ai-context-generator.d.ts +7 -31
- package/dist/services/ai-context-generator.d.ts.map +1 -1
- package/dist/services/ai-context-generator.js +80 -885
- package/dist/services/ai-context-generator.js.map +1 -1
- package/dist/services/cli-command-resolver.d.ts +14 -0
- package/dist/services/cli-command-resolver.d.ts.map +1 -0
- package/dist/services/cli-command-resolver.js +52 -0
- package/dist/services/cli-command-resolver.js.map +1 -0
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ This package powers the shared n8n ontology behind `n8n-as-code`: searchable nod
|
|
|
6
6
|
|
|
7
7
|
> **⚠️ BREAKING CHANGE (v0.16.0)**: Workflows are now generated and documented in **TypeScript format** (`.workflow.ts`) instead of JSON for better AI compatibility and readability.
|
|
8
8
|
|
|
9
|
+
> **BREAKING CHANGE (v2.0.0)**: Generated agent context now assumes the split runtime model: use `n8n-manager` for global instance/auth/runtime/project state and `n8nac workspace` for workspace overrides. Legacy workspace-local instance libraries are no longer treated as the runtime source of truth.
|
|
10
|
+
|
|
9
11
|
> **📌 Internal Library** — This package is not meant to be used directly. Public access is via [`n8nac`](https://www.npmjs.com/package/n8nac): `npx n8nac skills <command>`.
|
|
10
12
|
|
|
11
13
|
Specialized tooling for AI agents across Copilot, Cursor, Windsurf, Claude Code, and related editor or CLI workflows.
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: n8n-architect
|
|
3
|
+
description: Use when the user explicitly wants to create, edit, validate, sync, or troubleshoot n8n workflows, asks about n8n nodes or automation, or wants to use n8n-as-code in the current context root.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# n8n Architect
|
|
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.
|
|
9
|
+
|
|
10
|
+
## Context Root Protocol
|
|
11
|
+
|
|
12
|
+
- Treat the current context root as the directory containing `n8nac-config.json`, `AGENTS.md`, `.agents/skills`, and the workflow sync folder.
|
|
13
|
+
- {{N8NAC_CONTEXT_ROOT_HINT}}
|
|
14
|
+
- Before any n8n work, first run `{{N8NAC_CMD}} 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
|
+
- 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 `{{N8NAC_CMD}} workspace ...`, `{{N8NAC_CMD}} list`, `pull`, `push`, `validate`, `test`, and `update-ai` command from the context root unless the user explicitly gives another context root.
|
|
17
|
+
- `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`.
|
|
19
|
+
- Before n8n work, resolve the effective context from the backend:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
{{N8NAC_CMD}} workspace status --json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- 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 `{{N8NAC_CMD}} workspace ...` commands.
|
|
27
|
+
|
|
28
|
+
## Bootstrap Order
|
|
29
|
+
|
|
30
|
+
1. `cd` to the context root.
|
|
31
|
+
2. Run `{{N8NAC_CMD}} update-ai`, then read `AGENTS.md`.
|
|
32
|
+
3. Run `{{N8NAC_CMD}} workspace status --json`.
|
|
33
|
+
4. If the context root is not ready, inspect instances with `{{N8N_MANAGER_CMD}} 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:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
{{N8NAC_CMD}} workspace pin-instance --instance-id <id>
|
|
41
|
+
{{N8NAC_CMD}} workspace set-sync-folder workflows
|
|
42
|
+
{{N8NAC_CMD}} workspace set-project --project-id <id> --project-name <name>
|
|
43
|
+
```
|
|
44
|
+
|
|
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:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
{{N8NAC_CMD}} workspace set-project --project-id personal --project-name Personal
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
9. Run `{{N8NAC_CMD}} update-ai` after changing context-root overrides when the facade does not do it automatically.
|
|
52
|
+
|
|
53
|
+
## Sync Discipline
|
|
54
|
+
|
|
55
|
+
- Pull before reading or modifying an existing workflow.
|
|
56
|
+
- Push after every modification.
|
|
57
|
+
- Use `list` to inspect workflow IDs, file paths, and sync status.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
{{N8NAC_CMD}} list
|
|
61
|
+
{{N8NAC_CMD}} pull <workflowId>
|
|
62
|
+
{{N8NAC_CMD}} push <path-to-workflow.workflow.ts> --verify
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- `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 `{{N8NAC_CMD}} list --local`.
|
|
67
|
+
- If push/pull reports a conflict, use explicit resolution commands. Do not overwrite remote changes blindly.
|
|
68
|
+
- `pull` and conflict resolution operate on a single workflow ID.
|
|
69
|
+
- `list` is the lightweight command that covers all workflows at once.
|
|
70
|
+
- If you skip pull, a later push can be rejected by optimistic concurrency control when the remote changed.
|
|
71
|
+
|
|
72
|
+
## Conflict Handling
|
|
73
|
+
|
|
74
|
+
If push or pull reports a conflict, stop and inspect the conflict. Use explicit resolution commands only after choosing the intended direction:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
{{N8NAC_CMD}} resolve <workflowId> --mode keep-current
|
|
78
|
+
{{N8NAC_CMD}} resolve <workflowId> --mode keep-incoming
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- `keep-current` force-pushes the local version.
|
|
82
|
+
- `keep-incoming` force-pulls the remote version.
|
|
83
|
+
- Never silently force-push over a remote change.
|
|
84
|
+
|
|
85
|
+
## Schema-First Research
|
|
86
|
+
|
|
87
|
+
Never guess n8n node parameters.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
{{N8NAC_SKILLS_CMD}} examples search "<workflow pattern>"
|
|
91
|
+
{{N8NAC_SKILLS_CMD}} search "<node or capability>"
|
|
92
|
+
{{N8NAC_SKILLS_CMD}} node-info <nodeName>
|
|
93
|
+
{{N8NAC_SKILLS_CMD}} validate <workflow.workflow.ts>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- Use exact node `type` and valid `typeVersion` values from `node-info`.
|
|
97
|
+
- Use exact resource, operation, option, and parameter names from schema output.
|
|
98
|
+
- Do not invent parameters, operations, credential types, or CLI flags.
|
|
99
|
+
- Treat schema output as the absolute source of truth even if examples or memory disagree.
|
|
100
|
+
- Prefer the highest valid `typeVersion` returned by schema output.
|
|
101
|
+
- For fixed collections such as Switch/If rules, Wait form fields, or nested options, read the full `node-info` output before writing values.
|
|
102
|
+
|
|
103
|
+
## Knowledge Commands
|
|
104
|
+
|
|
105
|
+
Use these commands instead of guessing:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
{{N8NAC_SKILLS_CMD}} search "<node or capability>"
|
|
109
|
+
{{N8NAC_SKILLS_CMD}} node-info <nodeName>
|
|
110
|
+
{{N8NAC_SKILLS_CMD}} node-schema <nodeName>
|
|
111
|
+
{{N8NAC_SKILLS_CMD}} docs "<topic>"
|
|
112
|
+
{{N8NAC_SKILLS_CMD}} guides "<topic>"
|
|
113
|
+
{{N8NAC_SKILLS_CMD}} examples search "<workflow pattern>"
|
|
114
|
+
{{N8NAC_SKILLS_CMD}} examples info <id>
|
|
115
|
+
{{N8NAC_SKILLS_CMD}} examples download <id>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
- Start with `examples search` when the user asks for a common automation pattern.
|
|
119
|
+
- Use examples to learn patterns, not as authority over current node schemas.
|
|
120
|
+
- If a command or flag is unfamiliar, run `{{N8NAC_CMD}} <subcommand> --help`; do not invent flags.
|
|
121
|
+
|
|
122
|
+
## Workflow Authoring Rules
|
|
123
|
+
|
|
124
|
+
- Use TypeScript decorators from `@n8n-as-code/transformer`.
|
|
125
|
+
- Regular nodes connect with `source.out(0).to(target.in(0))`.
|
|
126
|
+
- AI sub-nodes connect with `.uses()`, never `.out().to()`.
|
|
127
|
+
- `ai_tool` and `ai_document` connections are arrays: `ai_tool: [this.Tool.output]`.
|
|
128
|
+
- Other AI connection types are single refs, such as `ai_languageModel: this.Model.output`.
|
|
129
|
+
- Check `node-info` for connection-dependent boolean flags before declaring `.uses()` connections.
|
|
130
|
+
|
|
131
|
+
Every `.workflow.ts` file starts with a `<workflow-map>` block. Read that map first, locate the property name you need, then read only the relevant class section.
|
|
132
|
+
|
|
133
|
+
### Minimal Workflow Structure
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { workflow, node, links } from '@n8n-as-code/transformer';
|
|
137
|
+
|
|
138
|
+
@workflow({
|
|
139
|
+
name: 'Workflow Name',
|
|
140
|
+
active: false
|
|
141
|
+
})
|
|
142
|
+
export class MyWorkflow {
|
|
143
|
+
@node({
|
|
144
|
+
name: 'Descriptive Name',
|
|
145
|
+
type: '/* exact type from node-info */',
|
|
146
|
+
version: 4,
|
|
147
|
+
position: [250, 300]
|
|
148
|
+
})
|
|
149
|
+
MyNode = {
|
|
150
|
+
/* parameters from node-info */
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
@node({
|
|
154
|
+
name: 'Next Node',
|
|
155
|
+
type: '/* exact type from node-info */',
|
|
156
|
+
version: 3,
|
|
157
|
+
position: [520, 300]
|
|
158
|
+
})
|
|
159
|
+
NextNode = {};
|
|
160
|
+
|
|
161
|
+
@links()
|
|
162
|
+
defineRouting() {
|
|
163
|
+
this.MyNode.out(0).to(this.NextNode.in(0));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Expression Syntax
|
|
169
|
+
|
|
170
|
+
- Prefer modern expressions: `{{ $json.fieldName }}`.
|
|
171
|
+
- Use specific-node expressions when needed: `{{ $('Node Name').item.json.field }}`.
|
|
172
|
+
- Avoid legacy `$node["Name"].json.field` unless you are preserving an existing workflow and have a reason.
|
|
173
|
+
- In Switch/If comparisons, `value1` is the expression being evaluated and `value2` is the literal comparison value.
|
|
174
|
+
|
|
175
|
+
### Node Naming
|
|
176
|
+
|
|
177
|
+
- Use descriptive names such as `Get Customers`, `Send Slack Alert`, or `Normalize Payload`.
|
|
178
|
+
- Avoid names like `Node1`, `HTTP Request`, or `Code` when a more specific name is available.
|
|
179
|
+
- Connection references must match the exact node property names in the TypeScript class.
|
|
180
|
+
|
|
181
|
+
## Reading Workflow Files Efficiently
|
|
182
|
+
|
|
183
|
+
Use the `<workflow-map>` block as the index before loading large workflow files.
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
// <workflow-map>
|
|
187
|
+
// Workflow : My Workflow
|
|
188
|
+
// Nodes : 12 | Connections: 14
|
|
189
|
+
//
|
|
190
|
+
// NODE INDEX
|
|
191
|
+
// Property name Node type (short) Flags
|
|
192
|
+
// ScheduleTrigger scheduleTrigger
|
|
193
|
+
// AgentGenerateApplication agent [AI] [creds]
|
|
194
|
+
// OpenaiChatModel lmChatOpenAi [creds] [ai_languageModel]
|
|
195
|
+
// Memory memoryBufferWindow [ai_memory]
|
|
196
|
+
// GithubCheckBranchRef httpRequest [onError->out(1)]
|
|
197
|
+
//
|
|
198
|
+
// ROUTING MAP
|
|
199
|
+
// ScheduleTrigger
|
|
200
|
+
// -> Configuration
|
|
201
|
+
// -> BuildProfileSources -> LoopOverProfileSources
|
|
202
|
+
//
|
|
203
|
+
// AI CONNECTIONS
|
|
204
|
+
// AgentGenerateApplication.uses({ ai_languageModel: OpenaiChatModel, ai_memory: Memory })
|
|
205
|
+
// </workflow-map>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Navigation rule:
|
|
209
|
+
|
|
210
|
+
1. Read `<workflow-map>` first.
|
|
211
|
+
2. Locate the property name you need.
|
|
212
|
+
3. Search for that property in the file.
|
|
213
|
+
4. Read only the relevant node or routing section unless broader context is required.
|
|
214
|
+
|
|
215
|
+
## AI And LangChain Node Rules
|
|
216
|
+
|
|
217
|
+
AI sub-nodes are not regular data-flow nodes.
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
@links()
|
|
221
|
+
defineRouting() {
|
|
222
|
+
this.ChatTrigger.out(0).to(this.AiAgent.in(0));
|
|
223
|
+
|
|
224
|
+
this.AiAgent.uses({
|
|
225
|
+
ai_languageModel: this.OpenaiModel.output,
|
|
226
|
+
ai_memory: this.Memory.output,
|
|
227
|
+
ai_outputParser: this.OutputParser.output,
|
|
228
|
+
ai_tool: [this.SearchTool.output],
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
- Use `.uses()` for language models, memory, tools, parsers, embeddings, vector stores, retrievers, and other AI sub-nodes.
|
|
234
|
+
- Never connect AI sub-nodes with `.out().to()`.
|
|
235
|
+
- `ai_tool` and `ai_document` must be arrays.
|
|
236
|
+
- Most other AI connection types are single refs.
|
|
237
|
+
- Some nodes require boolean flags to expose AI ports or gated parameters. Check `node-info` before declaring `.uses()`.
|
|
238
|
+
|
|
239
|
+
## Common Mistakes To Avoid
|
|
240
|
+
|
|
241
|
+
- Wrong node type: use the exact full type returned by schema output, including package prefix when provided.
|
|
242
|
+
- Outdated or non-existent typeVersion: use a value from the schema output.
|
|
243
|
+
- Invalid operation/resource value: use exact option values from the schema.
|
|
244
|
+
- Mismatched resource and operation: each resource enables its own operations.
|
|
245
|
+
- Guessing nested structures: fixed collections have exact shapes.
|
|
246
|
+
- Wrong connection names: match TypeScript property names exactly.
|
|
247
|
+
- Inventing nodes, credentials, operations, or parameters.
|
|
248
|
+
- Connecting AI sub-nodes with `.out().to()`.
|
|
249
|
+
- Using `ai_tool: this.Tool.output` instead of `ai_tool: [this.Tool.output]`.
|
|
250
|
+
- Inverting Switch/If `value1` and `value2`.
|
|
251
|
+
- Using old Wait form structures such as `formFieldsUi.fieldItems` when the current schema expects `formFields: { values: [...] }`.
|
|
252
|
+
- Passing a bare filename to `push`.
|
|
253
|
+
- Treating Class A runtime/config gaps as workflow-code bugs.
|
|
254
|
+
|
|
255
|
+
## Verify, Test, And Present
|
|
256
|
+
|
|
257
|
+
After pushing:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
{{N8NAC_CMD}} verify <workflowId>
|
|
261
|
+
{{N8NAC_CMD}} test-plan <workflowId> --json
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
For webhook, chat, or form workflows, prefer the production test sequence:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
{{N8NAC_CMD}} workflow activate <workflowId>
|
|
268
|
+
{{N8NAC_CMD}} test <workflowId> --prod
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
- Class A configuration gaps require user/config action, not workflow rewrites.
|
|
272
|
+
- Runtime-state issues such as unarmed test webhooks are not workflow-code bugs.
|
|
273
|
+
- Class B wiring errors are fixable in the workflow file.
|
|
274
|
+
- Stop after two repeated failures with the same diagnostic.
|
|
275
|
+
|
|
276
|
+
## Workflow Presentation Contract
|
|
277
|
+
|
|
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.
|
|
279
|
+
|
|
280
|
+
Run it whenever one of these is true:
|
|
281
|
+
|
|
282
|
+
- you created a workflow;
|
|
283
|
+
- you modified and pushed a workflow;
|
|
284
|
+
- you ran or tested a workflow and the user needs to inspect it;
|
|
285
|
+
- the user asks to show, open, present, display, or give the URL/link for a workflow.
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
{{N8N_MANAGER_CMD}} presentWorkflowResult --workflow-id <workflowId> --workspace-root <contextRoot>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Rules:
|
|
292
|
+
|
|
293
|
+
- Do not manually construct n8n workflow URLs.
|
|
294
|
+
- 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.
|
|
296
|
+
- If you do not know the workflow ID, run `{{N8NAC_CMD}} 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.
|
|
298
|
+
- Do this before the final response when the task created, changed, pushed, ran, or explicitly asks to show a workflow.
|
|
299
|
+
|
|
300
|
+
### Testability Protocol
|
|
301
|
+
|
|
302
|
+
For webhook, chat, or form workflows:
|
|
303
|
+
|
|
304
|
+
1. Push with verification when possible.
|
|
305
|
+
2. Run `test-plan` to inspect trigger type, endpoint, and suggested payload.
|
|
306
|
+
3. Activate the workflow.
|
|
307
|
+
4. Test with `--prod` by default.
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
{{N8NAC_CMD}} push <path-to-workflow.workflow.ts> --verify
|
|
311
|
+
{{N8NAC_CMD}} test-plan <workflowId> --json
|
|
312
|
+
{{N8NAC_CMD}} workflow activate <workflowId>
|
|
313
|
+
{{N8NAC_CMD}} test <workflowId> --prod
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Use bare `{{N8NAC_CMD}} test <workflowId>` only when a test URL was intentionally armed in the n8n editor.
|
|
317
|
+
|
|
318
|
+
For GET/HEAD webhooks that read from `$json.query`, prefer:
|
|
319
|
+
|
|
320
|
+
```bash
|
|
321
|
+
{{N8NAC_CMD}} test <workflowId> --query '{"key":"value"}' --prod
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## Execution Debugging
|
|
325
|
+
|
|
326
|
+
If a webhook returns success but the workflow behavior is wrong, inspect executions instead of guessing:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
{{N8NAC_CMD}} execution list --workflow-id <workflowId> --limit 5 --json
|
|
330
|
+
{{N8NAC_CMD}} execution get <executionId> --include-data --json
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
- A successful HTTP trigger only means n8n accepted the request.
|
|
334
|
+
- The execution can still fail later inside the workflow.
|
|
335
|
+
- Use execution data to identify the failing node and real payload shape.
|
|
336
|
+
|
|
337
|
+
## Credential Workflow
|
|
338
|
+
|
|
339
|
+
When a workflow is blocked by missing credentials, resolve the credential gap without rewriting unrelated workflow logic.
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
{{N8NAC_CMD}} workflow credential-required <workflowId> --json
|
|
343
|
+
{{N8NAC_CMD}} credential schema <type>
|
|
344
|
+
{{N8NAC_CMD}} credential list --json
|
|
345
|
+
{{N8NAC_CMD}} credential create --type <type> --name <name> --file cred.json --json
|
|
346
|
+
{{N8NAC_CMD}} workflow activate <workflowId>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
- `workflow credential-required` exits non-zero when at least one credential is missing. Treat that as a signal to act, not as a workflow-code failure.
|
|
350
|
+
- Use `credential schema` to discover required fields.
|
|
351
|
+
- Ask the user for secret values when needed.
|
|
352
|
+
- Prefer `--file` for credential creation. Do not pass secrets inline in shell arguments.
|
|
353
|
+
- Do not print API keys or credential secret values back to the user.
|
|
354
|
+
- If credential creation fails, read the validation message and change the payload before retrying.
|
|
355
|
+
|
|
356
|
+
## Operating Loop
|
|
357
|
+
|
|
358
|
+
For most workflow tasks:
|
|
359
|
+
|
|
360
|
+
1. Resolve context with `workspace status --json`.
|
|
361
|
+
2. Read `workflowDir` from the backend response.
|
|
362
|
+
3. Inspect existing workflows with `list`.
|
|
363
|
+
4. Pull before editing an existing workflow.
|
|
364
|
+
5. Search examples and schemas.
|
|
365
|
+
6. Edit or create the `.workflow.ts` file.
|
|
366
|
+
7. Validate locally.
|
|
367
|
+
8. Push with `--verify`.
|
|
368
|
+
9. Test if the workflow is HTTP-triggered.
|
|
369
|
+
10. Inspect executions when behavior is unclear.
|
|
370
|
+
11. Present the final workflow link with `presentWorkflowResult`.
|
|
371
|
+
|
|
372
|
+
## Response Discipline
|
|
373
|
+
|
|
374
|
+
- 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.
|
|
378
|
+
- Do not tell the user to run setup commands when you can run non-interactive commands yourself.
|
|
379
|
+
- Stop after two repeated failures with the same diagnostic and report the backend error clearly.
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
- {{N8NAC_CONTEXT_ROOT_HINT}}
|
|
13
|
+
- If `n8nac` is available, first run `{{N8NAC_CMD}} 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 `{{N8N_MANAGER_CMD}}` for global instance, auth, runtime, tunnel, project-default, credential, and workflow-presentation operations.
|
|
16
|
+
- Use `{{N8NAC_CMD}} workspace ...` only for context-root overrides such as pinned instance, sync folder, and project override.
|
|
17
|
+
- Use `{{N8NAC_CMD}}` 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
|
+
{{N8N_MANAGER_CMD}} instances list
|
|
26
|
+
{{N8N_MANAGER_CMD}} instances --help
|
|
27
|
+
{{N8N_MANAGER_CMD}} 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
|
+
{{N8N_MANAGER_CMD}} instances add --name <name> --mode managed-local-docker
|
|
57
|
+
{{N8N_MANAGER_CMD}} instances setup <id-or-name>
|
|
58
|
+
{{N8N_MANAGER_CMD}} instances start <id-or-name>
|
|
59
|
+
{{N8N_MANAGER_CMD}} instances status <id-or-name>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Managed local Docker with public tunnel:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
{{N8N_MANAGER_CMD}} instances add --name <name> --mode managed-local-docker --tunnel
|
|
66
|
+
{{N8N_MANAGER_CMD}} instances setup <id-or-name> --tunnel
|
|
67
|
+
{{N8N_MANAGER_CMD}} instances start <id-or-name>
|
|
68
|
+
{{N8N_MANAGER_CMD}} 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
|
+
{{N8N_MANAGER_CMD}} auth set --url <url> --api-key-stdin --name <name>
|
|
75
|
+
{{N8N_MANAGER_CMD}} 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
|
+
{{N8N_MANAGER_CMD}} projects list --instance <id-or-name>
|
|
82
|
+
{{N8N_MANAGER_CMD}} 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
|
+
{{N8NAC_CMD}} workspace set-project --project-id personal --project-name Personal
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Runtime and tunnel operations are per instance:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
{{N8N_MANAGER_CMD}} instances start <id-or-name>
|
|
95
|
+
{{N8N_MANAGER_CMD}} instances stop <id-or-name>
|
|
96
|
+
{{N8N_MANAGER_CMD}} instances restart <id-or-name>
|
|
97
|
+
{{N8N_MANAGER_CMD}} instances tunnel status <id-or-name>
|
|
98
|
+
{{N8N_MANAGER_CMD}} instances tunnel start <id-or-name>
|
|
99
|
+
{{N8N_MANAGER_CMD}} instances tunnel refresh <id-or-name>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Present workflow results after creating, modifying, pushing, or running a workflow:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
{{N8N_MANAGER_CMD}} 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.
|