n8n 2.11.2 → 2.12.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/build.tsbuildinfo +1 -1
- package/dist/chat/chat-service.js +1 -1
- package/dist/chat/chat-service.js.map +1 -1
- package/dist/chat/utils.d.ts +1 -0
- package/dist/chat/utils.js +7 -0
- package/dist/chat/utils.js.map +1 -1
- package/dist/commands/base-command.js +1 -1
- package/dist/commands/base-command.js.map +1 -1
- package/dist/controllers/project.controller.js +0 -2
- package/dist/controllers/project.controller.js.map +1 -1
- package/dist/controllers/users.controller.d.ts +1 -3
- package/dist/controllers/users.controller.js +1 -7
- package/dist/controllers/users.controller.js.map +1 -1
- package/dist/credentials/credential-resolution-provider.interface.d.ts +1 -2
- package/dist/credentials/credentials.service.d.ts +1 -1
- package/dist/credentials/credentials.service.js +9 -4
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/dynamic-credentials-proxy.d.ts +1 -1
- package/dist/credentials/dynamic-credentials-proxy.js +2 -2
- package/dist/credentials/dynamic-credentials-proxy.js.map +1 -1
- package/dist/credentials/validation.d.ts +6 -1
- package/dist/credentials/validation.js +4 -3
- package/dist/credentials/validation.js.map +1 -1
- package/dist/credentials-helper.d.ts +8 -7
- package/dist/credentials-helper.js +22 -46
- package/dist/credentials-helper.js.map +1 -1
- package/dist/eventbus/event-message-classes/event-message-audit.d.ts +5 -1
- package/dist/eventbus/event-message-classes/event-message-audit.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +1 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +9 -1
- package/dist/events/relays/log-streaming.event-relay.d.ts +1 -0
- package/dist/events/relays/log-streaming.event-relay.js +13 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/events/relays/telemetry.event-relay.d.ts +11 -3
- package/dist/events/relays/telemetry.event-relay.js +125 -4
- package/dist/events/relays/telemetry.event-relay.js.map +1 -1
- package/dist/executions/execution-redaction-proxy.service.d.ts +3 -3
- package/dist/executions/execution-redaction-proxy.service.js +5 -0
- package/dist/executions/execution-redaction-proxy.service.js.map +1 -1
- package/dist/executions/execution-redaction.d.ts +13 -2
- package/dist/executions/execution.service.d.ts +1 -1
- package/dist/executions/execution.service.js +21 -3
- package/dist/executions/execution.service.js.map +1 -1
- package/dist/license.d.ts +4 -0
- package/dist/license.js +40 -0
- package/dist/license.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.controller.js +1 -1
- package/dist/modules/breaking-changes/breaking-changes.controller.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.module.js +5 -1
- package/dist/modules/breaking-changes/breaking-changes.module.js.map +1 -1
- package/dist/modules/breaking-changes/breaking-changes.service.js +6 -4
- package/dist/modules/breaking-changes/breaking-changes.service.js.map +1 -1
- package/dist/modules/breaking-changes/rules/index.d.ts +16 -4
- package/dist/modules/breaking-changes/rules/index.js +16 -4
- package/dist/modules/breaking-changes/rules/index.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/binary-data-storage.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/binary-data-storage.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/cli-replace-update-workflow-command.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/cli-replace-update-workflow-command.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/disabled-nodes.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/disabled-nodes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/dotenv-upgrade.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/dotenv-upgrade.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/file-access.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/file-access.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/oauth-callback-auth.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/process-env-access.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/process-env-access.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/pyodide-removed.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/queue-worker-max-stalled-count.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/queue-worker-max-stalled-count.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/removed-nodes.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/removed-nodes.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/settings-file-permissions.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/settings-file-permissions.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/start-node-removed.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/start-node-removed.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/task-runner-docker-image.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/task-runner-docker-image.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/tunnel-option.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/tunnel-option.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/wait-node-subworkflow.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/wait-node-subworkflow.rule.js.map +1 -1
- package/dist/modules/breaking-changes/rules/v2/workflow-hooks-deprecated.rule.js +2 -2
- package/dist/modules/breaking-changes/rules/v2/workflow-hooks-deprecated.rule.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.entity.d.ts +11 -1
- package/dist/modules/chat-hub/chat-hub-agent.entity.js +8 -0
- package/dist/modules/chat-hub/chat-hub-agent.entity.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.service.d.ts +22 -3
- package/dist/modules/chat-hub/chat-hub-agent.service.js +156 -6
- package/dist/modules/chat-hub/chat-hub-agent.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-event-relay.service.d.ts +10 -0
- package/dist/modules/chat-hub/chat-hub-event-relay.service.js +47 -0
- package/dist/modules/chat-hub/chat-hub-event-relay.service.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-execution-watcher.service.js +1 -1
- package/dist/modules/chat-hub/chat-hub-execution-watcher.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-execution.service.d.ts +2 -1
- package/dist/modules/chat-hub/chat-hub-execution.service.js +25 -3
- package/dist/modules/chat-hub/chat-hub-execution.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-title.service.js +2 -1
- package/dist/modules/chat-hub/chat-hub-title.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-upload.middleware.d.ts +7 -0
- package/dist/modules/chat-hub/chat-hub-upload.middleware.js +43 -0
- package/dist/modules/chat-hub/chat-hub-upload.middleware.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +20 -5
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +292 -14
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.attachment.service.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub.attachment.service.js +11 -0
- package/dist/modules/chat-hub/chat-hub.attachment.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.constants.d.ts +5 -1
- package/dist/modules/chat-hub/chat-hub.constants.js +10 -1
- package/dist/modules/chat-hub/chat-hub.constants.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.controller.d.ts +5 -1
- package/dist/modules/chat-hub/chat-hub.controller.js +44 -10
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +2 -1
- package/dist/modules/chat-hub/chat-hub.module.js +13 -3
- package/dist/modules/chat-hub/chat-hub.module.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.service.js +1 -1
- package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.settings.controller.d.ts +2 -1
- package/dist/modules/chat-hub/chat-hub.settings.controller.js +20 -0
- package/dist/modules/chat-hub/chat-hub.settings.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.settings.service.d.ts +5 -1
- package/dist/modules/chat-hub/chat-hub.settings.service.js +34 -0
- package/dist/modules/chat-hub/chat-hub.settings.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +19 -8
- package/dist/modules/chat-hub/chat-hub.types.js.map +1 -1
- package/dist/modules/community-packages/npm-utils.js +3 -3
- package/dist/modules/community-packages/npm-utils.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.d.ts +3 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.js +6 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers/identifiers/identifier-interface.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js +2 -1
- package/dist/modules/dynamic-credentials.ee/credential-resolvers.controller.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.js +12 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-configured.error.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.js +9 -1
- package/dist/modules/dynamic-credentials.ee/errors/credential-resolver-not-found.error.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/errors/missing-execution-context.error.d.ts +4 -0
- package/dist/modules/dynamic-credentials.ee/errors/missing-execution-context.error.js +12 -0
- package/dist/modules/dynamic-credentials.ee/errors/missing-execution-context.error.js.map +1 -0
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.d.ts +4 -4
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js +10 -7
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver-workflow.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js +5 -8
- package/dist/modules/dynamic-credentials.ee/services/credential-resolver.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.d.ts +4 -3
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js +37 -42
- package/dist/modules/dynamic-credentials.ee/services/dynamic-credential.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.d.ts +1 -1
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js +2 -4
- package/dist/modules/dynamic-credentials.ee/services/resolver-config-expression.service.js.map +1 -1
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js +6 -2
- package/dist/modules/dynamic-credentials.ee/workflow-status.controller.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-providers.ee.js +2 -0
- package/dist/modules/external-secrets.ee/external-secrets-providers.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.controller.ee.js +1 -1
- package/dist/modules/external-secrets.ee/external-secrets.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/one-password.d.ts +25 -0
- package/dist/modules/external-secrets.ee/providers/one-password.js +153 -0
- package/dist/modules/external-secrets.ee/providers/one-password.js.map +1 -0
- package/dist/modules/external-secrets.ee/providers/vault.js +6 -1
- package/dist/modules/external-secrets.ee/providers/vault.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-completions.controller.ee.d.ts +1 -0
- package/dist/modules/external-secrets.ee/secrets-providers-completions.controller.ee.js +15 -4
- package/dist/modules/external-secrets.ee/secrets-providers-completions.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.d.ts +1 -0
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js +5 -0
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +14 -4
- package/dist/modules/mcp/mcp.service.js +81 -6
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/mcp.types.d.ts +1 -1
- package/dist/modules/mcp/tools/execute-workflow.tool.d.ts +7 -8
- package/dist/modules/mcp/tools/execute-workflow.tool.js +26 -37
- package/dist/modules/mcp/tools/execute-workflow.tool.js.map +1 -1
- package/dist/modules/mcp/tools/get-execution.tool.d.ts +17 -0
- package/dist/modules/mcp/tools/get-execution.tool.js +126 -0
- package/dist/modules/mcp/tools/get-execution.tool.js.map +1 -0
- package/dist/modules/mcp/tools/get-workflow-details.tool.js +2 -5
- package/dist/modules/mcp/tools/get-workflow-details.tool.js.map +1 -1
- package/dist/modules/mcp/tools/publish-workflow.tool.d.ts +18 -0
- package/dist/modules/mcp/tools/publish-workflow.tool.js +91 -0
- package/dist/modules/mcp/tools/publish-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/unpublish-workflow.tool.d.ts +15 -0
- package/dist/modules/mcp/tools/unpublish-workflow.tool.js +81 -0
- package/dist/modules/mcp/tools/unpublish-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/constants.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/constants.js +13 -0
- package/dist/modules/mcp/tools/workflow-builder/constants.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.d.ts +16 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js +167 -0
- package/dist/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.d.ts +14 -0
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js +65 -0
- package/dist/modules/mcp/tools/workflow-builder/credentials-auto-assign.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/delete-workflow.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/workflow-builder/delete-workflow.tool.js +75 -0
- package/dist/modules/mcp/tools/workflow-builder/delete-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js +100 -0
- package/dist/modules/mcp/tools/workflow-builder/get-suggested-workflow-nodes.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.d.ts +28 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js +102 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-node-types.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.d.ts +9 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js +60 -0
- package/dist/modules/mcp/tools/workflow-builder/get-workflow-sdk-reference.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.d.ts +1 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js +30 -0
- package/dist/modules/mcp/tools/workflow-builder/mcp-instructions.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.d.ts +2 -0
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js +61 -0
- package/dist/modules/mcp/tools/workflow-builder/sdk-reference-content.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.d.ts +10 -0
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js +97 -0
- package/dist/modules/mcp/tools/workflow-builder/search-workflow-nodes.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.d.ts +17 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js +164 -0
- package/dist/modules/mcp/tools/workflow-builder/update-workflow.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.d.ts +9 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js +119 -0
- package/dist/modules/mcp/tools/workflow-builder/validate-workflow-code.tool.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.d.ts +17 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js +117 -0
- package/dist/modules/mcp/tools/workflow-builder/workflow-builder-tools.service.js.map +1 -0
- package/dist/modules/mcp/tools/workflow-validation.utils.d.ts +8 -0
- package/dist/modules/mcp/tools/workflow-validation.utils.js +20 -0
- package/dist/modules/mcp/tools/workflow-validation.utils.js.map +1 -0
- package/dist/modules/redaction/executions/execution-redaction.interfaces.d.ts +11 -0
- package/dist/modules/redaction/executions/execution-redaction.interfaces.js +3 -0
- package/dist/modules/redaction/executions/execution-redaction.interfaces.js.map +1 -0
- package/dist/modules/redaction/executions/execution-redaction.service.d.ts +11 -8
- package/dist/modules/redaction/executions/execution-redaction.service.js +61 -60
- package/dist/modules/redaction/executions/execution-redaction.service.js.map +1 -1
- package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.d.ts +9 -0
- package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.js +82 -0
- package/dist/modules/redaction/executions/strategies/full-item-redaction.strategy.js.map +1 -0
- package/dist/modules/redaction/executions/strategies/node-defined-field-redaction.strategy.d.ts +17 -0
- package/dist/modules/redaction/executions/strategies/node-defined-field-redaction.strategy.js +127 -0
- package/dist/modules/redaction/executions/strategies/node-defined-field-redaction.strategy.js.map +1 -0
- package/dist/oauth/oauth.service.d.ts +1 -0
- package/dist/oauth/oauth.service.js +81 -4
- package/dist/oauth/oauth.service.js.map +1 -1
- package/dist/posthog/index.d.ts +9 -0
- package/dist/posthog/index.js +19 -0
- package/dist/posthog/index.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +14 -5
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.js +13 -0
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/response-helper.d.ts +3 -2
- package/dist/response-helper.js +14 -8
- package/dist/response-helper.js.map +1 -1
- package/dist/services/cache/cache.constants.d.ts +1 -0
- package/dist/services/cache/cache.constants.js +5 -0
- package/dist/services/cache/cache.constants.js.map +1 -0
- package/dist/services/cache/cache.service.d.ts +2 -4
- package/dist/services/cache/cache.service.js +26 -30
- package/dist/services/cache/cache.service.js.map +1 -1
- package/dist/services/credentials-tester.service.js +1 -2
- package/dist/services/credentials-tester.service.js.map +1 -1
- package/dist/services/project.service.ee.d.ts +1 -4
- package/dist/services/project.service.ee.js +1 -18
- package/dist/services/project.service.ee.js.map +1 -1
- package/dist/services/ssrf/dns-resolver.d.ts +13 -0
- package/dist/services/ssrf/dns-resolver.js +93 -0
- package/dist/services/ssrf/dns-resolver.js.map +1 -0
- package/dist/services/ssrf/hostname-matcher.d.ts +6 -0
- package/dist/services/ssrf/hostname-matcher.js +38 -0
- package/dist/services/ssrf/hostname-matcher.js.map +1 -0
- package/dist/services/ssrf/in-memory-dns-cache.service.d.ts +11 -0
- package/dist/services/ssrf/in-memory-dns-cache.service.js +61 -0
- package/dist/services/ssrf/in-memory-dns-cache.service.js.map +1 -0
- package/dist/services/ssrf/ip-range-builder.d.ts +10 -0
- package/dist/services/ssrf/ip-range-builder.js +52 -0
- package/dist/services/ssrf/ip-range-builder.js.map +1 -0
- package/dist/services/ssrf/ssrf-blocked-ip.error.d.ts +6 -0
- package/dist/services/ssrf/ssrf-blocked-ip.error.js +16 -0
- package/dist/services/ssrf/ssrf-blocked-ip.error.js.map +1 -0
- package/dist/services/ssrf/ssrf-protection.service.d.ts +26 -0
- package/dist/services/ssrf/ssrf-protection.service.js +159 -0
- package/dist/services/ssrf/ssrf-protection.service.js.map +1 -0
- package/dist/services/workflow-statistics.service.js +6 -8
- package/dist/services/workflow-statistics.service.js.map +1 -1
- package/dist/task-runners/task-runner-module.js +0 -1
- package/dist/task-runners/task-runner-module.js.map +1 -1
- package/dist/task-runners/task-runner-process-js.js +1 -1
- package/dist/task-runners/task-runner-process-js.js.map +1 -1
- package/dist/task-runners/task-runner-process-py.js +15 -3
- package/dist/task-runners/task-runner-process-py.js.map +1 -1
- package/dist/telemetry/index.d.ts +6 -1
- package/dist/telemetry/index.js +76 -9
- package/dist/telemetry/index.js.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +4 -0
- package/dist/utils.js.map +1 -1
- package/dist/workflow-execute-additional-data.js +7 -0
- package/dist/workflow-execute-additional-data.js.map +1 -1
- package/dist/workflow-helpers.js +3 -0
- package/dist/workflow-helpers.js.map +1 -1
- package/dist/workflows/workflow-creation.service.d.ts +38 -0
- package/dist/workflows/workflow-creation.service.js +185 -0
- package/dist/workflows/workflow-creation.service.js.map +1 -0
- package/dist/workflows/workflow-finder.service.d.ts +1 -0
- package/dist/workflows/workflow-finder.service.js +10 -0
- package/dist/workflows/workflow-finder.service.js.map +1 -1
- package/dist/workflows/workflow-validation.service.d.ts +5 -3
- package/dist/workflows/workflow-validation.service.js +59 -2
- package/dist/workflows/workflow-validation.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +1 -0
- package/dist/workflows/workflow.service.js +11 -0
- package/dist/workflows/workflow.service.js.map +1 -1
- package/dist/workflows/workflows.controller.d.ts +5 -15
- package/dist/workflows/workflows.controller.js +16 -106
- package/dist/workflows/workflows.controller.js.map +1 -1
- package/package.json +21 -20
- package/dist/errors/cache-errors/malformed-refresh-value.error.d.ts +0 -4
- package/dist/errors/cache-errors/malformed-refresh-value.error.js +0 -11
- package/dist/errors/cache-errors/malformed-refresh-value.error.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v2/index.d.ts +0 -9
- package/dist/modules/breaking-changes/rules/v2/index.js +0 -41
- package/dist/modules/breaking-changes/rules/v2/index.js.map +0 -1
- package/dist/modules/breaking-changes/rules/v2/task-runners.rule.d.ts +0 -10
- package/dist/modules/breaking-changes/rules/v2/task-runners.rule.js +0 -73
- package/dist/modules/breaking-changes/rules/v2/task-runners.rule.js.map +0 -1
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createWorkflowDetailsTool = void 0;
|
|
7
7
|
exports.getWorkflowDetails = getWorkflowDetails;
|
|
8
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
9
8
|
const zod_1 = __importDefault(require("zod"));
|
|
10
9
|
const mcp_constants_1 = require("../mcp.constants");
|
|
11
10
|
const schemas_1 = require("./schemas");
|
|
12
11
|
const webhook_utils_1 = require("./webhook-utils");
|
|
12
|
+
const workflow_validation_utils_1 = require("./workflow-validation.utils");
|
|
13
13
|
const inputSchema = {
|
|
14
14
|
workflowId: zod_1.default.string().describe('The ID of the workflow to retrieve'),
|
|
15
15
|
};
|
|
@@ -66,10 +66,7 @@ const createWorkflowDetailsTool = (user, baseWebhookUrl, workflowFinderService,
|
|
|
66
66
|
};
|
|
67
67
|
exports.createWorkflowDetailsTool = createWorkflowDetailsTool;
|
|
68
68
|
async function getWorkflowDetails(user, baseWebhookUrl, workflowFinderService, credentialsService, endpoints, roleService, projectService, { workflowId }) {
|
|
69
|
-
const workflow = await
|
|
70
|
-
if (!workflow || workflow.isArchived || !workflow.settings?.availableInMCP) {
|
|
71
|
-
throw new n8n_workflow_1.UserError('Workflow not found');
|
|
72
|
-
}
|
|
69
|
+
const workflow = await (0, workflow_validation_utils_1.getMcpWorkflow)(workflowId, user, ['workflow:read'], workflowFinderService, { includeActiveVersion: true });
|
|
73
70
|
const projectRelations = await projectService.getProjectRelationsForUser(user);
|
|
74
71
|
const workflowWithScopes = roleService.addScopes(workflow, user, projectRelations);
|
|
75
72
|
const scopes = workflowWithScopes.scopes ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-workflow-details.tool.js","sourceRoot":"","sources":["../../../../src/modules/mcp/tools/get-workflow-details.tool.ts"],"names":[],"mappings":";;;;;;AAuGA,
|
|
1
|
+
{"version":3,"file":"get-workflow-details.tool.js","sourceRoot":"","sources":["../../../../src/modules/mcp/tools/get-workflow-details.tool.ts"],"names":[],"mappings":";;;;;;AAuGA,gDAwEC;AA9KD,8CAAoB;AAEpB,oDAAsF;AAMtF,uCAAwD;AACxD,mDAA2E;AAC3E,2EAA6D;AAQ7D,MAAM,WAAW,GAAG;IACnB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;CAC7C,CAAC;AAI1B,MAAM,YAAY,GAAG,qCAA2B,CAAC,KAA6B,CAAC;AAKxE,MAAM,yBAAyB,GAAG,CACxC,IAAU,EACV,cAAsB,EACtB,qBAA4C,EAC5C,kBAAsC,EACtC,SAA2B,EAC3B,SAAoB,EACpB,WAAwB,EACxB,cAA8B,EACO,EAAE;IACvC,OAAO;QACN,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE;YACP,WAAW,EAAE,8EAA8E;YAC3F,WAAW;YACX,YAAY;YACZ,WAAW,EAAE;gBACZ,KAAK,EAAE,sBAAsB;gBAC7B,YAAY,EAAE,IAAI;gBAClB,eAAe,EAAE,KAAK;gBACtB,cAAc,EAAE,IAAI;gBACpB,aAAa,EAAE,KAAK;aACpB;SACD;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAA0B,EAAE,EAAE;YACzD,MAAM,UAAU,GAAG,EAAE,UAAU,EAAE,CAAC;YAClC,MAAM,gBAAgB,GAAkC;gBACvD,OAAO,EAAE,IAAI,CAAC,EAAE;gBAChB,SAAS,EAAE,sBAAsB;gBACjC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}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { User } from '@n8n/db';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
import type { ToolDefinition } from '../mcp.types';
|
|
4
|
+
import type { Telemetry } from '../../../telemetry';
|
|
5
|
+
import type { WorkflowFinderService } from '../../../workflows/workflow-finder.service';
|
|
6
|
+
import type { WorkflowService } from '../../../workflows/workflow.service';
|
|
7
|
+
declare const inputSchema: z.ZodObject<{
|
|
8
|
+
workflowId: z.ZodString;
|
|
9
|
+
versionId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
workflowId: string;
|
|
12
|
+
versionId?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
workflowId: string;
|
|
15
|
+
versionId?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
export declare const createPublishWorkflowTool: (user: User, workflowFinderService: WorkflowFinderService, workflowService: WorkflowService, telemetry: Telemetry) => ToolDefinition<typeof inputSchema.shape>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createPublishWorkflowTool = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const mcp_constants_1 = require("../mcp.constants");
|
|
10
|
+
const mcp_errors_1 = require("../mcp.errors");
|
|
11
|
+
const workflow_validation_utils_1 = require("./workflow-validation.utils");
|
|
12
|
+
const inputSchema = zod_1.default.object({
|
|
13
|
+
workflowId: zod_1.default.string().describe('The ID of the workflow to publish'),
|
|
14
|
+
versionId: zod_1.default
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Optional version ID to publish. If not provided, publishes the current draft version.'),
|
|
18
|
+
});
|
|
19
|
+
const outputSchema = {
|
|
20
|
+
success: zod_1.default.boolean(),
|
|
21
|
+
workflowId: zod_1.default.string(),
|
|
22
|
+
activeVersionId: zod_1.default.string().nullable(),
|
|
23
|
+
error: zod_1.default.string().optional(),
|
|
24
|
+
};
|
|
25
|
+
const createPublishWorkflowTool = (user, workflowFinderService, workflowService, telemetry) => ({
|
|
26
|
+
name: 'publish_workflow',
|
|
27
|
+
config: {
|
|
28
|
+
description: 'Publish (activate) a workflow to make it available for production execution. This creates an active version from the current draft.',
|
|
29
|
+
inputSchema: inputSchema.shape,
|
|
30
|
+
outputSchema,
|
|
31
|
+
annotations: {
|
|
32
|
+
title: 'Publish Workflow',
|
|
33
|
+
readOnlyHint: false,
|
|
34
|
+
destructiveHint: false,
|
|
35
|
+
idempotentHint: true,
|
|
36
|
+
openWorldHint: false,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
handler: async ({ workflowId, versionId }) => {
|
|
40
|
+
const telemetryPayload = {
|
|
41
|
+
user_id: user.id,
|
|
42
|
+
tool_name: 'publish_workflow',
|
|
43
|
+
parameters: { workflowId, versionId },
|
|
44
|
+
};
|
|
45
|
+
try {
|
|
46
|
+
await (0, workflow_validation_utils_1.getMcpWorkflow)(workflowId, user, ['workflow:publish'], workflowFinderService);
|
|
47
|
+
const activatedWorkflow = await workflowService.activateWorkflow(user, workflowId, {
|
|
48
|
+
versionId,
|
|
49
|
+
});
|
|
50
|
+
const output = {
|
|
51
|
+
success: true,
|
|
52
|
+
workflowId: activatedWorkflow.id,
|
|
53
|
+
activeVersionId: activatedWorkflow.activeVersionId,
|
|
54
|
+
};
|
|
55
|
+
telemetryPayload.results = {
|
|
56
|
+
success: true,
|
|
57
|
+
data: {
|
|
58
|
+
workflow_id: workflowId,
|
|
59
|
+
active_version_id: activatedWorkflow.activeVersionId,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
63
|
+
return {
|
|
64
|
+
content: [{ type: 'text', text: (0, n8n_workflow_1.jsonStringify)(output) }],
|
|
65
|
+
structuredContent: output,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
catch (er) {
|
|
69
|
+
const error = (0, n8n_workflow_1.ensureError)(er);
|
|
70
|
+
const isAccessError = error instanceof mcp_errors_1.WorkflowAccessError;
|
|
71
|
+
const output = {
|
|
72
|
+
success: false,
|
|
73
|
+
workflowId,
|
|
74
|
+
activeVersionId: null,
|
|
75
|
+
error: error.message,
|
|
76
|
+
};
|
|
77
|
+
telemetryPayload.results = {
|
|
78
|
+
success: false,
|
|
79
|
+
error: error.message,
|
|
80
|
+
error_reason: isAccessError ? error.reason : undefined,
|
|
81
|
+
};
|
|
82
|
+
telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
83
|
+
return {
|
|
84
|
+
content: [{ type: 'text', text: (0, n8n_workflow_1.jsonStringify)(output) }],
|
|
85
|
+
structuredContent: output,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
exports.createPublishWorkflowTool = createPublishWorkflowTool;
|
|
91
|
+
//# sourceMappingURL=publish-workflow.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-workflow.tool.js","sourceRoot":"","sources":["../../../../src/modules/mcp/tools/publish-workflow.tool.ts"],"names":[],"mappings":";;;;;;AACA,+CAA0D;AAC1D,8CAAoB;AAEpB,oDAA8D;AAC9D,8CAAoD;AAEpD,2EAA6D;AAM7D,MAAM,WAAW,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5B,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IACpE,SAAS,EAAE,aAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAA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type { User } from '@n8n/db';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
import type { ToolDefinition } from '../mcp.types';
|
|
4
|
+
import type { Telemetry } from '../../../telemetry';
|
|
5
|
+
import type { WorkflowFinderService } from '../../../workflows/workflow-finder.service';
|
|
6
|
+
import type { WorkflowService } from '../../../workflows/workflow.service';
|
|
7
|
+
declare const inputSchema: z.ZodObject<{
|
|
8
|
+
workflowId: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
workflowId: string;
|
|
11
|
+
}, {
|
|
12
|
+
workflowId: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const createUnpublishWorkflowTool: (user: User, workflowFinderService: WorkflowFinderService, workflowService: WorkflowService, telemetry: Telemetry) => ToolDefinition<typeof inputSchema.shape>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createUnpublishWorkflowTool = void 0;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const mcp_constants_1 = require("../mcp.constants");
|
|
10
|
+
const mcp_errors_1 = require("../mcp.errors");
|
|
11
|
+
const workflow_validation_utils_1 = require("./workflow-validation.utils");
|
|
12
|
+
const inputSchema = zod_1.default.object({
|
|
13
|
+
workflowId: zod_1.default.string().describe('The ID of the workflow to unpublish'),
|
|
14
|
+
});
|
|
15
|
+
const outputSchema = {
|
|
16
|
+
success: zod_1.default.boolean(),
|
|
17
|
+
workflowId: zod_1.default.string(),
|
|
18
|
+
error: zod_1.default.string().optional(),
|
|
19
|
+
};
|
|
20
|
+
const createUnpublishWorkflowTool = (user, workflowFinderService, workflowService, telemetry) => ({
|
|
21
|
+
name: 'unpublish_workflow',
|
|
22
|
+
config: {
|
|
23
|
+
description: 'Unpublish (deactivate) a workflow to stop it from being available for production execution.',
|
|
24
|
+
inputSchema: inputSchema.shape,
|
|
25
|
+
outputSchema,
|
|
26
|
+
annotations: {
|
|
27
|
+
title: 'Unpublish Workflow',
|
|
28
|
+
readOnlyHint: false,
|
|
29
|
+
destructiveHint: false,
|
|
30
|
+
idempotentHint: true,
|
|
31
|
+
openWorldHint: false,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
handler: async ({ workflowId }) => {
|
|
35
|
+
const telemetryPayload = {
|
|
36
|
+
user_id: user.id,
|
|
37
|
+
tool_name: 'unpublish_workflow',
|
|
38
|
+
parameters: { workflowId },
|
|
39
|
+
};
|
|
40
|
+
try {
|
|
41
|
+
await (0, workflow_validation_utils_1.getMcpWorkflow)(workflowId, user, ['workflow:unpublish'], workflowFinderService);
|
|
42
|
+
await workflowService.deactivateWorkflow(user, workflowId);
|
|
43
|
+
const output = {
|
|
44
|
+
success: true,
|
|
45
|
+
workflowId,
|
|
46
|
+
};
|
|
47
|
+
telemetryPayload.results = {
|
|
48
|
+
success: true,
|
|
49
|
+
data: {
|
|
50
|
+
workflow_id: workflowId,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
54
|
+
return {
|
|
55
|
+
content: [{ type: 'text', text: (0, n8n_workflow_1.jsonStringify)(output) }],
|
|
56
|
+
structuredContent: output,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
catch (er) {
|
|
60
|
+
const error = (0, n8n_workflow_1.ensureError)(er);
|
|
61
|
+
const isAccessError = error instanceof mcp_errors_1.WorkflowAccessError;
|
|
62
|
+
const output = {
|
|
63
|
+
success: false,
|
|
64
|
+
workflowId,
|
|
65
|
+
error: error.message,
|
|
66
|
+
};
|
|
67
|
+
telemetryPayload.results = {
|
|
68
|
+
success: false,
|
|
69
|
+
error: error.message,
|
|
70
|
+
error_reason: isAccessError ? error.reason : undefined,
|
|
71
|
+
};
|
|
72
|
+
telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
73
|
+
return {
|
|
74
|
+
content: [{ type: 'text', text: (0, n8n_workflow_1.jsonStringify)(output) }],
|
|
75
|
+
structuredContent: output,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
exports.createUnpublishWorkflowTool = createUnpublishWorkflowTool;
|
|
81
|
+
//# sourceMappingURL=unpublish-workflow.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpublish-workflow.tool.js","sourceRoot":"","sources":["../../../../src/modules/mcp/tools/unpublish-workflow.tool.ts"],"names":[],"mappings":";;;;;;AACA,+CAA0D;AAC1D,8CAAoB;AAEpB,oDAA8D;AAC9D,8CAAoD;AAEpD,2EAA6D;AAM7D,MAAM,WAAW,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5B,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;CACtE,CAAC,CAAC;AAQH,MAAM,YAAY,GAAG;IACpB,OAAO,EAAE,aAAC,CAAC,OAAO,EAAE;IACpB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE;IACtB,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACJ,CAAC;AAEnB,MAAM,2BAA2B,GAAG,CAC1C,IAAU,EACV,qBAA4C,EAC5C,eAAgC,EAChC,SAAoB,EACuB,EAAE,CAAC,CAAC;IAC/C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,EAAE;QACP,WAAW,EACV,6FAA6F;QAC9F,WAAW,EAAE,WAAW,CAAC,KAAK;QAC9B,YAAY;QACZ,WAAW,EAAE;YACZ,KAAK,EAAE,oBAAoB;YAC3B,YAAY,EAAE,KAA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,EAAE,KAAK,CAAC,OAAO;gBACpB,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;aACtD,CAAC;YACF,SAAS,CAAC,KAAK,CAAC,0CAA0B,EAAE,gBAAgB,CAAC,CAAC;YAE9D,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAA,4BAAa,EAAC,MAAM,CAAC,EAAE,CAAC;gBACxD,iBAAiB,EAAE,MAAM;aACzB,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC,CAAC;AAxEU,QAAA,2BAA2B,+BAwErC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CODE_BUILDER_SEARCH_NODES_TOOL, CODE_BUILDER_GET_NODE_TYPES_TOOL, CODE_BUILDER_GET_SUGGESTED_NODES_TOOL, CODE_BUILDER_VALIDATE_TOOL, MCP_GET_SDK_REFERENCE_TOOL, MCP_CREATE_WORKFLOW_FROM_CODE_TOOL, MCP_ARCHIVE_WORKFLOW_TOOL, MCP_UPDATE_WORKFLOW_TOOL, } from '@n8n/ai-workflow-builder';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MCP_UPDATE_WORKFLOW_TOOL = exports.MCP_ARCHIVE_WORKFLOW_TOOL = exports.MCP_CREATE_WORKFLOW_FROM_CODE_TOOL = exports.MCP_GET_SDK_REFERENCE_TOOL = exports.CODE_BUILDER_VALIDATE_TOOL = exports.CODE_BUILDER_GET_SUGGESTED_NODES_TOOL = exports.CODE_BUILDER_GET_NODE_TYPES_TOOL = exports.CODE_BUILDER_SEARCH_NODES_TOOL = void 0;
|
|
4
|
+
var ai_workflow_builder_1 = require("@n8n/ai-workflow-builder");
|
|
5
|
+
Object.defineProperty(exports, "CODE_BUILDER_SEARCH_NODES_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.CODE_BUILDER_SEARCH_NODES_TOOL; } });
|
|
6
|
+
Object.defineProperty(exports, "CODE_BUILDER_GET_NODE_TYPES_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.CODE_BUILDER_GET_NODE_TYPES_TOOL; } });
|
|
7
|
+
Object.defineProperty(exports, "CODE_BUILDER_GET_SUGGESTED_NODES_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.CODE_BUILDER_GET_SUGGESTED_NODES_TOOL; } });
|
|
8
|
+
Object.defineProperty(exports, "CODE_BUILDER_VALIDATE_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.CODE_BUILDER_VALIDATE_TOOL; } });
|
|
9
|
+
Object.defineProperty(exports, "MCP_GET_SDK_REFERENCE_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.MCP_GET_SDK_REFERENCE_TOOL; } });
|
|
10
|
+
Object.defineProperty(exports, "MCP_CREATE_WORKFLOW_FROM_CODE_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.MCP_CREATE_WORKFLOW_FROM_CODE_TOOL; } });
|
|
11
|
+
Object.defineProperty(exports, "MCP_ARCHIVE_WORKFLOW_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.MCP_ARCHIVE_WORKFLOW_TOOL; } });
|
|
12
|
+
Object.defineProperty(exports, "MCP_UPDATE_WORKFLOW_TOOL", { enumerable: true, get: function () { return ai_workflow_builder_1.MCP_UPDATE_WORKFLOW_TOOL; } });
|
|
13
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/modules/mcp/tools/workflow-builder/constants.ts"],"names":[],"mappings":";;;AAIA,gEASkC;AARjC,qIAAA,8BAA8B,OAAA;AAC9B,uIAAA,gCAAgC,OAAA;AAChC,4IAAA,qCAAqC,OAAA;AACrC,iIAAA,0BAA0B,OAAA;AAC1B,iIAAA,0BAA0B,OAAA;AAC1B,yIAAA,kCAAkC,OAAA;AAClC,gIAAA,yBAAyB,OAAA;AACzB,+HAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type User, type ProjectRepository } from '@n8n/db';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
import type { ToolDefinition } from '../../mcp.types';
|
|
4
|
+
import type { CredentialsService } from '../../../../credentials/credentials.service';
|
|
5
|
+
import type { NodeTypes } from '../../../../node-types';
|
|
6
|
+
import type { UrlService } from '../../../../services/url.service';
|
|
7
|
+
import type { Telemetry } from '../../../../telemetry';
|
|
8
|
+
import type { WorkflowCreationService } from '../../../../workflows/workflow-creation.service';
|
|
9
|
+
declare const inputSchema: {
|
|
10
|
+
code: z.ZodString;
|
|
11
|
+
name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
description: z.ZodOptional<z.ZodString>;
|
|
13
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
};
|
|
15
|
+
export declare const createCreateWorkflowFromCodeTool: (user: User, workflowCreationService: WorkflowCreationService, urlService: UrlService, telemetry: Telemetry, nodeTypes: NodeTypes, credentialsService: CredentialsService, projectRepository: ProjectRepository) => ToolDefinition<typeof inputSchema>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.createCreateWorkflowFromCodeTool = void 0;
|
|
40
|
+
const db_1 = require("@n8n/db");
|
|
41
|
+
const zod_1 = __importDefault(require("zod"));
|
|
42
|
+
const constants_1 = require("./constants");
|
|
43
|
+
const credentials_auto_assign_1 = require("./credentials-auto-assign");
|
|
44
|
+
const mcp_constants_1 = require("../../mcp.constants");
|
|
45
|
+
const inputSchema = {
|
|
46
|
+
code: zod_1.default
|
|
47
|
+
.string()
|
|
48
|
+
.describe(`Full TypeScript/JavaScript workflow code using the n8n Workflow SDK. Must be validated first with ${constants_1.CODE_BUILDER_VALIDATE_TOOL.toolName}.`),
|
|
49
|
+
name: zod_1.default
|
|
50
|
+
.string()
|
|
51
|
+
.max(128)
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Optional workflow name. If not provided, uses the name from the code.'),
|
|
54
|
+
description: zod_1.default
|
|
55
|
+
.string()
|
|
56
|
+
.max(255)
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('Short workflow description summarizing what it does (1-2 sentences, max 255 chars).'),
|
|
59
|
+
projectId: zod_1.default
|
|
60
|
+
.string()
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Optional project ID to create the workflow in. Defaults to the user's personal project."),
|
|
63
|
+
};
|
|
64
|
+
const outputSchema = {
|
|
65
|
+
workflowId: zod_1.default.string().describe('The ID of the created workflow'),
|
|
66
|
+
name: zod_1.default.string().describe('The name of the created workflow'),
|
|
67
|
+
nodeCount: zod_1.default.number().describe('The number of nodes in the workflow'),
|
|
68
|
+
url: zod_1.default.string().describe('The URL to open the workflow in n8n'),
|
|
69
|
+
autoAssignedCredentials: zod_1.default
|
|
70
|
+
.array(zod_1.default.object({
|
|
71
|
+
nodeName: zod_1.default.string().describe('The name of the node that had credentials auto-assigned'),
|
|
72
|
+
credentialName: zod_1.default.string().describe('The name of the credential that was auto-assigned'),
|
|
73
|
+
}))
|
|
74
|
+
.describe('List of credentials that were automatically assigned to nodes'),
|
|
75
|
+
note: zod_1.default
|
|
76
|
+
.string()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('Additional notes about the workflow creation, such as any nodes that were skipped during credential auto-assignment.'),
|
|
79
|
+
};
|
|
80
|
+
const createCreateWorkflowFromCodeTool = (user, workflowCreationService, urlService, telemetry, nodeTypes, credentialsService, projectRepository) => ({
|
|
81
|
+
name: constants_1.MCP_CREATE_WORKFLOW_FROM_CODE_TOOL.toolName,
|
|
82
|
+
config: {
|
|
83
|
+
description: `Create a workflow in n8n from validated SDK code. Parses the code into a workflow and saves it. Always validate with ${constants_1.CODE_BUILDER_VALIDATE_TOOL.toolName} first.`,
|
|
84
|
+
inputSchema,
|
|
85
|
+
outputSchema,
|
|
86
|
+
annotations: {
|
|
87
|
+
title: constants_1.MCP_CREATE_WORKFLOW_FROM_CODE_TOOL.displayTitle,
|
|
88
|
+
readOnlyHint: false,
|
|
89
|
+
destructiveHint: false,
|
|
90
|
+
idempotentHint: false,
|
|
91
|
+
openWorldHint: false,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
handler: async ({ code, name, description, projectId, }) => {
|
|
95
|
+
const telemetryPayload = {
|
|
96
|
+
user_id: user.id,
|
|
97
|
+
tool_name: constants_1.MCP_CREATE_WORKFLOW_FROM_CODE_TOOL.toolName,
|
|
98
|
+
parameters: { codeLength: code.length, hasName: !!name, hasProjectId: !!projectId },
|
|
99
|
+
};
|
|
100
|
+
try {
|
|
101
|
+
const { ParseValidateHandler, stripImportStatements } = await Promise.resolve().then(() => __importStar(require('@n8n/ai-workflow-builder')));
|
|
102
|
+
const handler = new ParseValidateHandler({ generatePinData: false });
|
|
103
|
+
const strippedCode = stripImportStatements(code);
|
|
104
|
+
const result = await handler.parseAndValidate(strippedCode);
|
|
105
|
+
const workflowJson = result.workflow;
|
|
106
|
+
const newWorkflow = new db_1.WorkflowEntity();
|
|
107
|
+
Object.assign(newWorkflow, {
|
|
108
|
+
name: name ?? workflowJson.name ?? 'Untitled Workflow',
|
|
109
|
+
...(description ? { description } : {}),
|
|
110
|
+
nodes: workflowJson.nodes,
|
|
111
|
+
connections: workflowJson.connections,
|
|
112
|
+
settings: { ...workflowJson.settings, executionOrder: 'v1', availableInMCP: true },
|
|
113
|
+
pinData: workflowJson.pinData,
|
|
114
|
+
meta: { ...workflowJson.meta, aiBuilderAssisted: true },
|
|
115
|
+
});
|
|
116
|
+
let effectiveProjectId = projectId;
|
|
117
|
+
if (!effectiveProjectId) {
|
|
118
|
+
const personalProject = await projectRepository.getPersonalProjectForUserOrFail(user.id);
|
|
119
|
+
effectiveProjectId = personalProject.id;
|
|
120
|
+
}
|
|
121
|
+
const { assignments: credentialAssignments, skippedHttpNodes } = await (0, credentials_auto_assign_1.autoPopulateNodeCredentials)(newWorkflow, user, nodeTypes, credentialsService, effectiveProjectId);
|
|
122
|
+
const savedWorkflow = await workflowCreationService.createWorkflow(user, newWorkflow, {
|
|
123
|
+
projectId,
|
|
124
|
+
});
|
|
125
|
+
const baseUrl = urlService.getInstanceBaseUrl();
|
|
126
|
+
const workflowUrl = `${baseUrl}/workflow/${savedWorkflow.id}`;
|
|
127
|
+
telemetryPayload.results = {
|
|
128
|
+
success: true,
|
|
129
|
+
data: {
|
|
130
|
+
workflowId: savedWorkflow.id,
|
|
131
|
+
nodeCount: savedWorkflow.nodes.length,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
135
|
+
const output = {
|
|
136
|
+
workflowId: savedWorkflow.id,
|
|
137
|
+
name: savedWorkflow.name,
|
|
138
|
+
nodeCount: savedWorkflow.nodes.length,
|
|
139
|
+
url: workflowUrl,
|
|
140
|
+
autoAssignedCredentials: credentialAssignments,
|
|
141
|
+
note: skippedHttpNodes.length
|
|
142
|
+
? `HTTP Request nodes (${skippedHttpNodes.join(', ')}) were skipped during credential auto-assignment. Their credentials must be configured manually.`
|
|
143
|
+
: undefined,
|
|
144
|
+
};
|
|
145
|
+
return {
|
|
146
|
+
content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
|
|
147
|
+
structuredContent: output,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
152
|
+
telemetryPayload.results = {
|
|
153
|
+
success: false,
|
|
154
|
+
error: errorMessage,
|
|
155
|
+
};
|
|
156
|
+
telemetry.track(mcp_constants_1.USER_CALLED_MCP_TOOL_EVENT, telemetryPayload);
|
|
157
|
+
const output = { error: errorMessage };
|
|
158
|
+
return {
|
|
159
|
+
content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
|
|
160
|
+
structuredContent: output,
|
|
161
|
+
isError: true,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
exports.createCreateWorkflowFromCodeTool = createCreateWorkflowFromCodeTool;
|
|
167
|
+
//# sourceMappingURL=create-workflow-from-code.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-workflow-from-code.tool.js","sourceRoot":"","sources":["../../../../../src/modules/mcp/tools/workflow-builder/create-workflow-from-code.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gCAA4E;AAC5E,8CAAoB;AAEpB,2CAA6F;AAC7F,uEAAwE;AACxE,uDAAiE;AASjE,MAAM,WAAW,GAAG;IACnB,IAAI,EAAE,aAAC;SACL,MAAM,EAAE;SACR,QAAQ,CACR,qGAAqG,sCAA0B,CAAC,QAAQ,GAAG,CAC3I;IACF,IAAI,EAAE,aAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,uEAAuE,CAAC;IACnF,WAAW,EAAE,aAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,GAAG,CAAC;SACR,QAAQ,EAAE;SACV,QAAQ,CACR,qFAAqF,CACrF;IACF,SAAS,EAAE,aAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACR,yFAAyF,CACzF;CACsB,CAAC;AAE1B,MAAM,YAAY,GAAG;IACpB,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IACjE,IAAI,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC7D,SAAS,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACrE,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC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AAgB,CAAC,OAAO,GAAG;gBAC1B,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,YAAY;aACnB,CAAC;YACF,SAAS,CAAC,KAAK,CAAC,0CAA0B,EAAE,gBAAgB,CAAC,CAAC;YAE9D,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;YAEvC,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;gBAClE,iBAAiB,EAAE,MAAM;gBACzB,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAC,CAAC;AA7HU,QAAA,gCAAgC,oCA6H1C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { User } from '@n8n/db';
|
|
2
|
+
import type { IWorkflowBase } from 'n8n-workflow';
|
|
3
|
+
import type { CredentialsService } from '../../../../credentials/credentials.service';
|
|
4
|
+
import type { NodeTypes } from '../../../../node-types';
|
|
5
|
+
export interface CredentialAssignment {
|
|
6
|
+
nodeName: string;
|
|
7
|
+
credentialName: string;
|
|
8
|
+
credentialType: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AutoAssignResult {
|
|
11
|
+
assignments: CredentialAssignment[];
|
|
12
|
+
skippedHttpNodes: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function autoPopulateNodeCredentials(workflow: IWorkflowBase, user: User, nodeTypes: NodeTypes, credentialsService: CredentialsService, projectId: string): Promise<AutoAssignResult>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.autoPopulateNodeCredentials = autoPopulateNodeCredentials;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const HTTP_NODE_TYPES = new Set([
|
|
6
|
+
'n8n-nodes-base.httpRequest',
|
|
7
|
+
'@n8n/n8n-nodes-langchain.toolHttpRequest',
|
|
8
|
+
'n8n-nodes-base.httpRequestTool',
|
|
9
|
+
]);
|
|
10
|
+
async function autoPopulateNodeCredentials(workflow, user, nodeTypes, credentialsService, projectId) {
|
|
11
|
+
const usableCredentials = await credentialsService.getCredentialsAUserCanUseInAWorkflow(user, {
|
|
12
|
+
projectId,
|
|
13
|
+
});
|
|
14
|
+
const credentialsByType = new Map();
|
|
15
|
+
for (const cred of usableCredentials) {
|
|
16
|
+
const list = credentialsByType.get(cred.type) ?? [];
|
|
17
|
+
list.push({ id: cred.id, name: cred.name });
|
|
18
|
+
credentialsByType.set(cred.type, list);
|
|
19
|
+
}
|
|
20
|
+
const assignments = [];
|
|
21
|
+
const skippedHttpNodes = [];
|
|
22
|
+
for (const node of workflow.nodes) {
|
|
23
|
+
if (node.disabled)
|
|
24
|
+
continue;
|
|
25
|
+
if (HTTP_NODE_TYPES.has(node.type)) {
|
|
26
|
+
skippedHttpNodes.push(node.name);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
let nodeTypeDescription;
|
|
30
|
+
try {
|
|
31
|
+
const nodeType = nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
32
|
+
nodeTypeDescription = nodeType.description;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const credentialDescriptions = nodeTypeDescription.credentials;
|
|
38
|
+
if (!credentialDescriptions?.length)
|
|
39
|
+
continue;
|
|
40
|
+
const nodeParametersWithDefaults = n8n_workflow_1.NodeHelpers.getNodeParameters(nodeTypeDescription.properties, node.parameters, true, false, node, nodeTypeDescription) ?? node.parameters;
|
|
41
|
+
for (const credDesc of credentialDescriptions) {
|
|
42
|
+
const shouldDisplay = n8n_workflow_1.NodeHelpers.displayParameter(nodeParametersWithDefaults, credDesc, node, nodeTypeDescription);
|
|
43
|
+
if (!shouldDisplay)
|
|
44
|
+
continue;
|
|
45
|
+
const existing = node.credentials?.[credDesc.name];
|
|
46
|
+
if (existing?.id)
|
|
47
|
+
continue;
|
|
48
|
+
const candidates = credentialsByType.get(credDesc.name);
|
|
49
|
+
if (!candidates?.length)
|
|
50
|
+
continue;
|
|
51
|
+
node.credentials = node.credentials ?? {};
|
|
52
|
+
node.credentials[credDesc.name] = {
|
|
53
|
+
id: candidates[0].id,
|
|
54
|
+
name: candidates[0].name,
|
|
55
|
+
};
|
|
56
|
+
assignments.push({
|
|
57
|
+
nodeName: node.name,
|
|
58
|
+
credentialName: candidates[0].name,
|
|
59
|
+
credentialType: credDesc.name,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { assignments, skippedHttpNodes };
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=credentials-auto-assign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-auto-assign.js","sourceRoot":"","sources":["../../../../../src/modules/mcp/tools/workflow-builder/credentials-auto-assign.ts"],"names":[],"mappings":";;AAgCA,kEAkFC;AAhHD,+CAA2C;AAgB3C,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC/B,4BAA4B;IAC5B,0CAA0C;IAC1C,gCAAgC;CAChC,CAAC,CAAC;AAUI,KAAK,UAAU,2BAA2B,CAChD,QAAuB,EACvB,IAAU,EACV,SAAoB,EACpB,kBAAsC,EACtC,SAAiB;IAEjB,MAAM,iBAAiB,GAAG,MAAM,kBAAkB,CAAC,oCAAoC,CAAC,IAAI,EAAE;QAC7F,SAAS;KACT,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA+C,CAAC;IACjF,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACpD,IAAI,CAAC,IAAI,CAAC,EAAE,EA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C,aAAa;gBAAE,SAAS;YAE7B,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACnD,IAAI,QAAQ,EAAE,EAAE;gBAAE,SAAS;YAE3B,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACxD,IAAI,CAAC,UAAU,EAAE,MAAM;gBAAE,SAAS;YAElC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG;gBACjC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;gBACpB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;aACxB,CAAC;YAEF,WAAW,CAAC,IAAI,CAAC;gBAChB,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;gBAClC,cAAc,EAAE,QAAQ,CAAC,IAAI;aAC7B,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { User } from '@n8n/db';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
import type { ToolDefinition } from '../../mcp.types';
|
|
4
|
+
import type { Telemetry } from '../../../../telemetry';
|
|
5
|
+
import type { WorkflowService } from '../../../../workflows/workflow.service';
|
|
6
|
+
declare const inputSchema: {
|
|
7
|
+
workflowId: z.ZodString;
|
|
8
|
+
};
|
|
9
|
+
export declare const createArchiveWorkflowTool: (user: User, workflowService: WorkflowService, telemetry: Telemetry) => ToolDefinition<typeof inputSchema>;
|
|
10
|
+
export {};
|