@n8n/instance-ai 1.3.5 → 1.5.0

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.
Files changed (195) hide show
  1. package/dist/agent/credential-guardrails.prompt.d.ts +1 -0
  2. package/dist/agent/credential-guardrails.prompt.js +5 -0
  3. package/dist/agent/credential-guardrails.prompt.js.map +1 -0
  4. package/dist/agent/instance-agent.js +0 -1
  5. package/dist/agent/instance-agent.js.map +1 -1
  6. package/dist/agent/shared-prompts.d.ts +4 -0
  7. package/dist/agent/shared-prompts.js +17 -0
  8. package/dist/agent/shared-prompts.js.map +1 -0
  9. package/dist/agent/sub-agent-debriefing.d.ts +2 -2
  10. package/dist/agent/sub-agent-factory.d.ts +1 -1
  11. package/dist/agent/sub-agent-factory.js +7 -7
  12. package/dist/agent/sub-agent-factory.js.map +1 -1
  13. package/dist/agent/system-prompt.js +56 -29
  14. package/dist/agent/system-prompt.js.map +1 -1
  15. package/dist/build.tsbuildinfo +1 -1
  16. package/dist/constants/max-steps.d.ts +1 -1
  17. package/dist/constants/max-steps.js +1 -1
  18. package/dist/constants/max-steps.js.map +1 -1
  19. package/dist/constants/model-settings.d.ts +3 -0
  20. package/dist/constants/model-settings.js +7 -0
  21. package/dist/constants/model-settings.js.map +1 -0
  22. package/dist/index.d.ts +9 -3
  23. package/dist/index.js +10 -2
  24. package/dist/index.js.map +1 -1
  25. package/dist/logger.d.ts +6 -0
  26. package/dist/planned-tasks/planned-task-permissions.d.ts +2 -0
  27. package/dist/planned-tasks/planned-task-permissions.js +8 -2
  28. package/dist/planned-tasks/planned-task-permissions.js.map +1 -1
  29. package/dist/planned-tasks/planned-task-service.d.ts +14 -1
  30. package/dist/planned-tasks/planned-task-service.js +138 -2
  31. package/dist/planned-tasks/planned-task-service.js.map +1 -1
  32. package/dist/runtime/background-task-manager.d.ts +25 -1
  33. package/dist/runtime/background-task-manager.js +66 -2
  34. package/dist/runtime/background-task-manager.js.map +1 -1
  35. package/dist/runtime/builder-sandbox-session-registry.d.ts +45 -0
  36. package/dist/runtime/builder-sandbox-session-registry.js +159 -0
  37. package/dist/runtime/builder-sandbox-session-registry.js.map +1 -0
  38. package/dist/runtime/run-state-registry.d.ts +7 -4
  39. package/dist/runtime/run-state-registry.js +9 -0
  40. package/dist/runtime/run-state-registry.js.map +1 -1
  41. package/dist/storage/agent-tree-snapshot.d.ts +2 -0
  42. package/dist/storage/planned-task-storage.js +2 -1
  43. package/dist/storage/planned-task-storage.js.map +1 -1
  44. package/dist/storage/workflow-loop-storage.d.ts +292 -12
  45. package/dist/stream/consume-with-hitl.d.ts +1 -0
  46. package/dist/stream/consume-with-hitl.js +1 -0
  47. package/dist/stream/consume-with-hitl.js.map +1 -1
  48. package/dist/tools/credentials.tool.js +20 -3
  49. package/dist/tools/credentials.tool.js.map +1 -1
  50. package/dist/tools/data-tables.tool.js +60 -22
  51. package/dist/tools/data-tables.tool.js.map +1 -1
  52. package/dist/tools/executions.tool.js +4 -1
  53. package/dist/tools/executions.tool.js.map +1 -1
  54. package/dist/tools/index.d.ts +1 -2
  55. package/dist/tools/index.js +2 -3
  56. package/dist/tools/index.js.map +1 -1
  57. package/dist/tools/nodes/suggested-nodes-data.js +1 -1
  58. package/dist/tools/nodes/suggested-nodes-data.js.map +1 -1
  59. package/dist/tools/nodes.tool.js +25 -13
  60. package/dist/tools/nodes.tool.js.map +1 -1
  61. package/dist/tools/orchestration/add-plan-item.tool.js +3 -1
  62. package/dist/tools/orchestration/add-plan-item.tool.js.map +1 -1
  63. package/dist/tools/orchestration/blueprint-accumulator.d.ts +4 -1
  64. package/dist/tools/orchestration/blueprint-accumulator.js +28 -0
  65. package/dist/tools/orchestration/blueprint-accumulator.js.map +1 -1
  66. package/dist/tools/orchestration/blueprint.schema.d.ts +60 -15
  67. package/dist/tools/orchestration/blueprint.schema.js +15 -1
  68. package/dist/tools/orchestration/blueprint.schema.js.map +1 -1
  69. package/dist/tools/orchestration/browser-credential-setup.prompt.d.ts +13 -0
  70. package/dist/tools/orchestration/browser-credential-setup.prompt.js +140 -0
  71. package/dist/tools/orchestration/browser-credential-setup.prompt.js.map +1 -0
  72. package/dist/tools/orchestration/browser-credential-setup.tool.d.ts +1 -0
  73. package/dist/tools/orchestration/browser-credential-setup.tool.js +8 -139
  74. package/dist/tools/orchestration/browser-credential-setup.tool.js.map +1 -1
  75. package/dist/tools/orchestration/build-workflow-agent.prompt.js +137 -239
  76. package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
  77. package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +51 -3
  78. package/dist/tools/orchestration/build-workflow-agent.tool.js +842 -269
  79. package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
  80. package/dist/tools/orchestration/builder-memory-compaction.d.ts +38 -0
  81. package/dist/tools/orchestration/builder-memory-compaction.js +146 -0
  82. package/dist/tools/orchestration/builder-memory-compaction.js.map +1 -0
  83. package/dist/tools/orchestration/complete-checkpoint.tool.d.ts +2 -0
  84. package/dist/tools/orchestration/complete-checkpoint.tool.js +76 -0
  85. package/dist/tools/orchestration/complete-checkpoint.tool.js.map +1 -0
  86. package/dist/tools/orchestration/data-table-agent.prompt.d.ts +1 -1
  87. package/dist/tools/orchestration/data-table-agent.prompt.js +4 -6
  88. package/dist/tools/orchestration/data-table-agent.prompt.js.map +1 -1
  89. package/dist/tools/orchestration/data-table-agent.tool.js +34 -18
  90. package/dist/tools/orchestration/data-table-agent.tool.js.map +1 -1
  91. package/dist/tools/orchestration/delegate.tool.js +33 -17
  92. package/dist/tools/orchestration/delegate.tool.js.map +1 -1
  93. package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -1
  94. package/dist/tools/orchestration/plan-agent-prompt.js +17 -17
  95. package/dist/tools/orchestration/plan-agent-prompt.js.map +1 -1
  96. package/dist/tools/orchestration/plan-with-agent.tool.d.ts +8 -0
  97. package/dist/tools/orchestration/plan-with-agent.tool.js +43 -12
  98. package/dist/tools/orchestration/plan-with-agent.tool.js.map +1 -1
  99. package/dist/tools/orchestration/plan.tool.js +82 -2
  100. package/dist/tools/orchestration/plan.tool.js.map +1 -1
  101. package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +40 -2
  102. package/dist/tools/orchestration/report-verification-verdict.tool.js +89 -7
  103. package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
  104. package/dist/tools/orchestration/research-agent-prompt.d.ts +1 -1
  105. package/dist/tools/orchestration/research-agent-prompt.js +2 -4
  106. package/dist/tools/orchestration/research-agent-prompt.js.map +1 -1
  107. package/dist/tools/orchestration/research-with-agent.tool.js +33 -17
  108. package/dist/tools/orchestration/research-with-agent.tool.js.map +1 -1
  109. package/dist/tools/orchestration/verify-built-workflow.tool.d.ts +8 -2
  110. package/dist/tools/orchestration/verify-built-workflow.tool.js +476 -6
  111. package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
  112. package/dist/tools/research.tool.js +2 -2
  113. package/dist/tools/research.tool.js.map +1 -1
  114. package/dist/tools/shared/ask-user.tool.js +2 -1
  115. package/dist/tools/shared/ask-user.tool.js.map +1 -1
  116. package/dist/tools/templates.tool.js +5 -90
  117. package/dist/tools/templates.tool.js.map +1 -1
  118. package/dist/tools/web-research/sanitize-web-content.d.ts +0 -1
  119. package/dist/tools/web-research/sanitize-web-content.js +0 -9
  120. package/dist/tools/web-research/sanitize-web-content.js.map +1 -1
  121. package/dist/tools/workflows/apply-workflow-credentials.tool.d.ts +2 -2
  122. package/dist/tools/workflows/build-workflow.tool.d.ts +8 -8
  123. package/dist/tools/workflows/build-workflow.tool.js +14 -2
  124. package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
  125. package/dist/tools/workflows/materialize-node-type.tool.d.ts +8 -8
  126. package/dist/tools/workflows/resolve-credentials.js +6 -6
  127. package/dist/tools/workflows/resolve-credentials.js.map +1 -1
  128. package/dist/tools/workflows/setup-workflow.service.js +3 -2
  129. package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
  130. package/dist/tools/workflows/submit-workflow-identity.d.ts +35 -0
  131. package/dist/tools/workflows/submit-workflow-identity.js +154 -0
  132. package/dist/tools/workflows/submit-workflow-identity.js.map +1 -0
  133. package/dist/tools/workflows/submit-workflow.tool.d.ts +82 -3
  134. package/dist/tools/workflows/submit-workflow.tool.js +114 -35
  135. package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
  136. package/dist/tracing/langsmith-tracing.d.ts +12 -0
  137. package/dist/tracing/langsmith-tracing.js +35 -3
  138. package/dist/tracing/langsmith-tracing.js.map +1 -1
  139. package/dist/tracing/trace-replay.d.ts +3 -0
  140. package/dist/tracing/trace-replay.js +65 -0
  141. package/dist/tracing/trace-replay.js.map +1 -1
  142. package/dist/types.d.ts +82 -12
  143. package/dist/utils/eval-agents.js +4 -2
  144. package/dist/utils/eval-agents.js.map +1 -1
  145. package/dist/workflow-builder/parse-validate.d.ts +5 -1
  146. package/dist/workflow-builder/parse-validate.js +4 -3
  147. package/dist/workflow-builder/parse-validate.js.map +1 -1
  148. package/dist/workflow-loop/guidance.js +15 -5
  149. package/dist/workflow-loop/guidance.js.map +1 -1
  150. package/dist/workflow-loop/index.d.ts +3 -2
  151. package/dist/workflow-loop/index.js +9 -1
  152. package/dist/workflow-loop/index.js.map +1 -1
  153. package/dist/workflow-loop/remediation.d.ts +13 -0
  154. package/dist/workflow-loop/remediation.js +36 -0
  155. package/dist/workflow-loop/remediation.js.map +1 -0
  156. package/dist/workflow-loop/runtime.js +7 -0
  157. package/dist/workflow-loop/runtime.js.map +1 -1
  158. package/dist/workflow-loop/workflow-loop-controller.d.ts +1 -1
  159. package/dist/workflow-loop/workflow-loop-controller.js +196 -29
  160. package/dist/workflow-loop/workflow-loop-controller.js.map +1 -1
  161. package/dist/workflow-loop/workflow-loop-state.d.ts +338 -8
  162. package/dist/workflow-loop/workflow-loop-state.js +44 -1
  163. package/dist/workflow-loop/workflow-loop-state.js.map +1 -1
  164. package/dist/workflow-loop/workflow-task-service.d.ts +2 -1
  165. package/dist/workflow-loop/workflow-task-service.js +4 -0
  166. package/dist/workflow-loop/workflow-task-service.js.map +1 -1
  167. package/dist/workspace/builder-sandbox-factory.d.ts +6 -1
  168. package/dist/workspace/builder-sandbox-factory.js +115 -26
  169. package/dist/workspace/builder-sandbox-factory.js.map +1 -1
  170. package/dist/workspace/create-workspace.d.ts +2 -0
  171. package/dist/workspace/create-workspace.js.map +1 -1
  172. package/dist/workspace/pack-workspace-sdk.d.ts +9 -0
  173. package/dist/workspace/pack-workspace-sdk.js +80 -0
  174. package/dist/workspace/pack-workspace-sdk.js.map +1 -0
  175. package/dist/workspace/sandbox-fs.d.ts +1 -1
  176. package/dist/workspace/sandbox-fs.js +3 -1
  177. package/dist/workspace/sandbox-fs.js.map +1 -1
  178. package/dist/workspace/sandbox-setup.js +83 -19
  179. package/dist/workspace/sandbox-setup.js.map +1 -1
  180. package/dist/workspace/snapshot-manager.d.ts +14 -2
  181. package/dist/workspace/snapshot-manager.js +57 -1
  182. package/dist/workspace/snapshot-manager.js.map +1 -1
  183. package/package.json +15 -8
  184. package/dist/tools/templates/template-api.d.ts +0 -21
  185. package/dist/tools/templates/template-api.js +0 -104
  186. package/dist/tools/templates/template-api.js.map +0 -1
  187. package/dist/tools/templates/types.d.ts +0 -52
  188. package/dist/tools/templates/types.js +0 -37
  189. package/dist/tools/templates/types.js.map +0 -1
  190. package/dist/tools/utils/mermaid.utils.d.ts +0 -15
  191. package/dist/tools/utils/mermaid.utils.js +0 -622
  192. package/dist/tools/utils/mermaid.utils.js.map +0 -1
  193. package/dist/tools/utils/node-configuration.utils.d.ts +0 -6
  194. package/dist/tools/utils/node-configuration.utils.js +0 -77
  195. package/dist/tools/utils/node-configuration.utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"delegate.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/delegate.tool.ts"],"names":[],"mappings":";;AAkGA,8DAuIC;AAED,gDAwKC;AAlZD,8CAAgD;AAChD,mCAAgC;AAE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ACD,CAAC,CAAC;gBAEH,OAAO,EAAE,MAAM,EAAE,oBAAoB,YAAY,EAAE,EAAE,CAAC;YACvD,CAAC;QACF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- export declare const PLANNER_AGENT_PROMPT = "You are the n8n Workflow Planner \u2014 you design solution architectures. You do NOT build workflows.\n\nYou receive the recent conversation between the user and the orchestrator. Read it to understand what the user wants, then design the blueprint.\n\n## Output Discipline\n- Be terse. You report to a parent orchestrator, not a human.\n- Do NOT produce code, node names, node configurations, or step-by-step node wiring.\n- Do NOT narrate (\"I'll search for...\", \"Let me look up\"). Just do the work.\n- No emojis, no filler, no markdown formatting in your reasoning.\n\n## Method\n\n1. **Prefer assumptions over questions.** The user is waiting for a plan, and they can reject it if your assumptions are wrong \u2014 so default to making reasonable choices rather than asking.\n - **Never ask about things you can discover** \u2014 call `credentials(action=\"list\")`, `data-tables(action=\"list\")`, `templates(action=\"best-practices\")` instead.\n - **Never ask about implementation details** \u2014 trigger types, node choices, schedule times, column names. Pick sensible defaults.\n - **Never default resource identifiers** the user didn't mention (Slack channels, calendars, spreadsheets, folders, etc.) \u2014 leave them for the builder to resolve at build time.\n - **Do ask when the answer would significantly change the plan** \u2014 e.g. the user's goal is ambiguous (\"build me a CRM\" \u2014 for sales? support? recruiting?), or a business rule must come from the user (\"what should happen when payment fails?\").\n - **List your assumptions** on your first `add-plan-item` call. The user reviews the plan before execution and can reject/correct.\n\n2. **Discover** (3-6 tool calls) \u2014 check what exists and learn best practices:\n - `templates(action=\"best-practices\")` for each relevant technique (e.g. \"form_input\", \"scheduling\", \"data_persistence\"). Call with \"list\" first to see available techniques, then fetch relevant ones. **This is important** \u2014 best practices inform your design decisions.\n - `nodes(action=\"suggested\")` for the relevant categories\n - `data-tables(action=\"list\")` to check for existing tables\n - `credentials(action=\"list\")` if the request involves external services\n - Skip searches for nodes you already know exist (webhooks, schedule triggers, data tables, code, set, filter, etc.)\n\n## Node Selection Reference\n\nUse these references when designing your plan \u2014 they help you pick the right trigger, prefer native nodes over Code, and correctly scope AI workflows.\n\n### AI Node Selection\nAI node selection guidance:\n\nAI Agent: Use for text analysis, summarization, classification, or any AI reasoning tasks.\nOpenAI node: Use only for DALL-E, Whisper, Sora, or embeddings (these are specialized APIs that AI Agent cannot access).\nDefault chat model: OpenAI Chat Model provides the lowest setup friction for new users.\nTool nodes (ending in \"Tool\"): Connect to AI Agent via ai_tool for agent-controlled actions.\nText Classifier vs AI Agent: Text Classifier for simple categorization with fixed categories; AI Agent for complex multi-step classification requiring reasoning.\nMemory nodes: Include with chatbot AI Agents to maintain conversation context across messages.\nStructured Output Parser: Prefer this over manually extracting/parsing AI output with Set or Code nodes. Define the desired schema and the LLM handles parsing automatically. Use for classification, data extraction, or any workflow where AI output feeds into database storage, API calls, or Switch routing.\n\nMulti-agent systems:\nAI Agent Tool (@n8n/n8n-nodes-langchain.agentTool) contains an embedded AI Agent \u2014 it's a complete sub-agent that the main agent can call through ai_tool. Each AgentTool needs its own Chat Model. Node selection: 1 AI Agent + N AgentTools + (N+1) Chat Models.\n\n### Node Selection by Use Case\nNode selection by use case:\n\nDOCUMENTS:\n- Document Loader: Loads documents from various sources\n- Extract From File: Extracts text content from binary files\n- AWS Textract: OCR for scanned documents\n\nDATA PROCESSING & TRANSFORMATION:\n- Aggregate: Combines multiple items into one\n- Split Out: Expands arrays into separate items\n- Loop Over Items: Processes large item sets\n- Set: Adds, modifies, or removes fields from items\n- Filter: Removes items based on conditions\n- Sort: Orders items by field values\n\nSTORAGE:\n- n8n Data Tables: Built-in database storage (no credentials required). Recommend as the default storage option.\n- Google Sheets: Spreadsheet storage and collaboration\n- Airtable: Relational database with rich field types\n\nTRIGGERS:\n- Schedule Trigger: Time-based automation\n- Gmail Trigger: Monitors for new emails\n- Form Trigger: Collects user submissions\n- Webhook: Receives HTTP requests from external services\n\nSCRAPING:\n- HTTP Request + HTML Extract: Web page content extraction\n\nNOTIFICATIONS:\n- Email nodes (Gmail, Outlook, Send Email)\n- Slack: Team messaging\n- Telegram: Bot messaging\n- Twilio: SMS messaging\n\nRESEARCH:\n- SerpAPI Tool: Web search capabilities for AI Agents\n- Perplexity Tool: AI-powered search for AI Agents\n\nCHATBOTS:\n- Slack/Telegram/WhatsApp nodes: Platform-specific chatbots\n- Chat Trigger: n8n-hosted chat interface\n\nMEDIA:\n- OpenAI: DALL-E image generation, Sora video, Whisper transcription\n- Google Gemini: Imagen image generation\n\n### Trigger Selection\nTrigger type selection:\n\nWebhook (n8n-nodes-base.webhook): External systems calling your workflow via HTTP POST/GET.\n Use when: \"receive data from X\", \"when X calls\", \"API endpoint\", \"incoming requests\"\n\nForm Trigger: User-facing forms with optional multi-step support.\n Use when: \"collect user input\", \"survey\", \"registration form\"\n\nSchedule Trigger: Time-based automation (cron-style), only runs when workflow is activated.\n Use when: \"run daily at 9am\", \"every hour\", \"weekly report\"\n\nGmail/Slack/Telegram Trigger: Platform-specific event monitoring with built-in authentication.\n Use when: \"monitor for new emails\", \"when message received\", \"watch channel\"\n\nChat Trigger: n8n-hosted chat interface for conversational AI.\n Use when: \"build a chatbot\", \"chat interface\", \"conversational assistant\"\n\nManual Trigger: For testing and one-off runs only (requires user to click \"Execute\").\n Use when: explicitly testing or debugging workflows\n\n### Native Node Preference\nPrefer native n8n nodes over Code node \u2014 native nodes provide better UX, visual debugging, and are easier for users to modify.\n\nNative node mappings:\n- Remove duplicates -> Remove Duplicates (n8n-nodes-base.removeDuplicates)\n- Filter items -> Filter: visual condition builder with multiple rules\n- Transform/map data -> Edit Fields (Set): drag-and-drop field mapping\n- Combine items -> Aggregate: groups and summarizes with built-in functions\n- Conditional routing -> IF / Switch: visual branching with clear output paths\n- Sort items -> Sort: configurable sort keys and directions\n- Regex matching -> IF with expression: use {{ $json.field.match(/pattern/) }}\n- Limit items -> Limit: simple count-based limiting\n- Compare datasets -> Compare Datasets: finds differences between two data sources\n\nReserve Code node for complex multi-step algorithms that require loops, recursion, or logic that expressions cannot handle.\n\n3. **Build incrementally** \u2014 call `add-plan-item` for each item:\n - 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.\n - Set `summary` and `assumptions` on your first call\n - Each call makes the item visible to the user immediately\n - `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 \u2014 the builder handles that.\n - `triggerDescription`: a few words describing trigger type (e.g. \"Webhook POST\", \"Schedule daily\"), no resource identifiers\n - `integrations`: service names only (e.g. \"Slack\", \"Google Calendar\"), no resource identifiers or qualifiers\n - `dependsOn`: **CRITICAL** \u2014 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.\n - `columns`: name and type only \u2014 no descriptions\n - `assumptions`: design decisions only, no resource identifiers (channels, calendars, etc.)\n - 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.\n - After all items are added, call `submit-plan` to request user approval.\n\n4. **Handle approval** \u2014 `submit-plan` returns the user's decision:\n - If `approved: true`: reply with \"Plan approved.\" and stop.\n - If `approved: false`: read the `feedback` field. Make targeted changes using `remove-plan-item` (to drop items) or `add-plan-item` (to add/replace items by ID). Then call `submit-plan` again. Repeat until approved.\n\n## Critical Rules\n\n- **Call `add-plan-item` for each item as you design it.** Data tables first, then workflows. 3-6 discovery tool calls then start emitting items.\n- **Always call `submit-plan` after your last `add-plan-item`.** Never end without submitting.\n- **On rejection, be surgical.** Only change what the user asked for. Do NOT re-add items that are already correct.\n- **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.\n- **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 \u2014 never use `delegate` for data table operations.\n- **Data-table-only plans are valid.** If the request is purely about creating, populating, modifying, or deleting data tables \u2014 with no automation triggers, schedules, or integrations \u2014 use only `data-table` kind items. Do NOT wrap table operations in a `workflow` or `delegate` item.\n- **`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`.\n- **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.\n- **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 \u2014 cross-task context causes agents to perform work outside their scope.\n- Never fabricate node names \u2014 if unsure whether a node exists, search first.";
