Skip to content

Commit 153fae2

Browse files
authored
fix(ai-builder): Prevent orchestrator and planner from assuming resource identifiers (no-changelog) (n8n-io#28342)
1 parent 2c4b974 commit 153fae2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/@n8n/instance-ai/src/agent/system-prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Never use \`delegate\` to build, patch, fix, or update workflows — delegate do
188188
189189
To fix or modify an existing workflow, use a \`build-workflow\` task (via \`plan\` if multi-step, or \`build-workflow-with-agent\` directly if single) with the existing workflow ID and a spec describing what to change.
190190
191-
The detached builder handles node discovery, schema lookups, resource discovery, code generation, validation, and saving. Describe **what** to build (or fix), not **how**: user goal, integrations, credential names, data flow, data table schemas. Don't specify node types or parameter configurations.
191+
The detached builder handles node discovery, schema lookups, resource discovery, code generation, validation, and saving. Describe **what** to build (or fix), not **how**: user goal, integrations, credential names, data flow, data table schemas. Don't specify node types or parameter configurations. Mention integrations by service name (Slack, Google Calendar) but don't specify which channels, calendars, spreadsheets, folders, or other resources to use — the builder resolves real resource IDs at build time.
192192
193193
Always pass \`conversationContext\` when spawning background agents (\`build-workflow-with-agent\`, \`delegate\`, \`research-with-agent\`, \`manage-data-tables-with-agent\`) — summarize what was discussed, decisions made, and information gathered. Exception: \`plan\` reads the conversation history directly — only pass \`guidance\` if the context is ambiguous.
194194

packages/@n8n/instance-ai/src/tools/orchestration/plan-agent-prompt.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ You receive the recent conversation between the user and the orchestrator. Read
1313
1. **Prefer assumptions over questions.** The user is waiting for a plan, and they can reject it if your assumptions are wrong — so default to making reasonable choices rather than asking.
1414
- **Never ask about things you can discover** — call \`list-credentials\`, \`list-data-tables\`, \`get-best-practices\` instead.
1515
- **Never ask about implementation details** — trigger types, node choices, schedule times, column names. Pick sensible defaults.
16+
- **Never default resource identifiers** the user didn't mention (Slack channels, calendars, spreadsheets, folders, etc.) — leave them for the builder to resolve at build time.
1617
- **Do ask when the answer would significantly change the plan** — e.g. the user's goal is ambiguous ("build me a CRM" — for sales? support? recruiting?), or a business rule must come from the user ("what should happen when payment fails?").
1718
- **List your assumptions** on your first \`add-plan-item\` call. The user reviews the plan before execution and can reject/correct.
1819
@@ -28,10 +29,11 @@ You receive the recent conversation between the user and the orchestrator. Read
2829
- Set \`summary\` and \`assumptions\` on your first call
2930
- Each call makes the item visible to the user immediately
3031
- \`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-
- \`triggerDescription\`: a few words (e.g. "Webhook POST", "Schedule daily")
32+
- \`triggerDescription\`: a few words describing trigger type (e.g. "Webhook POST", "Schedule daily"), no resource identifiers
33+
- \`integrations\`: service names only (e.g. "Slack", "Google Calendar"), no resource identifiers or qualifiers
3234
- \`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.
3335
- \`columns\`: name and type only — no descriptions
34-
- \`assumptions\`: only non-obvious ones
36+
- \`assumptions\`: design decisions only, no resource identifiers (channels, calendars, etc.)
3537
- Use \`research\` kind for tasks requiring web research before other tasks can proceed (e.g. "find the API endpoint format for service X"). Research tasks run a dedicated web research agent.
3638
- After all items are added, call \`submit-plan\` to request user approval.
3739

0 commit comments

Comments
 (0)