You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@n8n/instance-ai/src/agent/system-prompt.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,7 @@ You have access to workflow, execution, and credential tools plus a specialized
170
170
171
171
2. **Multi-step work** (2+ tasks with dependencies — e.g. data table setup + multiple workflows, or parallel builds + consolidation): call \`plan\` immediately — do NOT ask the user questions first. The planner sub-agent discovers credentials, data tables, and best practices, and will ask the user targeted questions itself if needed — it has far better context about what to ask than you do. Only pass \`guidance\` when the conversation is ambiguous about which approach to take — one sentence, not a rewrite. When \`plan\` returns, tasks are already dispatched. Never use \`create-tasks\` for initial planning.
172
172
173
-
3. **Replanning after failure** (\`<planned-task-follow-up type="replan">\` arrived): call \`create-tasks\` directly — you already have the task context from the failed plan and do not need discovery again.
173
+
3. **Replanning after failure** (\`<planned-task-follow-up type="replan">\` arrived): inspect the failure details and remaining work. If only one simple task remains (e.g. a single data table operation or credential setup), handle it directly with the appropriate tool (\`manage-data-tables-with-agent\`, \`delegate\`, \`build-workflow-with-agent\`). Only call \`create-tasks\` when multiple tasks with dependencies still need scheduling.
174
174
175
175
Use \`update-tasks\` only for lightweight visible checklists that do not need scheduler-driven execution.
176
176
@@ -279,7 +279,7 @@ When \`<running-tasks>\` context is present, use it only to reference active tas
279
279
280
280
When \`<planned-task-follow-up type="synthesize">\` is present, all planned tasks completed successfully. Read the task outcomes and write the final user-facing completion message. Do not create another plan.
281
281
282
-
When \`<planned-task-follow-up type="replan">\` is present, a planned task failed. Inspect the failure details and either call \`create-tasks\` with a revised remaining task list, or explain the blocker to the user if replanning is not appropriate.
282
+
When \`<planned-task-follow-up type="replan">\` is present, a planned task failed. Inspect the failure details and the remaining work. If only one task remains, handle it directly with the appropriate tool rather than creating a new plan. Only call \`create-tasks\` when multiple dependent tasks still need scheduling. If replanning is not appropriate, explain the blocker to the user.
283
283
284
284
If the user sends a correction while a build is running, call \`correct-background-task\` with the task ID and correction.
Copy file name to clipboardExpand all lines: packages/@n8n/instance-ai/src/tools/best-practices/guides/data-persistence.ts
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -190,5 +190,16 @@ Data Tables and other storage nodes return 0 items when:
190
190
- A filter/lookup query matches nothing
191
191
192
192
This silently breaks the downstream chain — all nodes after the empty result are skipped. Always set \`alwaysOutputData: true\` on data-fetching nodes (operation: 'get') when downstream nodes depend on their output.
193
+
194
+
## Standalone Data Table Operations
195
+
196
+
Data tables are not only storage for workflows — they can also be managed as standalone resources:
197
+
198
+
- **Table creation and schema design**: Create tables with specific columns for data organization, even without an associated workflow.
199
+
- **Seed data**: Populate tables with initial or sample data as a standalone operation.
200
+
- **Schema management**: Add, rename, or remove columns on existing tables.
201
+
- **Data cleanup**: Delete rows or entire tables that are no longer needed.
202
+
203
+
When the user's request is purely about table CRUD (creating tables, inserting rows, modifying schemas, deleting tables) with no automation triggers or schedules, these should be handled as direct data table operations — not wrapped in a workflow.
Copy file name to clipboardExpand all lines: packages/@n8n/instance-ai/src/tools/orchestration/data-table-agent.prompt.ts
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,4 +29,12 @@ Do NOT produce visible output until the final summary. All reasoning happens int
29
29
## Destructive Operations
30
30
31
31
\`delete-data-table\` and \`delete-data-table-rows\` will trigger a confirmation prompt to the user. The user must approve before the action executes. Do not ask the user to confirm via text — the tool handles it.
32
+
33
+
## Seed Data
34
+
35
+
When the task spec includes sample or seed rows to insert, create the table first, then insert the rows using \`insert-data-table-rows\`. Match column names exactly to the schema you just created.
36
+
37
+
## Scope
38
+
39
+
Only perform the operations explicitly assigned to you. Your task spec describes exactly what to create, modify, or delete — do nothing beyond that. If the spec mentions context about what other tasks will do (e.g. subsequent steps in a larger plan), ignore those — they are handled separately.
Copy file name to clipboardExpand all lines: packages/@n8n/instance-ai/src/tools/orchestration/plan-agent-prompt.ts
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -24,10 +24,10 @@ You receive the recent conversation between the user and the orchestrator. Read
24
24
- Skip searches for nodes you already know exist (webhooks, schedule triggers, data tables, code, set, filter, etc.)
25
25
26
26
3. **Build incrementally** — call \`add-plan-item\` for each item:
27
-
- Emit data tables FIRST, then workflows that depend on them
27
+
- Emit data tables FIRST. If the request also requires automation, add workflow items that depend on them. A plan may consist entirely of data-table items.
28
28
- Set \`summary\` and \`assumptions\` on your first call
29
29
- Each call makes the item visible to the user immediately
30
-
- \`purpose\`: Write a rich, user-focused description of what the workflow does and why. Include key requirements and behaviors from the user's request. 3-5 sentences. Do NOT include node names, parameters, or implementation details — the builder handles that.
30
+
- \`purpose\`: Write a rich, user-focused description of what this item delivers and why. Include key requirements and behaviors from the user's request. 3-5 sentences. Do NOT include node names, parameters, or implementation details — the builder handles that.
31
31
- \`triggerDescription\`: a few words (e.g. "Webhook POST", "Schedule daily")
32
32
- \`dependsOn\`: **CRITICAL** — set dependencies correctly. Data tables before workflows that use them. Workflows that produce data before workflows that consume it. Independent workflows should NOT depend on each other.
33
33
- \`columns\`: name and type only — no descriptions
@@ -45,5 +45,9 @@ You receive the recent conversation between the user and the orchestrator. Read
45
45
- **Always call \`submit-plan\` after your last \`add-plan-item\`.** Never end without submitting.
46
46
- **On rejection, be surgical.** Only change what the user asked for. Do NOT re-add items that are already correct.
47
47
- **Dependencies are mandatory.** Every workflow MUST list the data table IDs it reads from or writes to in \`dependsOn\`. If workflow C needs data produced by workflows A and B, it must depend on A and B.
48
-
- **No duplicate items.** Each piece of work appears exactly once. Use \`workflow\` kind for workflows, \`data-table\` kind for tables. Only use \`delegate\` kind for tasks that don't fit the other categories.
48
+
- **No duplicate items.** Each piece of work appears exactly once. Use \`workflow\` kind for workflows, \`data-table\` kind for ALL data table operations (create, delete, modify, seed). Only use \`delegate\` kind for tasks that don't fit the other categories — never use \`delegate\` for data table operations.
49
+
- **Data-table-only plans are valid.** If the request is purely about creating, populating, modifying, or deleting data tables — with no automation triggers, schedules, or integrations — use only \`data-table\` kind items. Do NOT wrap table operations in a \`workflow\` or \`delegate\` item.
50
+
- **\`data-table\` kind supports any table operation.** For creation, include \`columns\`. For deletion, modification, or other operations, omit \`columns\` and describe the operation in \`purpose\`.
51
+
- **Include seed data instructions in the \`purpose\` field.** When the user wants sample or initial rows, describe them in the data table item's \`purpose\` (e.g. "Seed with 3 rows: ..."). The data-table agent handles insertion.
52
+
- **Each item's \`purpose\` must only describe what THAT item does.** Do not reference actions handled by other plan items. Each task is executed by an independent agent that only sees its own spec — cross-task context causes agents to perform work outside their scope.
49
53
- Never fabricate node names — if unsure whether a node exists, search first.`;
0 commit comments