1
+ export declare const PLANNER_AGENT_PROMPT = "You are the n8n Workflow Planner \u2014 you design solution architectures. You do NOT build workflows.\n\nYou receive the recent conversation between the user and the orchestrator. Read it to understand what the user wants, then design the blueprint.\n\n## Output Discipline\n- You report to a parent agent, not a human. Be terse.\n- Do not narrate (\"I'll search for\u2026\", \"Let me look up\u2026\") \u2014 just do the work.\n- No emojis, filler phrases, or markdown headers in your text output.\n- Only output text on completion, when blocked, or when asking for user input.\n- Do not produce code, node names, node configurations, or step-by-step node wiring \u2014 describe outcomes and dependencies.\n\n## Method\n\n1. **Prefer assumptions over questions.** The user is waiting for a plan, and they can reject it if your assumptions are wrong \u2014 so default to making reasonable choices rather than asking.\n - **Never ask about things you can discover** \u2014 call `credentials(action=\"list\")`, `data-tables(action=\"list\")`, `templates(action=\"best-practices\")` instead.\n - **Never ask about implementation details** \u2014 trigger types, node choices, schedule times, column names. Pick sensible defaults.\n - **Never default resource identifiers** the user didn't mention (Slack channels, calendars, spreadsheets, folders, etc.) \u2014 leave them for the builder to resolve at build time.\n - **Do ask when the answer would significantly change the plan** \u2014 e.g. the user's goal is ambiguous (\"build me a CRM\" \u2014 for sales? support? recruiting?), or a business rule must come from the user (\"what should happen when payment fails?\").\n - **Do ask when a required service has more than one credential of the same type** (e.g. two `openAiApi` accounts, three Google Calendar accounts) \u2014 which one to use cannot be discovered, only chosen. Record the chosen credential name in `assumptions`.\n - **List your assumptions** on your first `add-plan-item` call. The user reviews the plan before execution and can reject/correct.\n\n2. **Discover** \u2014 check what exists and learn best practices. Expect 3\u20136 tool calls for a typical request:\n - `templates(action=\"best-practices\")` for each relevant technique (e.g. \"form_input\", \"scheduling\", \"data_persistence\", \"web_app\"). Call with \"list\" first to see available techniques, then fetch relevant ones \u2014 best practices inform your design decisions.\n - `nodes(action=\"suggested\")` for the relevant categories\n - `data-tables(action=\"list\")` to check for existing tables\n - `credentials(action=\"list\")` if the request involves external services\n - Skip searches for nodes you already know exist (webhooks, schedule triggers, data tables, code, set, filter, etc.)\n\n## Node Selection Reference\n\nUse these references when designing your plan \u2014 they help you pick the right trigger, prefer native nodes over Code, and correctly scope AI workflows.\n\n### AI Node Selection\nAI node selection guidance:\n\nAI Agent: Use for text analysis, summarization, classification, or any AI reasoning tasks.\nOpenAI node: Use only for DALL-E, Whisper, Sora, or embeddings (these are specialized APIs that AI Agent cannot access).\nDefault chat model: OpenAI Chat Model provides the lowest setup friction for new users.\nTool nodes (ending in \"Tool\"): Connect to AI Agent via ai_tool for agent-controlled actions.\nText Classifier vs AI Agent: Text Classifier for simple categorization with fixed categories; AI Agent for complex multi-step classification requiring reasoning.\nMemory nodes: Include with chatbot AI Agents to maintain conversation context across messages.\nStructured Output Parser: Prefer this over manually extracting/parsing AI output with Set or Code nodes. Define the desired schema and the LLM handles parsing automatically. Use for classification, data extraction, or any workflow where AI output feeds into database storage, API calls, or Switch routing.\n\nMulti-agent systems:\nAI Agent Tool (@n8n/n8n-nodes-langchain.agentTool) contains an embedded AI Agent \u2014 it's a complete sub-agent that the main agent can call through ai_tool. Each AgentTool needs its own Chat Model. Node selection: 1 AI Agent + N AgentTools + (N+1) Chat Models.\n\n### Node Selection by Use Case\nNode selection by use case:\n\nDOCUMENTS:\n- Document Loader: Loads documents from various sources\n- Extract From File: Extracts text content from binary files\n- AWS Textract: OCR for scanned documents\n\nDATA PROCESSING & TRANSFORMATION:\n- Aggregate: Combines multiple items into one\n- Split Out: Expands arrays into separate items\n- Loop Over Items: Processes large item sets\n- Set: Adds, modifies, or removes fields from items\n- Filter: Removes items based on conditions\n- Sort: Orders items by field values\n\nSTORAGE:\n- n8n Data Tables: Built-in database storage (no credentials required). Recommend as the default storage option.\n- Google Sheets: Spreadsheet storage and collaboration\n- Airtable: Relational database with rich field types\n\nTRIGGERS:\n- Schedule Trigger: Time-based automation\n- Gmail Trigger: Monitors for new emails\n- Form Trigger: Collects user submissions\n- Webhook: Receives HTTP requests from external services\n\nSCRAPING:\n- HTTP Request + HTML Extract: Web page content extraction\n\nNOTIFICATIONS:\n- Email nodes (Gmail, Outlook, Send Email)\n- Slack: Team messaging\n- Telegram: Bot messaging\n- Twilio: SMS messaging\n\nRESEARCH:\n- SerpAPI Tool: Web search capabilities for AI Agents\n- Perplexity Tool: AI-powered search for AI Agents\n\nCHATBOTS:\n- Slack/Telegram/WhatsApp nodes: Platform-specific chatbots\n- Chat Trigger: n8n-hosted chat interface\n\nMEDIA:\n- OpenAI: DALL-E image generation, Sora video, Whisper transcription\n- Google Gemini: Imagen image generation\n\n### Trigger Selection\nTrigger type selection:\n\nWebhook (n8n-nodes-base.webhook): External systems calling your workflow via HTTP POST/GET.\n Use when: \"receive data from X\", \"when X calls\", \"API endpoint\", \"incoming requests\"\n\nForm Trigger: User-facing forms with optional multi-step support.\n Use when: \"collect user input\", \"survey\", \"registration form\"\n\nSchedule Trigger: Time-based automation (cron-style), only runs when workflow is activated.\n Use when: \"run daily at 9am\", \"every hour\", \"weekly report\"\n\nGmail/Slack/Telegram Trigger: Platform-specific event monitoring with built-in authentication.\n Use when: \"monitor for new emails\", \"when message received\", \"watch channel\"\n\nChat Trigger: n8n-hosted chat interface for conversational AI.\n Use when: \"build a chatbot\", \"chat interface\", \"conversational assistant\"\n\nManual Trigger: For testing and one-off runs only (requires user to click \"Execute\").\n Use when: explicitly testing or debugging workflows\n\n### Native Node Preference\nPrefer native n8n nodes over Code node \u2014 native nodes provide better UX, visual debugging, and are easier for users to modify.\n\nNative node mappings:\n- Remove duplicates -> Remove Duplicates (n8n-nodes-base.removeDuplicates)\n- Filter items -> Filter: visual condition builder with multiple rules\n- Transform/map data -> Edit Fields (Set): drag-and-drop field mapping\n- Combine items -> Aggregate: groups and summarizes with built-in functions\n- Conditional routing -> IF / Switch: visual branching with clear output paths\n- Sort items -> Sort: configurable sort keys and directions\n- Regex matching -> IF with expression: use {{ $json.field.match(/pattern/) }}\n- Limit items -> Limit: simple count-based limiting\n- Compare datasets -> Compare Datasets: finds differences between two data sources\n\nReserve Code node for complex multi-step algorithms that require loops, recursion, or logic that expressions cannot handle.\n\n3. **Build incrementally** \u2014 call `add-plan-item` for each item:\n - 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.\n - Set `summary` and `assumptions` on your first call\n - Each call makes the item visible to the user immediately\n - `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 \u2014 the builder handles that.\n - `triggerDescription`: a few words describing trigger type (e.g. \"Webhook POST\", \"Schedule daily\"), no resource identifiers\n - `integrations`: service names only (e.g. \"Slack\", \"Google Calendar\"), no resource identifiers or qualifiers\n - `dependsOn`: **CRITICAL** \u2014 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.\n - `columns`: name and type only \u2014 no descriptions\n - `assumptions`: design decisions only, no resource identifiers (channels, calendars, etc.)\n - 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.\n - After all items are added, call `submit-plan` to request user approval.\n\n4. **Handle approval** \u2014 `submit-plan` returns the user's decision:\n - If `approved: true`: reply with \"Plan approved.\" and stop.\n - If `approved: false`: read the `feedback` field. Make targeted changes using `remove-plan-item` (to drop items) or `add-plan-item` (to add/replace items by ID). Then call `submit-plan` again. Repeat until approved.\n\n## Critical Rules\n\n- **User time zone is in context as `<current-datetime>` / `<user-timezone>`.** Schedule times, cron expressions, and digest times must be stated in the user's time zone. Never write \"instance default timezone\" or leave the zone ambiguous \u2014 spell it out (e.g. \"daily at 08:00 America/New_York\").\n- **Dependencies are mandatory.** Every workflow must list the data table IDs it reads from or writes to in `dependsOn`. If workflow C needs data from A and B, it must depend on both.\n- **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), `research` kind for web research. Use `delegate` only for tasks that don't fit the other kinds \u2014 never for data table operations.\n- **Data-table-only plans are valid.** When the request is purely about data tables (no triggers, schedules, or integrations), use only `data-table` items \u2014 don't wrap them in `workflow` or `delegate`. For creation, include `columns`; for other operations, omit `columns` and describe the operation in `purpose`. Include seed rows in `purpose` when the user wants sample data.\n- **Each item's `purpose` describes only that item.** Do not reference work handled by other plan items \u2014 each agent only sees its own spec, and cross-task context causes scope creep.\n- **Workflow verification is mandatory.** For **every** `workflow` item you add, also add a `checkpoint` item whose `dependsOn` includes that workflow's ID. Checkpoints are orchestrator-executed \u2014 the orchestrator runs them itself using its own tools, they are not delegated.\n - `title`: a user-readable verification goal, e.g. `\"Verify 'Daily API Email' workflow runs successfully\"`.\n - `instructions`: detailed steps the orchestrator must execute. Prefer `verify-built-workflow` with the work item ID from the build outcome \u2014 it uses pin data captured at build time, so it works even for event-triggered workflows (webhook, form, chat, mcp). For workflows with real credentials and a testable trigger (manual, schedule), `executions(action=\"run\")` is acceptable. State the pass condition in plain terms (e.g. \"run completes without errors and produces at least one output row\").\n - Do NOT list `tools` on a checkpoint \u2014 it is not a delegate task.\n - Do NOT emit a checkpoint for a `data-table`, `research`, or `delegate` item. Checkpoints are for workflows only.\n- **Always call `submit-plan` after the last `add-plan-item`.** On rejection, be surgical \u2014 change only what the user asked for. Never fabricate node names; search first if unsure.";
@@ -2,15 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PLANNER_AGENT_PROMPT = void 0;
4
4
  const node_selection_1 = require("@n8n/workflow-sdk/prompts/node-selection");
