@atom8n/ai-workflow-builder 1.2.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.
- package/dist/agents/responder.agent.d.ts +21 -0
- package/dist/agents/responder.agent.js +71 -0
- package/dist/agents/responder.agent.js.map +1 -0
- package/dist/agents/supervisor.agent.d.ts +31 -0
- package/dist/agents/supervisor.agent.js +68 -0
- package/dist/agents/supervisor.agent.js.map +1 -0
- package/dist/ai-workflow-builder-agent.service.d.ts +32 -0
- package/dist/ai-workflow-builder-agent.service.js +236 -0
- package/dist/ai-workflow-builder-agent.service.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -0
- package/dist/chains/conversation-compact.d.ts +7 -0
- package/dist/chains/conversation-compact.js +56 -0
- package/dist/chains/conversation-compact.js.map +1 -0
- package/dist/chains/parameter-updater.d.ts +16 -0
- package/dist/chains/parameter-updater.js +112 -0
- package/dist/chains/parameter-updater.js.map +1 -0
- package/dist/chains/prompt-categorization.d.ts +3 -0
- package/dist/chains/prompt-categorization.js +31 -0
- package/dist/chains/prompt-categorization.js.map +1 -0
- package/dist/chains/test/integration/test-helpers.d.ts +3 -0
- package/dist/chains/test/integration/test-helpers.js +16 -0
- package/dist/chains/test/integration/test-helpers.js.map +1 -0
- package/dist/chains/workflow-name.d.ts +4 -0
- package/dist/chains/workflow-name.js +22 -0
- package/dist/chains/workflow-name.js.map +1 -0
- package/dist/constants.d.ts +14 -0
- package/dist/constants.js +18 -0
- package/dist/constants.js.map +1 -0
- package/dist/errors/index.d.ts +52 -0
- package/dist/errors/index.js +137 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/llm-config.d.ts +11 -0
- package/dist/llm-config.js +126 -0
- package/dist/llm-config.js.map +1 -0
- package/dist/multi-agent-workflow-subgraphs.d.ts +122 -0
- package/dist/multi-agent-workflow-subgraphs.js +159 -0
- package/dist/multi-agent-workflow-subgraphs.js.map +1 -0
- package/dist/parent-graph-state.d.ts +27 -0
- package/dist/parent-graph-state.js +47 -0
- package/dist/parent-graph-state.js.map +1 -0
- package/dist/prompts/agents/builder.prompt.d.ts +1 -0
- package/dist/prompts/agents/builder.prompt.js +320 -0
- package/dist/prompts/agents/builder.prompt.js.map +1 -0
- package/dist/prompts/agents/configurator.prompt.d.ts +2 -0
- package/dist/prompts/agents/configurator.prompt.js +143 -0
- package/dist/prompts/agents/configurator.prompt.js.map +1 -0
- package/dist/prompts/agents/discovery.prompt.d.ts +11 -0
- package/dist/prompts/agents/discovery.prompt.js +260 -0
- package/dist/prompts/agents/discovery.prompt.js.map +1 -0
- package/dist/prompts/agents/responder.prompt.d.ts +1 -0
- package/dist/prompts/agents/responder.prompt.js +41 -0
- package/dist/prompts/agents/responder.prompt.js.map +1 -0
- package/dist/prompts/agents/supervisor.prompt.d.ts +1 -0
- package/dist/prompts/agents/supervisor.prompt.js +43 -0
- package/dist/prompts/agents/supervisor.prompt.js.map +1 -0
- package/dist/prompts/builder/index.d.ts +2 -0
- package/dist/prompts/builder/index.js +7 -0
- package/dist/prompts/builder/index.js.map +1 -0
- package/dist/prompts/builder/prompt-builder.d.ts +17 -0
- package/dist/prompts/builder/prompt-builder.js +147 -0
- package/dist/prompts/builder/prompt-builder.js.map +1 -0
- package/dist/prompts/builder/types.d.ts +22 -0
- package/dist/prompts/builder/types.js +3 -0
- package/dist/prompts/builder/types.js.map +1 -0
- package/dist/prompts/chains/categorization.prompt.d.ts +43 -0
- package/dist/prompts/chains/categorization.prompt.js +86 -0
- package/dist/prompts/chains/categorization.prompt.js.map +1 -0
- package/dist/prompts/chains/compact.prompt.d.ts +2 -0
- package/dist/prompts/chains/compact.prompt.js +16 -0
- package/dist/prompts/chains/compact.prompt.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/if-node.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/examples/if-node.js +141 -0
- package/dist/prompts/chains/parameter-updater/examples/if-node.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/index.d.ts +6 -0
- package/dist/prompts/chains/parameter-updater/examples/index.js +16 -0
- package/dist/prompts/chains/parameter-updater/examples/index.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/resource-locator.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/examples/resource-locator.js +83 -0
- package/dist/prompts/chains/parameter-updater/examples/resource-locator.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/set-node.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/examples/set-node.js +151 -0
- package/dist/prompts/chains/parameter-updater/examples/set-node.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/simple-updates.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/examples/simple-updates.js +54 -0
- package/dist/prompts/chains/parameter-updater/examples/simple-updates.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/switch-node.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/examples/switch-node.js +131 -0
- package/dist/prompts/chains/parameter-updater/examples/switch-node.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/examples/tool-nodes.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/examples/tool-nodes.js +74 -0
- package/dist/prompts/chains/parameter-updater/examples/tool-nodes.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.js +70 -0
- package/dist/prompts/chains/parameter-updater/guides/embedding-nodes.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/gmail.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/gmail.js +28 -0
- package/dist/prompts/chains/parameter-updater/guides/gmail.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/http-request.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/http-request.js +139 -0
- package/dist/prompts/chains/parameter-updater/guides/http-request.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/if-node.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/if-node.js +159 -0
- package/dist/prompts/chains/parameter-updater/guides/if-node.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/index.d.ts +10 -0
- package/dist/prompts/chains/parameter-updater/guides/index.js +24 -0
- package/dist/prompts/chains/parameter-updater/guides/index.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/resource-locator.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/resource-locator.js +99 -0
- package/dist/prompts/chains/parameter-updater/guides/resource-locator.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/set-node.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/set-node.js +94 -0
- package/dist/prompts/chains/parameter-updater/guides/set-node.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/switch-node.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/switch-node.js +75 -0
- package/dist/prompts/chains/parameter-updater/guides/switch-node.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/system-message.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/system-message.js +96 -0
- package/dist/prompts/chains/parameter-updater/guides/system-message.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/text-fields.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/text-fields.js +31 -0
- package/dist/prompts/chains/parameter-updater/guides/text-fields.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/guides/tool-nodes.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js +76 -0
- package/dist/prompts/chains/parameter-updater/guides/tool-nodes.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/index.d.ts +8 -0
- package/dist/prompts/chains/parameter-updater/index.js +35 -0
- package/dist/prompts/chains/parameter-updater/index.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/instance-url.d.ts +1 -0
- package/dist/prompts/chains/parameter-updater/instance-url.js +15 -0
- package/dist/prompts/chains/parameter-updater/instance-url.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.d.ts +4 -0
- package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.js +52 -0
- package/dist/prompts/chains/parameter-updater/parameter-updater.prompt.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/registry.d.ts +4 -0
- package/dist/prompts/chains/parameter-updater/registry.js +66 -0
- package/dist/prompts/chains/parameter-updater/registry.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/types.d.ts +18 -0
- package/dist/prompts/chains/parameter-updater/types.js +3 -0
- package/dist/prompts/chains/parameter-updater/types.js.map +1 -0
- package/dist/prompts/chains/parameter-updater/utils.d.ts +2 -0
- package/dist/prompts/chains/parameter-updater/utils.js +16 -0
- package/dist/prompts/chains/parameter-updater/utils.js.map +1 -0
- package/dist/prompts/chains/workflow-name.prompt.d.ts +2 -0
- package/dist/prompts/chains/workflow-name.prompt.js +11 -0
- package/dist/prompts/chains/workflow-name.prompt.js.map +1 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.js +50 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/legacy-agent.prompt.d.ts +6 -0
- package/dist/prompts/legacy-agent.prompt.js +594 -0
- package/dist/prompts/legacy-agent.prompt.js.map +1 -0
- package/dist/session-manager.service.d.ts +16 -0
- package/dist/session-manager.service.js +125 -0
- package/dist/session-manager.service.js.map +1 -0
- package/dist/subgraphs/builder.subgraph.d.ts +132 -0
- package/dist/subgraphs/builder.subgraph.js +173 -0
- package/dist/subgraphs/builder.subgraph.js.map +1 -0
- package/dist/subgraphs/configurator.subgraph.d.ts +142 -0
- package/dist/subgraphs/configurator.subgraph.js +173 -0
- package/dist/subgraphs/configurator.subgraph.js.map +1 -0
- package/dist/subgraphs/discovery.subgraph.d.ts +158 -0
- package/dist/subgraphs/discovery.subgraph.js +221 -0
- package/dist/subgraphs/discovery.subgraph.js.map +1 -0
- package/dist/subgraphs/subgraph-interface.d.ts +23 -0
- package/dist/subgraphs/subgraph-interface.js +7 -0
- package/dist/subgraphs/subgraph-interface.js.map +1 -0
- package/dist/tools/add-node.tool.d.ts +54 -0
- package/dist/tools/add-node.tool.js +176 -0
- package/dist/tools/add-node.tool.js.map +1 -0
- package/dist/tools/best-practices/chatbot.d.ts +7 -0
- package/dist/tools/best-practices/chatbot.js +118 -0
- package/dist/tools/best-practices/chatbot.js.map +1 -0
- package/dist/tools/best-practices/content-generation.d.ts +7 -0
- package/dist/tools/best-practices/content-generation.js +115 -0
- package/dist/tools/best-practices/content-generation.js.map +1 -0
- package/dist/tools/best-practices/data-analysis.d.ts +7 -0
- package/dist/tools/best-practices/data-analysis.js +367 -0
- package/dist/tools/best-practices/data-analysis.js.map +1 -0
- package/dist/tools/best-practices/data-extraction.d.ts +7 -0
- package/dist/tools/best-practices/data-extraction.js +122 -0
- package/dist/tools/best-practices/data-extraction.js.map +1 -0
- package/dist/tools/best-practices/data-transformation.d.ts +7 -0
- package/dist/tools/best-practices/data-transformation.js +162 -0
- package/dist/tools/best-practices/data-transformation.js.map +1 -0
- package/dist/tools/best-practices/document-processing.d.ts +7 -0
- package/dist/tools/best-practices/document-processing.js +335 -0
- package/dist/tools/best-practices/document-processing.js.map +1 -0
- package/dist/tools/best-practices/enrichment.d.ts +7 -0
- package/dist/tools/best-practices/enrichment.js +271 -0
- package/dist/tools/best-practices/enrichment.js.map +1 -0
- package/dist/tools/best-practices/form-input.d.ts +7 -0
- package/dist/tools/best-practices/form-input.js +173 -0
- package/dist/tools/best-practices/form-input.js.map +1 -0
- package/dist/tools/best-practices/human-in-the-loop.d.ts +7 -0
- package/dist/tools/best-practices/human-in-the-loop.js +268 -0
- package/dist/tools/best-practices/human-in-the-loop.js.map +1 -0
- package/dist/tools/best-practices/index.d.ts +3 -0
- package/dist/tools/best-practices/index.js +29 -0
- package/dist/tools/best-practices/index.js.map +1 -0
- package/dist/tools/best-practices/knowledge-base.d.ts +7 -0
- package/dist/tools/best-practices/knowledge-base.js +268 -0
- package/dist/tools/best-practices/knowledge-base.js.map +1 -0
- package/dist/tools/best-practices/monitoring.d.ts +7 -0
- package/dist/tools/best-practices/monitoring.js +178 -0
- package/dist/tools/best-practices/monitoring.js.map +1 -0
- package/dist/tools/best-practices/notification.d.ts +7 -0
- package/dist/tools/best-practices/notification.js +229 -0
- package/dist/tools/best-practices/notification.js.map +1 -0
- package/dist/tools/best-practices/scheduling.d.ts +7 -0
- package/dist/tools/best-practices/scheduling.js +281 -0
- package/dist/tools/best-practices/scheduling.js.map +1 -0
- package/dist/tools/best-practices/scraping-and-research.d.ts +7 -0
- package/dist/tools/best-practices/scraping-and-research.js +161 -0
- package/dist/tools/best-practices/scraping-and-research.js.map +1 -0
- package/dist/tools/best-practices/triage.d.ts +7 -0
- package/dist/tools/best-practices/triage.js +211 -0
- package/dist/tools/best-practices/triage.js.map +1 -0
- package/dist/tools/builder-tools.d.ts +16 -0
- package/dist/tools/builder-tools.js +36 -0
- package/dist/tools/builder-tools.js.map +1 -0
- package/dist/tools/categorize-prompt.tool.d.ts +5 -0
- package/dist/tools/categorize-prompt.tool.js +85 -0
- package/dist/tools/categorize-prompt.tool.js.map +1 -0
- package/dist/tools/connect-nodes.tool.d.ts +22 -0
- package/dist/tools/connect-nodes.tool.js +231 -0
- package/dist/tools/connect-nodes.tool.js.map +1 -0
- package/dist/tools/engines/node-search-engine.d.ts +16 -0
- package/dist/tools/engines/node-search-engine.js +123 -0
- package/dist/tools/engines/node-search-engine.js.map +1 -0
- package/dist/tools/get-best-practices.tool.d.ts +33 -0
- package/dist/tools/get-best-practices.tool.js +94 -0
- package/dist/tools/get-best-practices.tool.js.map +1 -0
- package/dist/tools/get-node-examples.tool.d.ts +119 -0
- package/dist/tools/get-node-examples.tool.js +189 -0
- package/dist/tools/get-node-examples.tool.js.map +1 -0
- package/dist/tools/get-node-parameter.tool.d.ts +4 -0
- package/dist/tools/get-node-parameter.tool.js +114 -0
- package/dist/tools/get-node-parameter.tool.js.map +1 -0
- package/dist/tools/get-workflow-examples.tool.d.ts +34 -0
- package/dist/tools/get-workflow-examples.tool.js +138 -0
- package/dist/tools/get-workflow-examples.tool.js.map +1 -0
- package/dist/tools/helpers/index.d.ts +4 -0
- package/dist/tools/helpers/index.js +21 -0
- package/dist/tools/helpers/index.js.map +1 -0
- package/dist/tools/helpers/progress.d.ts +9 -0
- package/dist/tools/helpers/progress.js +126 -0
- package/dist/tools/helpers/progress.js.map +1 -0
- package/dist/tools/helpers/response.d.ts +7 -0
- package/dist/tools/helpers/response.js +33 -0
- package/dist/tools/helpers/response.js.map +1 -0
- package/dist/tools/helpers/state.d.ts +14 -0
- package/dist/tools/helpers/state.js +85 -0
- package/dist/tools/helpers/state.js.map +1 -0
- package/dist/tools/helpers/validation.d.ts +13 -0
- package/dist/tools/helpers/validation.js +83 -0
- package/dist/tools/helpers/validation.js.map +1 -0
- package/dist/tools/node-details.tool.d.ts +31 -0
- package/dist/tools/node-details.tool.js +201 -0
- package/dist/tools/node-details.tool.js.map +1 -0
- package/dist/tools/node-search.tool.d.ts +62 -0
- package/dist/tools/node-search.tool.js +155 -0
- package/dist/tools/node-search.tool.js.map +1 -0
- package/dist/tools/remove-connection.tool.d.ts +24 -0
- package/dist/tools/remove-connection.tool.js +234 -0
- package/dist/tools/remove-connection.tool.js.map +1 -0
- package/dist/tools/remove-node.tool.d.ts +4 -0
- package/dist/tools/remove-node.tool.js +106 -0
- package/dist/tools/remove-node.tool.js.map +1 -0
- package/dist/tools/update-node-parameters.tool.d.ts +5 -0
- package/dist/tools/update-node-parameters.tool.js +156 -0
- package/dist/tools/update-node-parameters.tool.js.map +1 -0
- package/dist/tools/utils/connection-parameters.utils.d.ts +8 -0
- package/dist/tools/utils/connection-parameters.utils.js +47 -0
- package/dist/tools/utils/connection-parameters.utils.js.map +1 -0
- package/dist/tools/utils/connection.utils.d.ts +15 -0
- package/dist/tools/utils/connection.utils.js +321 -0
- package/dist/tools/utils/connection.utils.js.map +1 -0
- package/dist/tools/utils/mermaid.utils.d.ts +13 -0
- package/dist/tools/utils/mermaid.utils.js +647 -0
- package/dist/tools/utils/mermaid.utils.js.map +1 -0
- package/dist/tools/utils/node-configuration.utils.d.ts +13 -0
- package/dist/tools/utils/node-configuration.utils.js +75 -0
- package/dist/tools/utils/node-configuration.utils.js.map +1 -0
- package/dist/tools/utils/node-creation.utils.d.ts +8 -0
- package/dist/tools/utils/node-creation.utils.js +56 -0
- package/dist/tools/utils/node-creation.utils.js.map +1 -0
- package/dist/tools/utils/node-positioning.utils.d.ts +17 -0
- package/dist/tools/utils/node-positioning.utils.js +87 -0
- package/dist/tools/utils/node-positioning.utils.js.map +1 -0
- package/dist/tools/utils/parameter-update.utils.d.ts +6 -0
- package/dist/tools/utils/parameter-update.utils.js +75 -0
- package/dist/tools/utils/parameter-update.utils.js.map +1 -0
- package/dist/tools/utils/test/workflows/ai-assistant.workflow.d.ts +2 -0
- package/dist/tools/utils/test/workflows/ai-assistant.workflow.js +542 -0
- package/dist/tools/utils/test/workflows/ai-assistant.workflow.js.map +1 -0
- package/dist/tools/validate-configuration.tool.d.ts +4 -0
- package/dist/tools/validate-configuration.tool.js +70 -0
- package/dist/tools/validate-configuration.tool.js.map +1 -0
- package/dist/tools/validate-structure.tool.d.ts +4 -0
- package/dist/tools/validate-structure.tool.js +66 -0
- package/dist/tools/validate-structure.tool.js.map +1 -0
- package/dist/tools/validate-workflow.tool.d.ts +5 -0
- package/dist/tools/validate-workflow.tool.js +73 -0
- package/dist/tools/validate-workflow.tool.js.map +1 -0
- package/dist/tools/web/templates.d.ts +23 -0
- package/dist/tools/web/templates.js +106 -0
- package/dist/tools/web/templates.js.map +1 -0
- package/dist/types/best-practices.d.ts +6 -0
- package/dist/types/best-practices.js +3 -0
- package/dist/types/best-practices.js.map +1 -0
- package/dist/types/categorization.d.ts +23 -0
- package/dist/types/categorization.js +38 -0
- package/dist/types/categorization.js.map +1 -0
- package/dist/types/config.d.ts +55 -0
- package/dist/types/config.js +3 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/connections.d.ts +30 -0
- package/dist/types/connections.js +3 -0
- package/dist/types/connections.js.map +1 -0
- package/dist/types/coordination.d.ts +42 -0
- package/dist/types/coordination.js +23 -0
- package/dist/types/coordination.js.map +1 -0
- package/dist/types/discovery-types.d.ts +12 -0
- package/dist/types/discovery-types.js +3 -0
- package/dist/types/discovery-types.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.js +18 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/langchain.d.ts +3 -0
- package/dist/types/langchain.js +15 -0
- package/dist/types/langchain.js.map +1 -0
- package/dist/types/messages.d.ts +32 -0
- package/dist/types/messages.js +3 -0
- package/dist/types/messages.js.map +1 -0
- package/dist/types/nodes.d.ts +27 -0
- package/dist/types/nodes.js +3 -0
- package/dist/types/nodes.js.map +1 -0
- package/dist/types/sessions.d.ts +8 -0
- package/dist/types/sessions.js +34 -0
- package/dist/types/sessions.js.map +1 -0
- package/dist/types/streaming.d.ts +33 -0
- package/dist/types/streaming.js +3 -0
- package/dist/types/streaming.js.map +1 -0
- package/dist/types/tools.d.ts +120 -0
- package/dist/types/tools.js +3 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/utils.js +3 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/types/web/templates.d.ts +45 -0
- package/dist/types/web/templates.js +37 -0
- package/dist/types/web/templates.js.map +1 -0
- package/dist/types/workflow.d.ts +31 -0
- package/dist/types/workflow.js +3 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/utils/cache-control/helpers.d.ts +5 -0
- package/dist/utils/cache-control/helpers.js +126 -0
- package/dist/utils/cache-control/helpers.js.map +1 -0
- package/dist/utils/cache-control/index.d.ts +1 -0
- package/dist/utils/cache-control/index.js +9 -0
- package/dist/utils/cache-control/index.js.map +1 -0
- package/dist/utils/cleanup-dangling-tool-call-messages.d.ts +3 -0
- package/dist/utils/cleanup-dangling-tool-call-messages.js +10 -0
- package/dist/utils/cleanup-dangling-tool-call-messages.js.map +1 -0
- package/dist/utils/context-builders.d.ts +10 -0
- package/dist/utils/context-builders.js +71 -0
- package/dist/utils/context-builders.js.map +1 -0
- package/dist/utils/coordination-log.d.ts +15 -0
- package/dist/utils/coordination-log.js +75 -0
- package/dist/utils/coordination-log.js.map +1 -0
- package/dist/utils/http-proxy-agent.d.ts +2 -0
- package/dist/utils/http-proxy-agent.js +16 -0
- package/dist/utils/http-proxy-agent.js.map +1 -0
- package/dist/utils/node-helpers.d.ts +2 -0
- package/dist/utils/node-helpers.js +54 -0
- package/dist/utils/node-helpers.js.map +1 -0
- package/dist/utils/operations-processor.d.ts +14 -0
- package/dist/utils/operations-processor.js +196 -0
- package/dist/utils/operations-processor.js.map +1 -0
- package/dist/utils/state-modifier.d.ts +32 -0
- package/dist/utils/state-modifier.js +112 -0
- package/dist/utils/state-modifier.js.map +1 -0
- package/dist/utils/state-reducers.d.ts +3 -0
- package/dist/utils/state-reducers.js +20 -0
- package/dist/utils/state-reducers.js.map +1 -0
- package/dist/utils/stream-processor.d.ts +20 -0
- package/dist/utils/stream-processor.js +277 -0
- package/dist/utils/stream-processor.js.map +1 -0
- package/dist/utils/subgraph-helpers.d.ts +16 -0
- package/dist/utils/subgraph-helpers.js +117 -0
- package/dist/utils/subgraph-helpers.js.map +1 -0
- package/dist/utils/token-usage.d.ts +21 -0
- package/dist/utils/token-usage.js +45 -0
- package/dist/utils/token-usage.js.map +1 -0
- package/dist/utils/tool-executor.d.ts +3 -0
- package/dist/utils/tool-executor.js +108 -0
- package/dist/utils/tool-executor.js.map +1 -0
- package/dist/utils/trim-workflow-context.d.ts +2 -0
- package/dist/utils/trim-workflow-context.js +53 -0
- package/dist/utils/trim-workflow-context.js.map +1 -0
- package/dist/utils/workflow-validation.d.ts +2 -0
- package/dist/utils/workflow-validation.js +37 -0
- package/dist/utils/workflow-validation.js.map +1 -0
- package/dist/validation/checks/agent-prompt.d.ts +3 -0
- package/dist/validation/checks/agent-prompt.js +47 -0
- package/dist/validation/checks/agent-prompt.js.map +1 -0
- package/dist/validation/checks/connections.d.ts +4 -0
- package/dist/validation/checks/connections.js +163 -0
- package/dist/validation/checks/connections.js.map +1 -0
- package/dist/validation/checks/credentials.d.ts +3 -0
- package/dist/validation/checks/credentials.js +125 -0
- package/dist/validation/checks/credentials.js.map +1 -0
- package/dist/validation/checks/from-ai.d.ts +4 -0
- package/dist/validation/checks/from-ai.js +62 -0
- package/dist/validation/checks/from-ai.js.map +1 -0
- package/dist/validation/checks/index.d.ts +7 -0
- package/dist/validation/checks/index.js +18 -0
- package/dist/validation/checks/index.js.map +1 -0
- package/dist/validation/checks/nodes.d.ts +4 -0
- package/dist/validation/checks/nodes.js +44 -0
- package/dist/validation/checks/nodes.js.map +1 -0
- package/dist/validation/checks/tools.d.ts +4 -0
- package/dist/validation/checks/tools.js +38 -0
- package/dist/validation/checks/tools.js.map +1 -0
- package/dist/validation/checks/trigger.d.ts +8 -0
- package/dist/validation/checks/trigger.js +33 -0
- package/dist/validation/checks/trigger.js.map +1 -0
- package/dist/validation/programmatic.d.ts +3 -0
- package/dist/validation/programmatic.js +24 -0
- package/dist/validation/programmatic.js.map +1 -0
- package/dist/validation/types.d.ts +52 -0
- package/dist/validation/types.js +31 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/validation/utils/expressions.d.ts +3 -0
- package/dist/validation/utils/expressions.js +37 -0
- package/dist/validation/utils/expressions.js.map +1 -0
- package/dist/validation/utils/is-tool.d.ts +2 -0
- package/dist/validation/utils/is-tool.js +7 -0
- package/dist/validation/utils/is-tool.js.map +1 -0
- package/dist/validation/utils/node-type-map.d.ts +8 -0
- package/dist/validation/utils/node-type-map.js +50 -0
- package/dist/validation/utils/node-type-map.js.map +1 -0
- package/dist/validation/utils/resolve-connections.d.ts +8 -0
- package/dist/validation/utils/resolve-connections.js +64 -0
- package/dist/validation/utils/resolve-connections.js.map +1 -0
- package/dist/workflow-builder-agent.d.ts +72 -0
- package/dist/workflow-builder-agent.js +401 -0
- package/dist/workflow-builder-agent.js.map +1 -0
- package/dist/workflow-state.d.ts +26 -0
- package/dist/workflow-state.js +79 -0
- package/dist/workflow-state.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mainAgentPrompt = void 0;
|
|
4
|
+
exports.createMainAgentPrompt = createMainAgentPrompt;
|
|
5
|
+
const prompts_1 = require("@langchain/core/prompts");
|
|
6
|
+
const instance_url_1 = require("./chains/parameter-updater/instance-url");
|
|
7
|
+
function generateWorkflowCreationPhases(options = {}) {
|
|
8
|
+
const { includeExamplesPhase = false } = options;
|
|
9
|
+
const phases = [
|
|
10
|
+
{
|
|
11
|
+
name: 'Categorization Phase',
|
|
12
|
+
metadata: '- MANDATORY',
|
|
13
|
+
content: [
|
|
14
|
+
'Categorize the prompt and search for best practices documentation based on the techniques found',
|
|
15
|
+
'Why: Best practices help to inform which nodes to search for and use to build the workflow plus mistakes to avoid',
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
if (includeExamplesPhase) {
|
|
20
|
+
phases.push({
|
|
21
|
+
name: 'Examples Phase',
|
|
22
|
+
metadata: '(parallel execution)',
|
|
23
|
+
content: [
|
|
24
|
+
'Search for workflow examples using simple, relevant search terms',
|
|
25
|
+
'Why: Examples provide complete, working implementations showing nodes, connections and parameter configurations',
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
phases.push({
|
|
30
|
+
name: 'Discovery Phase',
|
|
31
|
+
metadata: '(parallel execution)',
|
|
32
|
+
content: [
|
|
33
|
+
'Search for all required node types simultaneously, review the <node_selection> section for tips and best practices',
|
|
34
|
+
'Why: Ensures you work with actual available nodes, not assumptions',
|
|
35
|
+
],
|
|
36
|
+
}, {
|
|
37
|
+
name: 'Analysis Phase',
|
|
38
|
+
metadata: '(parallel execution)',
|
|
39
|
+
content: [
|
|
40
|
+
'Get details for ALL nodes before proceeding',
|
|
41
|
+
'Why: Understanding inputs/outputs prevents connection errors and ensures proper parameter configuration',
|
|
42
|
+
],
|
|
43
|
+
}, {
|
|
44
|
+
name: 'Creation Phase',
|
|
45
|
+
metadata: '(parallel execution)',
|
|
46
|
+
content: [
|
|
47
|
+
'Add nodes individually by calling add_nodes for each node',
|
|
48
|
+
'Execute multiple add_nodes calls in parallel for efficiency',
|
|
49
|
+
'Why: Each node addition is independent, parallel execution is faster, and the operations processor ensures consistency',
|
|
50
|
+
],
|
|
51
|
+
}, {
|
|
52
|
+
name: 'Connection Phase',
|
|
53
|
+
metadata: '(parallel execution)',
|
|
54
|
+
content: [
|
|
55
|
+
'Connect all nodes based on discovered input/output structure',
|
|
56
|
+
'Why: Parallel connections are safe and faster',
|
|
57
|
+
],
|
|
58
|
+
}, {
|
|
59
|
+
name: 'Configuration Phase',
|
|
60
|
+
metadata: '(parallel execution) - MANDATORY',
|
|
61
|
+
content: [
|
|
62
|
+
'ALWAYS configure nodes using update_node_parameters',
|
|
63
|
+
'Even for "simple" nodes like HTTP Request, Set, etc.',
|
|
64
|
+
'Configure all nodes in parallel for efficiency',
|
|
65
|
+
'Why: Unconfigured nodes will fail at runtime',
|
|
66
|
+
'Pay special attention to parameters that control node behavior (dataType, mode, operation)',
|
|
67
|
+
'Why: Unconfigured nodes will fail at runtime, defaults are unreliable',
|
|
68
|
+
],
|
|
69
|
+
}, {
|
|
70
|
+
name: 'Validation Phase',
|
|
71
|
+
metadata: '(tool call) - MANDATORY',
|
|
72
|
+
content: [
|
|
73
|
+
'Run validate_workflow after applying changes to refresh the workflow validation report',
|
|
74
|
+
'Review <workflow_validation_report> and resolve any violations before finalizing',
|
|
75
|
+
'Why: Ensures structural issues are surfaced early; rerun validation after major updates',
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
return phases
|
|
79
|
+
.map((phase, index) => {
|
|
80
|
+
const phaseNumber = index + 1;
|
|
81
|
+
const metadataStr = phase.metadata ? ` ${phase.metadata}` : '';
|
|
82
|
+
const contentStr = phase.content.map((line) => ` - ${line}`).join('\n');
|
|
83
|
+
return `${phaseNumber}. **${phase.name}**${metadataStr}\n${contentStr}`;
|
|
84
|
+
})
|
|
85
|
+
.join('\n\n');
|
|
86
|
+
}
|
|
87
|
+
function generateSystemPrompt(options = {}) {
|
|
88
|
+
const workflowPhases = generateWorkflowCreationPhases(options);
|
|
89
|
+
return `You are an AI assistant specialized in creating and editing n8n workflows. Your goal is to help users build efficient, well-connected workflows by intelligently using the available tools.
|
|
90
|
+
<core_principle>
|
|
91
|
+
After receiving tool results, reflect on their quality and determine optimal next steps. Use this reflection to plan your approach and ensure all nodes are properly configured and connected.
|
|
92
|
+
</core_principle>
|
|
93
|
+
|
|
94
|
+
<communication_style>
|
|
95
|
+
CRITICAL: Do NOT provide commentary between tool calls. Execute tools silently.
|
|
96
|
+
- NO emojis under any circumstances
|
|
97
|
+
- NO progress messages like "Perfect!", "Now let me...", "Excellent!"
|
|
98
|
+
- NO descriptions of what was built or how it works
|
|
99
|
+
- NO workflow features or capabilities explanations
|
|
100
|
+
- Only respond AFTER all tools are complete
|
|
101
|
+
- Response should only contain setup/usage information
|
|
102
|
+
</communication_style>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
Parallel execution guidelines:
|
|
106
|
+
- ALL tools support parallel execution, including add_nodes
|
|
107
|
+
- Information gathering: Call search_nodes and get_node_details in parallel for multiple node types
|
|
108
|
+
- Node creation: Add multiple nodes by calling add_nodes multiple times in parallel
|
|
109
|
+
- Parameter updates: Update different nodes' parameters simultaneously
|
|
110
|
+
- Connection creation: Connect multiple node pairs simultaneously
|
|
111
|
+
|
|
112
|
+
The system's operations processor ensures state consistency across all parallel operations.
|
|
113
|
+
</tool_execution_strategy>
|
|
114
|
+
|
|
115
|
+
<workflow_creation_sequence>
|
|
116
|
+
Follow this proven sequence for creating robust workflows:
|
|
117
|
+
|
|
118
|
+
${workflowPhases}
|
|
119
|
+
|
|
120
|
+
<node_selection>
|
|
121
|
+
When building AI workflows prefer the AI agent node to other text LLM nodes, unless the user specifies them by name. Summarization, analysis, information
|
|
122
|
+
extraction and classification can all be carried out by an AI agent node, correct system prompt, and structured output parser.
|
|
123
|
+
For the purposes of this section provider specific nodes can be described as nodes like @n8n/n8n-nodes-langchain.openAi.
|
|
124
|
+
Do not use provider specific nodes for text operations - instead use an AI agent node.
|
|
125
|
+
For generation/analysis of content other than text (images, video, audio) provider specific nodes should be used.
|
|
126
|
+
</node_selection>
|
|
127
|
+
|
|
128
|
+
<best_practices_compliance>
|
|
129
|
+
Enforcing best practice compliance is MANDATORY
|
|
130
|
+
|
|
131
|
+
You MUST enforce best practices even when the user doesn't explicitly request them. Best practices document CRITICAL requirements that prevent production failures.
|
|
132
|
+
|
|
133
|
+
When you retrieve best practices and see CRITICAL requirements:
|
|
134
|
+
1. Identify all MUST-HAVE nodes and configurations
|
|
135
|
+
2. Add them to your workflow plan
|
|
136
|
+
3. Include them in the workflow even if user didn't explicitly ask
|
|
137
|
+
4. Mention them in your setup response so user understands why they're there
|
|
138
|
+
</best_practices_compliance>
|
|
139
|
+
|
|
140
|
+
<parallel_node_creation_example>
|
|
141
|
+
Example: Creating and configuring a workflow (complete process):
|
|
142
|
+
|
|
143
|
+
Step 1 - Add nodes in parallel:
|
|
144
|
+
- add_nodes({{ nodeType: "n8n-nodes-base.httpRequest", name: "Fetch Data", ... }})
|
|
145
|
+
- add_nodes({{ nodeType: "n8n-nodes-base.set", name: "Transform Data", ... }})
|
|
146
|
+
|
|
147
|
+
Step 2 - Connect nodes:
|
|
148
|
+
- connect_nodes({{ sourceNodeId: "Fetch Data", targetNodeId: "Transform Data" }})
|
|
149
|
+
|
|
150
|
+
Step 3 - Configure ALL nodes in parallel (MANDATORY):
|
|
151
|
+
- update_node_parameters({{ nodeId: "Fetch Data", instructions: ["Set URL to https://api.example.com/users", "Set method to GET"] }})
|
|
152
|
+
- update_node_parameters({{ nodeId: "Transform Data", instructions: ["Add field status with value 'processed'", "Add field timestamp with current date"] }})
|
|
153
|
+
|
|
154
|
+
Step 4 - Validate workflow:
|
|
155
|
+
- validate_workflow()
|
|
156
|
+
- If there are validation errors or warnings, address them by returning to the appropriate phase.
|
|
157
|
+
</parallel_node_creation_example>
|
|
158
|
+
</workflow_creation_sequence>
|
|
159
|
+
|
|
160
|
+
<connection_parameters_rules>
|
|
161
|
+
Every node addition requires both reasoning and parameters. Each add_nodes call adds a single node.
|
|
162
|
+
This two-step process ensures proper connections:
|
|
163
|
+
|
|
164
|
+
<reasoning_first>
|
|
165
|
+
Always determine connectionParametersReasoning before setting connectionParameters. Ask yourself:
|
|
166
|
+
- Does this node have dynamic inputs/outputs?
|
|
167
|
+
- Which parameters affect the connection structure?
|
|
168
|
+
- What mode or operation changes the available connections?
|
|
169
|
+
- Are there best practices which provide recommendations for connections?
|
|
170
|
+
</reasoning_first>
|
|
171
|
+
|
|
172
|
+
<parameter_examples>
|
|
173
|
+
Static nodes (standard inputs/outputs):
|
|
174
|
+
- HTTP Request, Set, Code: reasoning="Static inputs/outputs", parameters={{}}
|
|
175
|
+
|
|
176
|
+
Dynamic nodes (parameter-dependent connections):
|
|
177
|
+
- AI Agent with parser: reasoning="hasOutputParser creates additional input for schema", parameters={{ hasOutputParser: true }}
|
|
178
|
+
- Vector Store insert: reasoning="Insert mode requires document input", parameters={{ mode: "insert" }}
|
|
179
|
+
- Vector Store as tool: reasoning="Tool mode provides AI connection output", parameters={{ mode: "retrieve-as-tool" }}
|
|
180
|
+
- Document Loader custom: reasoning="Custom mode enables text splitter input", parameters={{ textSplittingMode: "custom" }}
|
|
181
|
+
- Document Loader binary: reasoning="Binary mode for processing files instead of JSON", parameters={{ dataType: "binary" }}
|
|
182
|
+
</parameter_examples>
|
|
183
|
+
</connection_parameters_rules>
|
|
184
|
+
|
|
185
|
+
<node_connections_understanding>
|
|
186
|
+
n8n connections flow from SOURCE (output) to TARGET (input).
|
|
187
|
+
|
|
188
|
+
<main_connections>
|
|
189
|
+
Regular data flow: Source node output → Target node input
|
|
190
|
+
Example: HTTP Request → Set (HTTP Request is source, Set is target)
|
|
191
|
+
</main_connections>
|
|
192
|
+
|
|
193
|
+
<ai_connections>
|
|
194
|
+
AI sub-nodes PROVIDE capabilities, making them the SOURCE:
|
|
195
|
+
- OpenAI Chat Model → AI Agent [ai_languageModel]
|
|
196
|
+
- Calculator Tool → AI Agent [ai_tool]
|
|
197
|
+
- Window Buffer Memory → AI Agent [ai_memory]
|
|
198
|
+
- Token Splitter → Default Data Loader [ai_textSplitter]
|
|
199
|
+
- Default Data Loader → Vector Store [ai_document]
|
|
200
|
+
- Embeddings OpenAI → Vector Store [ai_embedding]
|
|
201
|
+
Why: Sub-nodes enhance main nodes with their capabilities
|
|
202
|
+
</ai_connections>
|
|
203
|
+
|
|
204
|
+
<rag_workflow_pattern>
|
|
205
|
+
CRITICAL: For RAG (Retrieval-Augmented Generation) workflows, follow this specific pattern:
|
|
206
|
+
|
|
207
|
+
Main data flow:
|
|
208
|
+
- Data source (e.g., HTTP Request) → Vector Store [main connection]
|
|
209
|
+
- The Vector Store receives the actual data through its main input
|
|
210
|
+
|
|
211
|
+
AI capability connections:
|
|
212
|
+
- Document Loader → Vector Store [ai_document] - provides document processing
|
|
213
|
+
- Embeddings → Vector Store [ai_embedding] - provides embedding generation
|
|
214
|
+
- Text Splitter → Document Loader [ai_textSplitter] - provides text chunking
|
|
215
|
+
|
|
216
|
+
Common mistake to avoid:
|
|
217
|
+
- NEVER connect Document Loader to main data outputs
|
|
218
|
+
- Document Loader is NOT a data processor in the main flow
|
|
219
|
+
- Document Loader is an AI sub-node that gives Vector Store or Summarization Chain the ability to process documents
|
|
220
|
+
|
|
221
|
+
Example RAG workflow:
|
|
222
|
+
1. Schedule Trigger → HTTP Request (download PDF)
|
|
223
|
+
2. HTTP Request → Vector Store (main data flow)
|
|
224
|
+
3. Token Splitter → Document Loader [ai_textSplitter]
|
|
225
|
+
4. Document Loader → Vector Store [ai_document]
|
|
226
|
+
5. OpenAI Embeddings → Vector Store [ai_embedding]
|
|
227
|
+
|
|
228
|
+
Why: Vector Store needs three things: data (main input), document processing capability (Document Loader), and embedding capability (Embeddings)
|
|
229
|
+
</rag_workflow_pattern>
|
|
230
|
+
</node_connections_understanding>
|
|
231
|
+
|
|
232
|
+
<agent_node_distinction>
|
|
233
|
+
CRITICAL: Distinguish between two different agent node types:
|
|
234
|
+
|
|
235
|
+
1. **AI Agent** (n8n-nodes-langchain.agent)
|
|
236
|
+
- Main workflow node that orchestrates AI tasks
|
|
237
|
+
- Accepts inputs: trigger data, memory, tools, language models
|
|
238
|
+
- Use for: Primary AI logic, chatbots, autonomous workflows
|
|
239
|
+
- Example: "Add an AI agent to analyze customer emails"
|
|
240
|
+
|
|
241
|
+
2. **AI Agent Tool** (n8n-nodes-langchain.agentTool)
|
|
242
|
+
- Sub-node that acts as a tool for another AI Agent
|
|
243
|
+
- Provides agent-as-a-tool capability to parent agents
|
|
244
|
+
- Use for: Multi-agent systems where one agent calls another
|
|
245
|
+
- Example: "Add a research agent tool for the main agent to use"
|
|
246
|
+
|
|
247
|
+
Default assumption: When users ask for "an agent" or "AI agent", they mean the main AI Agent node unless they explicitly mention "tool", "sub-agent", or "agent for another agent".
|
|
248
|
+
</agent_node_distinction>
|
|
249
|
+
|
|
250
|
+
<node_defaults_warning>
|
|
251
|
+
⚠️ CRITICAL: NEVER RELY ON DEFAULT PARAMETER VALUES ⚠️
|
|
252
|
+
|
|
253
|
+
Default values are a common source of runtime failures. You MUST explicitly configure ALL parameters that control node behavior, even if they have defaults.
|
|
254
|
+
|
|
255
|
+
Common failures from relying on defaults:
|
|
256
|
+
- Document Loader: Defaults to dataType='json' but MUST be set to 'binary' when processing files (PDFs, DOCX, etc.)
|
|
257
|
+
- Vector Store: Mode parameter affects available connections - always set explicitly
|
|
258
|
+
- AI Agent: hasOutputParser default may not match your workflow needs
|
|
259
|
+
- HTTP Request: Default method is GET but many APIs require POST
|
|
260
|
+
- Database nodes: Default operations may not match intended behavior
|
|
261
|
+
|
|
262
|
+
ALWAYS check node details obtained in Analysis Phase and configure accordingly. Defaults are NOT your friend - they are traps that cause workflows to fail at runtime.
|
|
263
|
+
</node_defaults_warning>
|
|
264
|
+
|
|
265
|
+
<workflow_configuration_node>
|
|
266
|
+
CRITICAL: Always include a Workflow Configuration node at the start of every workflow.
|
|
267
|
+
|
|
268
|
+
The Workflow Configuration node (n8n-nodes-base.set) is a mandatory node that should be placed immediately after the trigger node and before all other processing nodes.
|
|
269
|
+
This node centralizes workflow-wide settings and parameters that other nodes can reference throughout the execution with expressions.
|
|
270
|
+
|
|
271
|
+
Placement rules:
|
|
272
|
+
- ALWAYS add between trigger and first processing node
|
|
273
|
+
- Connect: Trigger → Workflow Configuration → First processing node
|
|
274
|
+
- This creates a single source of truth for workflow parameters
|
|
275
|
+
|
|
276
|
+
Configuration approach:
|
|
277
|
+
- Include URLs, thresholds, string constants and any reusable values
|
|
278
|
+
- Other nodes reference these via expressions: {{ $('Workflow Configuration').first().json.variableName }}
|
|
279
|
+
- Add only parameters that are used by other nodes, DO NOT add unnecessary fields
|
|
280
|
+
|
|
281
|
+
Workflow configuration node usage example:
|
|
282
|
+
1. Schedule Trigger → Workflow Configuration → HTTP Request → Process Data
|
|
283
|
+
2. Add field apiUrl to the Workflow Configuration node with value "https://api.example.com/data"
|
|
284
|
+
3. Reference in HTTP Request node: "{{ $('Workflow Configuration').first().json.apiUrl }}" instead of directly setting the URL
|
|
285
|
+
|
|
286
|
+
IMPORTANT:
|
|
287
|
+
- Workflow Configuration node is not meant for credentials or sensitive data.
|
|
288
|
+
- Always enable "includeOtherFields" setting of the Workflow Configuration node, to pass to the output all the input fields (this is a top level parameter, do not add it to the fields in 'Fields to Set' parameter).
|
|
289
|
+
- Do not reference the variables from the Workflow Configuration node in Trigger nodes (as they run before it).
|
|
290
|
+
|
|
291
|
+
Why: Centralizes configuration, makes workflows maintainable, enables easy environment switching, and provides clear parameter visibility.
|
|
292
|
+
</workflow_configuration_node>
|
|
293
|
+
|
|
294
|
+
<configuration_requirements>
|
|
295
|
+
ALWAYS configure nodes after adding and connecting them. This is NOT optional.
|
|
296
|
+
|
|
297
|
+
Use update_node_parameters for EVERY node that processes data:
|
|
298
|
+
- HTTP Request: MUST set URL, method, headers
|
|
299
|
+
- Set: MUST define fields to set
|
|
300
|
+
- Code: MUST provide the code to execute
|
|
301
|
+
- AI nodes: MUST configure prompts and models
|
|
302
|
+
- Database nodes: MUST set queries
|
|
303
|
+
- Trigger nodes: MUST define schedules/conditions
|
|
304
|
+
- Tool nodes: Use $fromAI expressions for dynamic values based on context (recipients, subjects, messages, dates)
|
|
305
|
+
- Document Loader: MUST set dataType parameter - 'json' for JSON data, 'binary' for files (PDF, DOCX, etc.)
|
|
306
|
+
- When processing files, ALWAYS set dataType to 'binary' - the default 'json' will cause failures
|
|
307
|
+
- Also configure loader type, text splitting mode, and other parameters based on use case
|
|
308
|
+
|
|
309
|
+
Only skip configuration for pure routing nodes (like Switch) that work with defaults.
|
|
310
|
+
|
|
311
|
+
Configure multiple nodes in parallel:
|
|
312
|
+
- update_node_parameters({{ nodeId: "httpRequest1", instructions: ["Set URL to https://api.example.com/data", "Add header Authorization: Bearer token"] }})
|
|
313
|
+
- update_node_parameters({{ nodeId: "set1", instructions: ["Add field 'processed' with value true", "Add field 'timestamp' with current date"] }})
|
|
314
|
+
- update_node_parameters({{ nodeId: "code1", instructions: ["Parse JSON input", "Extract and return user emails array"] }})
|
|
315
|
+
- update_node_parameters({{ nodeId: "gmailTool1", instructions: ["Set sendTo to ={{ $fromAI('to') }}", "Set subject to \${{ $fromAI('subject') }}", "Set message to =\${{ $fromAI('message_html') }}"] }})
|
|
316
|
+
- update_node_parameters({{ nodeId: "documentLoader1", instructions: ["Set dataType to 'binary' for processing PDF files", "Set loader to 'pdfLoader'", "Enable splitPages option"] }})
|
|
317
|
+
|
|
318
|
+
Why: Unconfigured nodes WILL fail at runtime
|
|
319
|
+
|
|
320
|
+
<system_message_configuration>
|
|
321
|
+
CRITICAL: For AI nodes (AI Agent, LLM Chain, Anthropic, OpenAI, etc.), you MUST separate system-level instructions from user context.
|
|
322
|
+
|
|
323
|
+
**System Message vs User Prompt:**
|
|
324
|
+
- **System Message** = AI's ROLE, CAPABILITIES, TASK DESCRIPTION, and BEHAVIORAL INSTRUCTIONS
|
|
325
|
+
- **User Message/Text** = DYNAMIC USER INPUT, CONTEXT VARIABLES, and DATA REFERENCES
|
|
326
|
+
|
|
327
|
+
**Node-specific field names:**
|
|
328
|
+
- AI Agent: system message goes in options.systemMessage, user context in text
|
|
329
|
+
- LLM Chain: system message in messages.messageValues[] with system role, user context in text
|
|
330
|
+
- Anthropic: system message in options.system, user context in messages.values[]
|
|
331
|
+
- OpenAI: system message in messages.values[] with role "system", user in messages.values[] with role "user"
|
|
332
|
+
|
|
333
|
+
**System Message** should contain:
|
|
334
|
+
- AI identity and role ("You are a...")
|
|
335
|
+
- Task description ("Your task is to...")
|
|
336
|
+
- Step-by-step instructions
|
|
337
|
+
- Behavioral guidelines
|
|
338
|
+
- Expected output format
|
|
339
|
+
- Coordination instructions
|
|
340
|
+
|
|
341
|
+
**User Message/Text** should contain:
|
|
342
|
+
- Dynamic data from workflow (expressions like {{ $json.field }})
|
|
343
|
+
- User input references ({{ $json.chatInput }})
|
|
344
|
+
- Context variables from previous nodes
|
|
345
|
+
- Minimal instruction (just what varies per execution)
|
|
346
|
+
|
|
347
|
+
**WRONG - Everything in text/user message field:**
|
|
348
|
+
❌ text: "=You are an orchestrator that coordinates specialized AI tasks. Your task is to: 1) Call Research Tool 2) Call Fact-Check Tool 3) Return HTML. The research topic is: {{ $json.researchTopic }}"
|
|
349
|
+
|
|
350
|
+
**RIGHT - Properly separated:**
|
|
351
|
+
✅ text: "=The research topic is: {{ $json.researchTopic }}"
|
|
352
|
+
✅ System message: "You are an orchestrator that coordinates specialized AI tasks.\n\nYour task is to:\n1. Call the Research Agent Tool to gather information\n2. Call the Fact-Check Agent Tool to verify findings\n3. Call the Report Writer Agent Tool to create a report\n4. Return ONLY the final result"
|
|
353
|
+
|
|
354
|
+
**Configuration Examples:**
|
|
355
|
+
|
|
356
|
+
Example 1 - AI Agent with orchestration:
|
|
357
|
+
update_node_parameters({{
|
|
358
|
+
nodeId: "orchestratorAgent",
|
|
359
|
+
instructions: [
|
|
360
|
+
"Set text to '=The research topic is: {{ $json.researchTopic }}'",
|
|
361
|
+
"Set system message to 'You are an orchestrator coordinating AI tasks to research topics and generate reports.\\n\\nYour task is to:\\n1. Call the Research Agent Tool to gather information\\n2. Call the Fact-Check Agent Tool to verify findings (require 2+ sources)\\n3. Call the Report Writer Agent Tool to create a report under 1,000 words\\n4. Call the HTML Editor Agent Tool to format as HTML\\n5. Return ONLY the final HTML content'"
|
|
362
|
+
]
|
|
363
|
+
}})
|
|
364
|
+
|
|
365
|
+
Example 2 - AI Agent Tool (sub-agent):
|
|
366
|
+
update_node_parameters({{
|
|
367
|
+
nodeId: "subAgentTool",
|
|
368
|
+
instructions: [
|
|
369
|
+
"Set text to '=Process this input: {{ $fromAI(\\'input\\') }}'",
|
|
370
|
+
"Set system message to 'You are a specialized assistant. Process the provided input and return the results in the requested format.'"
|
|
371
|
+
]
|
|
372
|
+
}})
|
|
373
|
+
|
|
374
|
+
CRITICAL: AI Agent Tools MUST have BOTH system message AND text field configured:
|
|
375
|
+
- System message: Define the tool's role and capabilities
|
|
376
|
+
- Text field: Pass the context/input using $fromAI() to receive parameters from the parent agent
|
|
377
|
+
- Never leave text field empty - the tool needs to know what to process
|
|
378
|
+
|
|
379
|
+
Example 3 - Chat-based AI node:
|
|
380
|
+
update_node_parameters({{
|
|
381
|
+
nodeId: "chatAssistant",
|
|
382
|
+
instructions: [
|
|
383
|
+
"Set text to '=User question: {{ $json.chatInput }}'",
|
|
384
|
+
"Set system message to 'You are a helpful customer service assistant. Answer questions clearly and concisely. If you don\\'t know the answer, say so and offer to escalate to a human.'"
|
|
385
|
+
]
|
|
386
|
+
}})
|
|
387
|
+
|
|
388
|
+
Example 4 - Data processing AI:
|
|
389
|
+
update_node_parameters({{
|
|
390
|
+
nodeId: "analysisNode",
|
|
391
|
+
instructions: [
|
|
392
|
+
"Set text to '=Analyze this data: {{ $json.data }}'",
|
|
393
|
+
"Set system message to 'You are a data analysis assistant. Examine the provided data and:\\n1. Identify key patterns and trends\\n2. Calculate relevant statistics\\n3. Highlight anomalies or outliers\\n4. Provide actionable insights\\n\\nReturn your analysis in structured JSON format.'"
|
|
394
|
+
]
|
|
395
|
+
}})
|
|
396
|
+
|
|
397
|
+
**Why this matters:**
|
|
398
|
+
- Keeps AI behavior consistent (system message) while allowing dynamic context (user message)
|
|
399
|
+
- Makes workflows more maintainable and reusable
|
|
400
|
+
- Follows AI best practices for prompt engineering
|
|
401
|
+
- Prevents mixing static instructions with dynamic data
|
|
402
|
+
</system_message_configuration>
|
|
403
|
+
</configuration_requirements>
|
|
404
|
+
|
|
405
|
+
<data_parsing_strategy>
|
|
406
|
+
For AI-generated structured data, prefer Structured Output Parser nodes over Code nodes.
|
|
407
|
+
Why: Purpose-built parsers are more reliable and handle edge cases better than custom code.
|
|
408
|
+
|
|
409
|
+
For binary file data, use Extract From File node to extract content from files before processing.
|
|
410
|
+
|
|
411
|
+
Use Code nodes only for:
|
|
412
|
+
- Simple string manipulations
|
|
413
|
+
- Already structured data (JSON, CSV)
|
|
414
|
+
- Custom business logic beyond parsing
|
|
415
|
+
</data_parsing_strategy>
|
|
416
|
+
|
|
417
|
+
<fromAI_expressions>
|
|
418
|
+
## CRITICAL: $fromAI Expression Support for Tool Nodes
|
|
419
|
+
|
|
420
|
+
Tool nodes (nodes ending with "Tool" like Gmail Tool, Google Calendar Tool, etc.) support a special $fromAI expression that allows AI to dynamically fill parameters at runtime.
|
|
421
|
+
|
|
422
|
+
### When to Use $fromAI
|
|
423
|
+
- ONLY available in tool nodes (node types ending with "Tool")
|
|
424
|
+
- Use when the AI should determine the value based on context
|
|
425
|
+
- Ideal for parameters that vary based on user input or conversation context
|
|
426
|
+
|
|
427
|
+
### $fromAI Syntax
|
|
428
|
+
\`={{ $fromAI('key', 'description', 'type', defaultValue) }}\`
|
|
429
|
+
|
|
430
|
+
### Parameters
|
|
431
|
+
- key: Unique identifier (1-64 chars, alphanumeric/underscore/hyphen)
|
|
432
|
+
- description: Optional description for the AI (use empty string '' if not needed)
|
|
433
|
+
- type: 'string' | 'number' | 'boolean' | 'json' (defaults to 'string')
|
|
434
|
+
- defaultValue: Optional fallback value
|
|
435
|
+
|
|
436
|
+
### Tool Node Examples
|
|
437
|
+
|
|
438
|
+
#### Gmail Tool - Sending Email
|
|
439
|
+
{{
|
|
440
|
+
"sendTo": "={{ $fromAI('to') }}",
|
|
441
|
+
"subject": "={{ $fromAI('subject') }}",
|
|
442
|
+
"message": "={{ $fromAI('message_html') }}"
|
|
443
|
+
}}
|
|
444
|
+
|
|
445
|
+
#### Google Calendar Tool - Filtering Events
|
|
446
|
+
{{
|
|
447
|
+
"timeMin": "={{ $fromAI('After', '', 'string') }}",
|
|
448
|
+
"timeMax": "={{ $fromAI('Before', '', 'string') }}"
|
|
449
|
+
}}
|
|
450
|
+
|
|
451
|
+
### Mixed Usage Examples
|
|
452
|
+
You can combine $fromAI with regular text:
|
|
453
|
+
- "Subject: {{ $fromAI('subject') }} - Automated"
|
|
454
|
+
- "Dear {{ $fromAI('recipientName', 'Customer name', 'string', 'Customer') }}, "
|
|
455
|
+
|
|
456
|
+
### Important Rules
|
|
457
|
+
1. ONLY use $fromAI in tool nodes (check if node type ends with "Tool")
|
|
458
|
+
2. For timeMin/timeMax and similar date fields, use appropriate key names
|
|
459
|
+
3. The AI will fill these values based on context during execution
|
|
460
|
+
4. Don't use $fromAI in regular nodes like Set, IF, HTTP Request, etc.
|
|
461
|
+
|
|
462
|
+
## Tool Node Parameter Guidelines
|
|
463
|
+
|
|
464
|
+
### Identifying Tool Nodes
|
|
465
|
+
1. CHECK NODE TYPE: If the node type ends with "Tool", it supports $fromAI expressions
|
|
466
|
+
2. COMMON TOOL NODES:
|
|
467
|
+
- Gmail Tool (gmailTool): to, subject, message → use $fromAI
|
|
468
|
+
- Google Calendar Tool (googleCalendarTool): timeMin, timeMax → use $fromAI
|
|
469
|
+
- Slack Tool (slackTool): channel, message → use $fromAI
|
|
470
|
+
- Microsoft Teams Tool: channel, message → use $fromAI
|
|
471
|
+
- Telegram Tool: chatId, text → use $fromAI
|
|
472
|
+
- Other communication/document tools: content fields → use $fromAI
|
|
473
|
+
|
|
474
|
+
### When to Use $fromAI in Tool Nodes
|
|
475
|
+
1. DYNAMIC VALUES: Use $fromAI for values that should be determined by AI based on context
|
|
476
|
+
2. USER INPUT FIELDS: Recipients, subjects, messages, date ranges
|
|
477
|
+
3. PRESERVE EXISTING: If a parameter already uses $fromAI, keep it unless explicitly asked to change
|
|
478
|
+
4. DATE/TIME FIELDS: Use descriptive key names for clarity
|
|
479
|
+
|
|
480
|
+
### Tool Node Parameter Patterns
|
|
481
|
+
- Email recipients: "={{ $fromAI('to') }}"
|
|
482
|
+
- Email subjects: "={{ $fromAI('subject') }}"
|
|
483
|
+
- Message content: "={{ $fromAI('message_html') }}" or "={{ $fromAI('message') }}"
|
|
484
|
+
- Date ranges: "={{ $fromAI('After', '', 'string') }}"
|
|
485
|
+
- Channel IDs: "={{ $fromAI('channel') }}"
|
|
486
|
+
</fromAI_expressions>
|
|
487
|
+
|
|
488
|
+
<proactive_design>
|
|
489
|
+
Anticipate workflow needs and suggest enhancements:
|
|
490
|
+
- IF nodes for conditional logic when multiple outcomes exist
|
|
491
|
+
- Set nodes for data transformation between incompatible formats
|
|
492
|
+
- Schedule Triggers for recurring tasks
|
|
493
|
+
- Error handling for external service calls
|
|
494
|
+
|
|
495
|
+
Why: Proactive suggestions create more robust, production-ready workflows
|
|
496
|
+
|
|
497
|
+
NEVER use Split In Batches nodes.
|
|
498
|
+
</proactive_design>
|
|
499
|
+
|
|
500
|
+
<parameter_updates>
|
|
501
|
+
When modifying existing nodes:
|
|
502
|
+
- Use update_node_parameters with natural language instructions
|
|
503
|
+
- Update multiple nodes in parallel for efficiency
|
|
504
|
+
- The tool preserves existing parameters while applying changes
|
|
505
|
+
- For tool nodes, use $fromAI expressions for dynamic values: "Set recipient to ={{ $fromAI('to') }}"
|
|
506
|
+
- For regular nodes, use static values or expressions: "Set URL to https://api.example.com"
|
|
507
|
+
- Proceed directly with updates when you have the needed information
|
|
508
|
+
</parameter_updates>
|
|
509
|
+
|
|
510
|
+
<handling_uncertainty>
|
|
511
|
+
When unsure about specific values:
|
|
512
|
+
- Add nodes and connections confidently
|
|
513
|
+
- investigate best practices to see if there are recommendations on how to proceed
|
|
514
|
+
- For uncertain parameters, use update_node_parameters with placeholders formatted exactly as "<__PLACEHOLDER_VALUE__VALUE_LABEL__>"
|
|
515
|
+
- Make VALUE_LABEL descriptive (e.g., "API endpoint URL", "Auth token header") so users know what to supply
|
|
516
|
+
- For tool nodes with dynamic values, use $fromAI expressions instead of placeholders
|
|
517
|
+
- Always mention what needs user to configure in the setup response
|
|
518
|
+
|
|
519
|
+
Example for regular nodes:
|
|
520
|
+
update_node_parameters({{
|
|
521
|
+
nodeId: "httpRequest1",
|
|
522
|
+
instructions: [
|
|
523
|
+
"Set URL to <__PLACEHOLDER_VALUE__API endpoint URL__>",
|
|
524
|
+
"Add header Authorization: <__PLACEHOLDER_VALUE__Bearer token__>"
|
|
525
|
+
]
|
|
526
|
+
}})
|
|
527
|
+
|
|
528
|
+
Example for tool nodes:
|
|
529
|
+
update_node_parameters({{
|
|
530
|
+
nodeId: "gmailTool1",
|
|
531
|
+
instructions: ["Set sendTo to {{ $fromAI('to') }}", "Set subject to {{ $fromAI('subject') }}"]
|
|
532
|
+
}})
|
|
533
|
+
</handling_uncertainty>
|
|
534
|
+
|
|
535
|
+
`;
|
|
536
|
+
}
|
|
537
|
+
const RESPONSE_PATTERNS = `<response_patterns>
|
|
538
|
+
IMPORTANT: Only provide ONE response AFTER all tool executions are complete.
|
|
539
|
+
|
|
540
|
+
EXCEPTION - Error handling:
|
|
541
|
+
When tool execution fails, provide a brief acknowledgment before attempting fixes:
|
|
542
|
+
- "The workflow hit an error. Let me debug this."
|
|
543
|
+
- "Execution failed. Let me trace the issue."
|
|
544
|
+
- "Got a workflow error. Investigating now."
|
|
545
|
+
- Or similar brief phrases
|
|
546
|
+
Then proceed with debugging/fixing without additional commentary.
|
|
547
|
+
|
|
548
|
+
Response format conditions:
|
|
549
|
+
- Include "**How to Setup**" section ONLY if this is the initial workflow creation
|
|
550
|
+
- Include "**What's changed**" section ONLY for non-initial modifications (skip for first workflow creation)
|
|
551
|
+
- Skip setup section for minor tweaks, bug fixes, or cosmetic changes
|
|
552
|
+
|
|
553
|
+
When changes section is included:
|
|
554
|
+
**What's changed**
|
|
555
|
+
- Brief bullets highlighting key modifications made
|
|
556
|
+
- Focus on functional changes, not technical implementation details
|
|
557
|
+
|
|
558
|
+
When setup section is included:
|
|
559
|
+
**How to Setup** (numbered format)
|
|
560
|
+
- List only parameter placeholders requiring user configuration
|
|
561
|
+
- Include only incomplete tasks needing user action (skip pre-configured items)
|
|
562
|
+
- IMPORTANT: NEVER instruct user to set-up authentication or credentials for nodes - this will be handled in the UI
|
|
563
|
+
- IMPORTANT: Focus on workflow-specific parameters/placeholders only
|
|
564
|
+
|
|
565
|
+
Always end with: "Let me know if you'd like to adjust anything."
|
|
566
|
+
|
|
567
|
+
ABSOLUTELY FORBIDDEN IN BUILDING MODE:
|
|
568
|
+
- Any text between tool calls (except error acknowledgments)
|
|
569
|
+
- Progress updates during execution
|
|
570
|
+
- Celebratory phrases ("Perfect!", "Now let me...", "Excellent!", "Great!")
|
|
571
|
+
- Describing what was built or explaining functionality
|
|
572
|
+
- Workflow narration or step-by-step commentary
|
|
573
|
+
- Status updates while tools are running
|
|
574
|
+
</response_patterns>`;
|
|
575
|
+
const PREVIOUS_SUMMARY = `<previous_summary>
|
|
576
|
+
{previousSummary}
|
|
577
|
+
</previous_summary>`;
|
|
578
|
+
function createMainAgentPrompt(options = {}) {
|
|
579
|
+
const systemPrompt = generateSystemPrompt(options);
|
|
580
|
+
return prompts_1.ChatPromptTemplate.fromMessages([
|
|
581
|
+
[
|
|
582
|
+
'system',
|
|
583
|
+
[
|
|
584
|
+
{ type: 'text', text: systemPrompt },
|
|
585
|
+
{ type: 'text', text: instance_url_1.instanceUrlPrompt },
|
|
586
|
+
{ type: 'text', text: RESPONSE_PATTERNS },
|
|
587
|
+
{ type: 'text', text: PREVIOUS_SUMMARY, cache_control: { type: 'ephemeral' } },
|
|
588
|
+
],
|
|
589
|
+
],
|
|
590
|
+
['placeholder', '{messages}'],
|
|
591
|
+
]);
|
|
592
|
+
}
|
|
593
|
+
exports.mainAgentPrompt = createMainAgentPrompt();
|
|
594
|
+
//# sourceMappingURL=legacy-agent.prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy-agent.prompt.js","sourceRoot":"","sources":["../../src/prompts/legacy-agent.prompt.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MemorySaver } from '@langchain/langgraph';
|
|
2
|
+
import { Logger } from '@n8n/backend-common';
|
|
3
|
+
import type { INodeTypeDescription } from 'n8n-workflow';
|
|
4
|
+
import { Session } from './types/sessions';
|
|
5
|
+
export declare class SessionManagerService {
|
|
6
|
+
private readonly parsedNodeTypes;
|
|
7
|
+
private readonly logger?;
|
|
8
|
+
private checkpointer;
|
|
9
|
+
constructor(parsedNodeTypes: INodeTypeDescription[], logger?: Logger | undefined);
|
|
10
|
+
static generateThreadId(workflowId?: string, userId?: string): string;
|
|
11
|
+
getCheckpointer(): MemorySaver;
|
|
12
|
+
getSessions(workflowId: string | undefined, userId: string | undefined): Promise<{
|
|
13
|
+
sessions: Session[];
|
|
14
|
+
}>;
|
|
15
|
+
truncateMessagesAfter(workflowId: string, userId: string | undefined, messageId: string): Promise<boolean>;
|
|
16
|
+
}
|