5
+ const shared_prompts_1 = require("../../agent/shared-prompts");
5
6
  exports.PLANNER_AGENT_PROMPT = `You are the n8n Workflow Planner — you design solution architectures. You do NOT build workflows.
6
7
 
7
8
  You receive the recent conversation between the user and the orchestrator. Read it to understand what the user wants, then design the blueprint.
8
9
 
9
- ## Output Discipline
10
- - Be terse. You report to a parent orchestrator, not a human.
11
- - Do NOT produce code, node names, node configurations, or step-by-step node wiring.
12
- - Do NOT narrate ("I'll search for...", "Let me look up"). Just do the work.
13
- - No emojis, no filler, no markdown formatting in your reasoning.
10
+ ${shared_prompts_1.SUBAGENT_OUTPUT_CONTRACT}
11
+ - Do not produce code, node names, node configurations, or step-by-step node wiring — describe outcomes and dependencies.
14
12
 
15
13
  ## Method
16
14
 
@@ -19,10 +17,11 @@ You receive the recent conversation between the user and the orchestrator. Read
19
17
  - **Never ask about implementation details** — trigger types, node choices, schedule times, column names. Pick sensible defaults.
20
18
  - **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.
21
19
  - **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?").
20
+ - **Do ask when a required service has more than one credential of the same type** (e.g. two \`openAiApi\` accounts, three Google Calendar accounts) — which one to use cannot be discovered, only chosen. Record the chosen credential name in \`assumptions\`.
22
21
  - **List your assumptions** on your first \`add-plan-item\` call. The user reviews the plan before execution and can reject/correct.
23
22
 
24
- 2. **Discover** (3-6 tool calls) — check what exists and learn best practices:
25
- - \`templates(action="best-practices")\` for each relevant technique (e.g. "form_input", "scheduling", "data_persistence"). Call with "list" first to see available techniques, then fetch relevant ones. **This is important** — best practices inform your design decisions.
23
+ 2. **Discover** — check what exists and learn best practices. Expect 3–6 tool calls for a typical request:
24
+ - \`templates(action="best-practices")\` for each relevant technique (e.g. "form_input", "scheduling", "data_persistence", "web_app"). Call with "list" first to see available techniques, then fetch relevant ones — best practices inform your design decisions.
26
25
  - \`nodes(action="suggested")\` for the relevant categories
27
26
  - \`data-tables(action="list")\` to check for existing tables
28
27
  - \`credentials(action="list")\` if the request involves external services
@@ -63,14 +62,15 @@ ${node_selection_1.NATIVE_NODE_PREFERENCE}
63
62
 
64
63
  ## Critical Rules
65
64
 
66
- - **Call \`add-plan-item\` for each item as you design it.** Data tables first, then workflows. 3-6 discovery tool calls then start emitting items.
67
- - **Always call \`submit-plan\` after your last \`add-plan-item\`.** Never end without submitting.
68
- - **On rejection, be surgical.** Only change what the user asked for. Do NOT re-add items that are already correct.
69
- - **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.
70
- - **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.
71
- - **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 integrationsuse only \`data-table\` kind items. Do NOT wrap table operations in a \`workflow\` or \`delegate\` item.
72
- - **\`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\`.
73
- - **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.
74
- - **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.
75
- - Never fabricate node names if unsure whether a node exists, search first.`;
65
+ - **User time zone is in context as \`<current-datetime>\` / \`<user-timezone>\`.** Schedule times, cron expressions, and digest times must be stated in the user's time zone. Never write "instance default timezone" or leave the zone ambiguous — spell it out (e.g. "daily at 08:00 America/New_York").
66
+ - **Dependencies are mandatory.** Every workflow must list the data table IDs it reads from or writes to in \`dependsOn\`. If workflow C needs data from A and B, it must depend on both.
67
+ - **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), \`research\` kind for web research. Use \`delegate\` only for tasks that don't fit the other kinds — never for data table operations.
68
+ - **Data-table-only plans are valid.** When the request is purely about data tables (no triggers, schedules, or integrations), use only \`data-table\` items — don't wrap them in \`workflow\` or \`delegate\`. For creation, include \`columns\`; for other operations, omit \`columns\` and describe the operation in \`purpose\`. Include seed rows in \`purpose\` when the user wants sample data.
69
+ - **Each item's \`purpose\` describes only that item.** Do not reference work handled by other plan items each agent only sees its own spec, and cross-task context causes scope creep.
70
+ - **Workflow verification is mandatory.** For **every** \`workflow\` item you add, also add a \`checkpoint\` item whose \`dependsOn\` includes that workflow's ID. Checkpoints are orchestrator-executedthe orchestrator runs them itself using its own tools, they are not delegated.
71
+ - \`title\`: a user-readable verification goal, e.g. \`"Verify 'Daily API Email' workflow runs successfully"\`.
72
+ - \`instructions\`: detailed steps the orchestrator must execute. Prefer \`verify-built-workflow\` with the work item ID from the build outcome it uses pin data captured at build time, so it works even for event-triggered workflows (webhook, form, chat, mcp). For workflows with real credentials and a testable trigger (manual, schedule), \`executions(action="run")\` is acceptable. State the pass condition in plain terms (e.g. "run completes without errors and produces at least one output row").
73
+ - Do NOT list \`tools\` on a checkpoint it is not a delegate task.
74
+ - Do NOT emit a checkpoint for a \`data-table\`, \`research\`, or \`delegate\` item. Checkpoints are for workflows only.
75
+ - **Always call \`submit-plan\` after the last \`add-plan-item\`.** On rejection, be surgical — change only what the user asked for. Never fabricate node names; search first if unsure.`;
76
76
  //# sourceMappingURL=plan-agent-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan-agent-prompt.js","sourceRoot":"","sources":["../../../src/tools/orchestration/plan-agent-prompt.ts"],"names":[],"mappings":";;;AAAA,6EAKkD;AAErC,QAAA,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+BlC,kCAAiB;;;EAGjB,wCAAuB;;;EAGvB,kCAAiB;;;EAGjB,uCAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8EA8BsD,CAAC"}
1
+ {"version":3,"file":"plan-agent-prompt.js","sourceRoot":"","sources":["../../../src/tools/orchestration/plan-agent-prompt.ts"],"names":[],"mappings":";;;AAAA,6EAKkD;AAElD,+DAAsE;AAEzD,QAAA,oBAAoB,GAAG;;;;EAIlC,yCAAwB;;;;;;;;;;;;;;;;;;;;;;;;;EAyBxB,kCAAiB;;;EAGjB,wCAAuB;;;EAGvB,kCAAiB;;;EAGjB,uCAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yLA+BiK,CAAC"}
@@ -1,2 +1,10 @@
1
1
  import type { OrchestrationContext } from '../../types';
2
+ interface FormattedMessage {
3
+ role: string;
4
+ content: string;
5
+ }
6
+ declare function formatMessagesForBriefing(messages: FormattedMessage[], guidance?: string, timeZone?: string): string;
7
+ export declare const __testFormatMessagesForBriefing: typeof formatMessagesForBriefing;
8
+ export declare function __testClearPlannedTaskGraph(context: OrchestrationContext): Promise<void>;
2
9
  export declare function createPlanWithAgentTool(context: OrchestrationContext): import("@mastra/core/tools").Tool<InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, import("@mastra/core/tools").ToolExecutionContext<InferPublicSchema<T>, InferPublicSchema<T>, unknown>, "plan", unknown>;
10
+ export {};
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.__testFormatMessagesForBriefing = void 0;
4
+ exports.__testClearPlannedTaskGraph = __testClearPlannedTaskGraph;
3
5
  exports.createPlanWithAgentTool = createPlanWithAgentTool;
4
6
  const agent_1 = require("@mastra/core/agent");
5
7
  const tools_1 = require("@mastra/core/tools");
8
+ const luxon_1 = require("luxon");
6
9
  const nanoid_1 = require("nanoid");
7
10
  const zod_1 = require("zod");
8
11
  const add_plan_item_tool_1 = require("./add-plan-item.tool");
@@ -16,15 +19,9 @@ const max_steps_1 = require("../../constants/max-steps");
16
19
  const resumable_stream_executor_1 = require("../../runtime/resumable-stream-executor");
17
20
  const consume_with_hitl_1 = require("../../stream/consume-with-hitl");
18
21
  const langsmith_tracing_1 = require("../../tracing/langsmith-tracing");
22
+ const templates_tool_1 = require("../templates.tool");
19
23
  const MESSAGE_HISTORY_COUNT = 5;
20
- const PLANNER_DOMAIN_TOOL_NAMES = [
21
- 'nodes',
22
- 'templates',
23
- 'credentials',
24
- 'data-tables',
25
- 'workflows',
26
- 'ask-user',
27
- ];
24
+ const PLANNER_DOMAIN_TOOL_NAMES = ['nodes', 'credentials', 'data-tables', 'workflows', 'ask-user'];
28
25
  const PLANNER_RESEARCH_TOOL_NAMES = ['research'];
29
26
  function extractTextFromMemoryContent(content) {
30
27
  if (typeof content === 'string')
@@ -73,8 +70,14 @@ async function getRecentMessages(context, count) {
73
70
  }
74
71
  return messages;
75
72
  }
76
- function formatMessagesForBriefing(messages, guidance) {
73
+ function formatMessagesForBriefing(messages, guidance, timeZone) {
77
74
  const parts = [];
75
+ const now = timeZone ? luxon_1.DateTime.now().setZone(timeZone) : luxon_1.DateTime.now();
76
+ const isoNow = now.toISO({ includeOffset: true }) ?? new Date().toISOString();
77
+ parts.push(`<current-datetime>${isoNow}</current-datetime>`);
78
+ if (timeZone) {
79
+ parts.push(`<user-timezone>${timeZone}</user-timezone>`);
80
+ }
78
81
  if (messages.length > 0) {
79
82
  parts.push('## Recent conversation');
80
83
  for (const m of messages) {
@@ -89,6 +92,7 @@ function formatMessagesForBriefing(messages, guidance) {
89
92
  parts.push('\nDesign the solution blueprint based on the conversation above.');
90
93
  return parts.join('\n\n');
91
94
  }
95
+ exports.__testFormatMessagesForBriefing = formatMessagesForBriefing;
92
96
  function publishClearingEvent(context) {
93
97
  context.eventBus.publish(context.threadId, {
94
98
  type: 'tasks-update',
@@ -104,6 +108,25 @@ async function clearDraftChecklist(context) {
104
108
  catch {
105
109
  }
106
110
  }
111
+ async function __testClearPlannedTaskGraph(context) {
112
+ return await clearPlannedTaskGraph(context);
113
+ }
114
+ async function clearPlannedTaskGraph(context) {
115
+ if (!context.plannedTaskService)
116
+ return;
117
+ try {
118
+ const graph = await context.plannedTaskService.getGraph(context.threadId);
119
+ if (!graph)
120
+ return;
121
+ if (graph.planRunId !== context.runId)
122
+ return;
123
+ if (graph.status !== 'awaiting_approval')
124
+ return;
125
+ await context.plannedTaskService.clear(context.threadId);
126
+ }
127
+ catch {
128
+ }
129
+ }
107
130
  function createPlanWithAgentTool(context) {
108
131
  return (0, tools_1.createTool)({
109
132
  id: 'plan',
@@ -136,12 +159,13 @@ function createPlanWithAgentTool(context) {
136
159
  plannerTools[name] = context.domainTools[name];
137
160
  }
138
161
  }
162
+ plannerTools.templates = (0, templates_tool_1.createTemplatesTool)();
139
163
  const accumulator = new blueprint_accumulator_1.BlueprintAccumulator();
140
164
  plannerTools['add-plan-item'] = (0, add_plan_item_tool_1.createAddPlanItemTool)(accumulator, context);
141
165
  plannerTools['remove-plan-item'] = (0, add_plan_item_tool_1.createRemovePlanItemTool)(accumulator, context);
142
166
  plannerTools['submit-plan'] = (0, submit_plan_tool_1.createSubmitPlanTool)(accumulator, context);
143
167
  const messages = await getRecentMessages(context, MESSAGE_HISTORY_COUNT);
144
- const briefing = formatMessagesForBriefing(messages, input.guidance);
168
+ const briefing = formatMessagesForBriefing(messages, input.guidance, context.timeZone);
145
169
  const subAgentId = `agent-planner-${(0, nanoid_1.nanoid)(6)}`;
146
170
  const subtitle = input.guidance ?? messages.find((m) => m.role === 'user')?.content ?? 'Planning...';
147
171
  context.eventBus.publish(context.threadId, {
@@ -230,6 +254,9 @@ function createPlanWithAgentTool(context) {
230
254
  },
231
255
  });
232
256
  if (accumulator.isApproved()) {
257
+ if (context.plannedTaskService) {
258
+ await context.plannedTaskService.approvePlan(context.threadId);
259
+ }
233
260
  if (context.schedulePlannedTasks) {
234
261
  await context.schedulePlannedTasks();
235
262
  }
@@ -240,6 +267,7 @@ function createPlanWithAgentTool(context) {
240
267
  }
241
268
  publishClearingEvent(context);
242
269
  await clearDraftChecklist(context);
270
+ await clearPlannedTaskGraph(context);
243
271
  if (!accumulator.isEmpty()) {
244
272
  return {
245
273
  result: `Planner added ${accumulator.getTaskList().length} items but did not submit the plan for approval. The plan was not executed.`,
@@ -265,8 +293,11 @@ function createPlanWithAgentTool(context) {
265
293
  error: errorMessage,
266
294
  },
267
295
  });
268
- publishClearingEvent(context);
269
- await clearDraftChecklist(context);
296
+ if (!accumulator.isApproved()) {
297
+ publishClearingEvent(context);
298
+ await clearDraftChecklist(context);
299
+ await clearPlannedTaskGraph(context);
300
+ }
270
301
  return { result: `Planner error: ${errorMessage}` };
271
302
  }
272
303
  },
@@ -1 +1 @@
1
- {"version":3,"file":"plan-with-agent.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/plan-with-agent.tool.ts"],"names":[],"mappings":";;AAsLA,0DA4MC;AApXD,8CAA2C;AAE3C,8CAAgD;AAChD,mCAAgC;AAChC,6BAAwB;AAExB,6DAAuF;AACvF,mEAA+D;AAC/D,mDAAgD;AAChD,2DAA2D;AAC3D,yDAA0D;AAC1D,mDAMyB;AACzB,2EAAsE;AACtE,yDAAsD;AACtD,uFAAkF;AAClF,sEAAuE;AACvE,uEAA4F;AAI5F,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAGhC,MAAM,yBAAyB,GAAG;IACjC,OAAO;IACP,WAAW;IACX,aAAa;IACb,aAAa;IACb,WAAW;IACX,UAAU;CACV,CAAC;AAGF,MAAM,2BAA2B,GAAG,CAAC,UAAU,CAAC,CAAC;AAYjD,SAAS,4BAA4B,CAAC,OAAgB;IACrD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC;IAGhD,IAAI,mBAAmB,CAAC,OAAO,CAA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od_1 = require("zod");
9
9
  const plannedTaskSchema = zod_1.z.object({
10
10
  id: zod_1.z.string().describe('Stable task identifier used by dependency edges'),
11
11
  title: zod_1.z.string().describe('Short user-facing task title'),
12
- kind: zod_1.z.enum(['delegate', 'build-workflow', 'manage-data-tables', 'research']),
12
+ kind: zod_1.z.enum(['delegate', 'build-workflow', 'manage-data-tables', 'research', 'checkpoint']),
13
13
  spec: zod_1.z.string().describe('Detailed executor briefing for this task'),
14
14
  deps: zod_1.z
15
15
  .array(zod_1.z.string())
@@ -23,7 +23,42 @@ const plannedTaskSchema = zod_1.z.object({
23
23
  });
24
24
  const planInputSchema = zod_1.z.object({
25
25
  tasks: zod_1.z.array(plannedTaskSchema).min(1).describe('Dependency-aware execution plan'),
26
+ skipPlannerDiscovery: zod_1.z
27
+ .boolean()
28
+ .optional()
29
+ .describe('Set to true to intentionally bypass the planner and call create-tasks for initial (non-replan) work. ' +
30
+ 'Requires `reason`. Use sparingly — the planner sub-agent discovers credentials, data tables, and ' +
31
+ 'best practices you would otherwise miss.'),
32
+ reason: zod_1.z
33
+ .string()
34
+ .optional()
35
+ .describe('One sentence explaining why the planner is being bypassed. Required when skipPlannerDiscovery is true.'),
26
36
  });
37
+ function isReplanContext(context) {
38
+ return context.isReplanFollowUp === true;
39
+ }
40
+ async function threadHasExistingPlan(context) {
41
+ if (!context.plannedTaskService)
42
+ return false;
43
+ try {
44
+ const graph = await context.plannedTaskService.getGraph(context.threadId);
45
+ if (!graph)
46
+ return false;
47
+ if (graph.status === 'awaiting_approval') {
48
+ return graph.planRunId === context.runId;
49
+ }
50
+ return graph.status === 'active' || graph.status === 'awaiting_replan';
51
+ }
52
+ catch {
53
+ return false;
54
+ }
55
+ }
56
+ function isReplanGuardEnabled() {
57
+ const raw = process.env.N8N_INSTANCE_AI_ENFORCE_CREATE_TASKS_REPLAN;
58
+ if (raw === undefined)
59
+ return true;
60
+ return raw.toLowerCase() !== 'false' && raw !== '0';
61
+ }
27
62
  const planOutputSchema = zod_1.z.object({
28
63
  result: zod_1.z.string(),
29
64
  taskCount: zod_1.z.number(),
@@ -38,6 +73,9 @@ function createPlanTool(context) {
38
73
  description: 'Submit a pre-built task list for detached multi-step execution. ' +
39
74
  'Use ONLY for replanning after a failure — when you already have the task context ' +
40
75
  'and do not need resource discovery. For initial planning, call `plan` instead. ' +
76
+ 'A runtime guard rejects this tool when no replan context (`<planned-task-follow-up type="replan">`) ' +
77
+ 'is present; if you intentionally need to bypass the planner, set `skipPlannerDiscovery: true` ' +
78
+ 'and pass a one-sentence `reason`. ' +
41
79
  'The task list is shown to the user for approval before execution starts. ' +
42
80
  'After calling create-tasks, reply briefly and end your turn.',
43
81
  inputSchema: planInputSchema,
@@ -59,7 +97,36 @@ function createPlanTool(context) {
59
97
  }
60
98
  const resumeData = ctx?.agent?.resumeData;
61
99
  const suspend = ctx?.agent?.suspend;
62
- if (resumeData === undefined || resumeData === null) {
100
+ const isFirstCall = resumeData === undefined || resumeData === null;
101
+ const hasExistingPlan = await threadHasExistingPlan(context);
102
+ if (isFirstCall && isReplanGuardEnabled() && !isReplanContext(context) && !hasExistingPlan) {
103
+ if (!input.skipPlannerDiscovery) {
104
+ context.logger.warn('create-tasks called without replan context — rejecting', {
105
+ threadId: context.threadId,
106
+ taskCount: input.tasks.length,
107
+ });
108
+ return {
109
+ result: 'Error: `create-tasks` is for replanning only. For initial planning, call `plan` instead — ' +
110
+ 'the planner sub-agent will discover credentials, data tables, and best practices for you. ' +
111
+ 'If you intentionally want to skip the planner (rare), call `create-tasks` again with ' +
112
+ '`skipPlannerDiscovery: true` and a one-sentence `reason`.',
113
+ taskCount: 0,
114
+ };
115
+ }
116
+ if (!input.reason || input.reason.trim().length === 0) {
117
+ return {
118
+ result: 'Error: `skipPlannerDiscovery: true` requires a one-sentence `reason` explaining ' +
119
+ 'why the planner is being bypassed.',
120
+ taskCount: 0,
121
+ };
122
+ }
123
+ context.logger.warn('create-tasks bypassing planner with skipPlannerDiscovery=true', {
124
+ threadId: context.threadId,
125
+ taskCount: input.tasks.length,
126
+ reason: input.reason,
127
+ });
128
+ }
129
+ if (isFirstCall) {
63
130
  await context.plannedTaskService.createPlan(context.threadId, input.tasks, {
64
131
  planRunId: context.runId,
65
132
  messageGroupId: context.messageGroupId,
@@ -85,12 +152,25 @@ function createPlanTool(context) {
85
152
  return { result: 'Awaiting approval', taskCount: input.tasks.length };
86
153
  }
87
154
  if (resumeData.approved) {
155
+ await context.plannedTaskService.approvePlan(context.threadId);
88
156
  await context.schedulePlannedTasks();
89
157
  return {
90
158
  result: `Plan approved. Started ${input.tasks.length} task${input.tasks.length === 1 ? '' : 's'}.`,
91
159
  taskCount: input.tasks.length,
92
160
  };
93
161
  }
162
+ try {
163
+ await context.taskStorage.save(context.threadId, { tasks: [] });
164
+ }
165
+ catch (error) {
166
+ context.logger.warn('Failed to clear rejected plan checklist', { error });
167
+ }
168
+ context.eventBus.publish(context.threadId, {
169
+ type: 'tasks-update',
170
+ runId: context.runId,
171
+ agentId: context.orchestratorAgentId,
172
+ payload: { tasks: { tasks: [] }, planItems: [] },
173
+ });
94
174
  return {
95
175
  result: `User requested changes: ${resumeData.userInput ?? 'No feedback provided'}. Revise the tasks and call create-tasks again.`,
96
176
  taskCount: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"plan.tool.js","sourceRoot":"","sources":["../../../src/tools/orchestration/plan.tool.ts"],"names":[],"mappings":";;;AAuCA,wCAkFC;AAzHD,8CAAgD;AAChD,8CAAgD;AAChD,mCAAgC;AAChC,6BAAwB;AAIxB,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;IAC1E,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC1D,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,gBAAgB,EAAE,oBAAoB,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,CAAC,IAAI,CAAC,yCAAyC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC3E,CAAC;YACD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC1C,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,OAAO,EAAE,OAAO,CAAC,mBAAmB;gBACpC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;aAChD,CAAC,CAAC;YACH,OAAO;gBACN,MAAM,EAAE,2BAA2B,UAAU,CAAC,SAAS,IAAI,sBAAsB,iDAAiD;gBAClI,SAAS,EAAE,CAAC;aACZ,CAAC;QACH,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
@@ -9,26 +9,64 @@ export declare const reportVerificationVerdictInputSchema: z.ZodObject<{
9
9
  failedNodeName: z.ZodOptional<z.ZodString>;
10
10
  diagnosis: z.ZodOptional<z.ZodString>;
11
11
  patch: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
12
+ remediation: z.ZodOptional<z.ZodObject<{
13
+ category: z.ZodEnum<["code_fixable", "needs_setup", "blocked"]>;
14
+ shouldEdit: z.ZodBoolean;
15
+ guidance: z.ZodString;
16
+ reason: z.ZodOptional<z.ZodString>;
17
+ remainingSubmitFixes: z.ZodOptional<z.ZodNumber>;
18
+ attemptCount: z.ZodOptional<z.ZodNumber>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ category: "blocked" | "code_fixable" | "needs_setup";
21
+ shouldEdit: boolean;
22
+ guidance: string;
23
+ reason?: string | undefined;
24
+ remainingSubmitFixes?: number | undefined;
25
+ attemptCount?: number | undefined;
26
+ }, {
27
+ category: "blocked" | "code_fixable" | "needs_setup";
28
+ shouldEdit: boolean;
29
+ guidance: string;
30
+ reason?: string | undefined;
31
+ remainingSubmitFixes?: number | undefined;
32
+ attemptCount?: number | undefined;
33
+ }>>;
12
34
  summary: z.ZodString;
13
35
  }, "strip", z.ZodTypeAny, {
14
- workItemId: string;
15
36
  workflowId: string;
37
+ workItemId: string;
16
38
  summary: string;
17
39
  verdict: "trigger_only" | "verified" | "needs_patch" | "needs_rebuild" | "needs_user_input" | "failed_terminal";
18
40
  diagnosis?: string | undefined;
19
41
  patch?: Record<string, unknown> | undefined;
20
42
  executionId?: string | undefined;
21
43
  failureSignature?: string | undefined;
44
+ remediation?: {
45
+ category: "blocked" | "code_fixable" | "needs_setup";
46
+ shouldEdit: boolean;
47
+ guidance: string;
48
+ reason?: string | undefined;
49
+ remainingSubmitFixes?: number | undefined;
50
+ attemptCount?: number | undefined;
51
+ } | undefined;
22
52
  failedNodeName?: string | undefined;
23
53
  }, {
24
- workItemId: string;
25
54
  workflowId: string;
55
+ workItemId: string;
26
56
  summary: string;
27
57
  verdict: "trigger_only" | "verified" | "needs_patch" | "needs_rebuild" | "needs_user_input" | "failed_terminal";
28
58
  diagnosis?: string | undefined;
29
59
  patch?: Record<string, unknown> | undefined;
30
60
  executionId?: string | undefined;
31
61
  failureSignature?: string | undefined;
62
+ remediation?: {
63
+ category: "blocked" | "code_fixable" | "needs_setup";
64
+ shouldEdit: boolean;
65
+ guidance: string;
66
+ reason?: string | undefined;
67
+ remainingSubmitFixes?: number | undefined;
68
+ attemptCount?: number | undefined;
69
+ } | undefined;
32
70
  failedNodeName?: string | undefined;
33
71
  }>;
34
72
  export declare function createReportVerificationVerdictTool(context: OrchestrationContext): import("@mastra/core/tools").Tool<InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, InferPublicSchema<T>, import("@mastra/core/tools").ToolExecutionContext<InferPublicSchema<T>, InferPublicSchema<T>, unknown>, "report-verification-verdict", unknown>;