@n8n/instance-ai 1.1.0 → 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/agent/instance-agent.js +17 -45
- package/dist/agent/instance-agent.js.map +1 -1
- package/dist/agent/register-with-mastra.d.ts +1 -1
- package/dist/agent/register-with-mastra.js +5 -9
- package/dist/agent/register-with-mastra.js.map +1 -1
- package/dist/agent/sub-agent-briefing.d.ts +20 -0
- package/dist/agent/sub-agent-briefing.js +39 -0
- package/dist/agent/sub-agent-briefing.js.map +1 -0
- package/dist/agent/sub-agent-debriefing.d.ts +71 -0
- package/dist/agent/sub-agent-debriefing.js +39 -0
- package/dist/agent/sub-agent-debriefing.js.map +1 -0
- package/dist/agent/sub-agent-factory.d.ts +1 -1
- package/dist/agent/sub-agent-factory.js +15 -3
- package/dist/agent/sub-agent-factory.js.map +1 -1
- package/dist/agent/system-prompt.d.ts +1 -0
- package/dist/agent/system-prompt.js +67 -43
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/agent/tool-access.d.ts +2 -0
- package/dist/agent/tool-access.js +28 -0
- package/dist/agent/tool-access.js.map +1 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/domain-access/domain-gating.d.ts +1 -0
- package/dist/domain-access/domain-gating.js +3 -0
- package/dist/domain-access/domain-gating.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/dist/memory/memory-config.js +1 -3
- package/dist/memory/memory-config.js.map +1 -1
- package/dist/parsers/structured-file-parser.d.ts +56 -0
- package/dist/parsers/structured-file-parser.js +354 -0
- package/dist/parsers/structured-file-parser.js.map +1 -0
- package/dist/planned-tasks/planned-task-service.js +6 -0
- package/dist/planned-tasks/planned-task-service.js.map +1 -1
- package/dist/runtime/background-task-manager.d.ts +2 -1
- package/dist/runtime/background-task-manager.js +13 -1
- package/dist/runtime/background-task-manager.js.map +1 -1
- package/dist/runtime/resumable-stream-executor.d.ts +6 -3
- package/dist/runtime/resumable-stream-executor.js +66 -119
- package/dist/runtime/resumable-stream-executor.js.map +1 -1
- package/dist/runtime/stream-runner.d.ts +2 -2
- package/dist/runtime/stream-runner.js +4 -25
- package/dist/runtime/stream-runner.js.map +1 -1
- package/dist/stream/consume-with-hitl.d.ts +4 -1
- package/dist/stream/consume-with-hitl.js +11 -2
- package/dist/stream/consume-with-hitl.js.map +1 -1
- package/dist/stream/map-chunk.d.ts +1 -1
- package/dist/stream/map-chunk.js +20 -15
- package/dist/stream/map-chunk.js.map +1 -1
- package/dist/stream/work-summary-accumulator.d.ts +63 -0
- package/dist/stream/work-summary-accumulator.js +66 -0
- package/dist/stream/work-summary-accumulator.js.map +1 -0
- package/dist/tools/attachments/parse-file.tool.d.ts +90 -0
- package/dist/tools/attachments/parse-file.tool.js +135 -0
- package/dist/tools/attachments/parse-file.tool.js.map +1 -0
- package/dist/tools/best-practices/get-best-practices.tool.d.ts +6 -9
- package/dist/tools/best-practices/get-best-practices.tool.js +7 -5
- package/dist/tools/best-practices/get-best-practices.tool.js.map +1 -1
- package/dist/tools/best-practices/index.js +5 -29
- package/dist/tools/best-practices/index.js.map +1 -1
- package/dist/tools/best-practices/techniques.d.ts +1 -20
- package/dist/tools/best-practices/techniques.js +3 -36
- package/dist/tools/best-practices/techniques.js.map +1 -1
- package/dist/tools/credentials/delete-credential.tool.d.ts +13 -14
- package/dist/tools/credentials/delete-credential.tool.js +18 -11
- package/dist/tools/credentials/delete-credential.tool.js.map +1 -1
- package/dist/tools/credentials/get-credential.tool.d.ts +8 -2
- package/dist/tools/credentials/get-credential.tool.js +13 -7
- package/dist/tools/credentials/get-credential.tool.js.map +1 -1
- package/dist/tools/credentials/list-credentials.tool.d.ts +13 -3
- package/dist/tools/credentials/list-credentials.tool.js +50 -8
- package/dist/tools/credentials/list-credentials.tool.js.map +1 -1
- package/dist/tools/credentials/search-credential-types.tool.d.ts +7 -3
- package/dist/tools/credentials/search-credential-types.tool.js +7 -5
- package/dist/tools/credentials/search-credential-types.tool.js.map +1 -1
- package/dist/tools/credentials/setup-credentials.tool.d.ts +40 -44
- package/dist/tools/credentials/setup-credentials.tool.js +37 -31
- package/dist/tools/credentials/setup-credentials.tool.js.map +1 -1
- package/dist/tools/credentials/test-credential.tool.d.ts +7 -4
- package/dist/tools/credentials/test-credential.tool.js +5 -3
- package/dist/tools/credentials/test-credential.tool.js.map +1 -1
- package/dist/tools/data-tables/add-data-table-column.tool.d.ts +15 -19
- package/dist/tools/data-tables/add-data-table-column.tool.js +16 -9
- package/dist/tools/data-tables/add-data-table-column.tool.js.map +1 -1
- package/dist/tools/data-tables/create-data-table.tool.d.ts +26 -24
- package/dist/tools/data-tables/create-data-table.tool.js +49 -22
- package/dist/tools/data-tables/create-data-table.tool.js.map +1 -1
- package/dist/tools/data-tables/delete-data-table-column.tool.d.ts +13 -14
- package/dist/tools/data-tables/delete-data-table-column.tool.js +15 -8
- package/dist/tools/data-tables/delete-data-table-column.tool.js.map +1 -1
- package/dist/tools/data-tables/delete-data-table-rows.tool.d.ts +49 -15
- package/dist/tools/data-tables/delete-data-table-rows.tool.js +25 -9
- package/dist/tools/data-tables/delete-data-table-rows.tool.js.map +1 -1
- package/dist/tools/data-tables/delete-data-table.tool.d.ts +11 -14
- package/dist/tools/data-tables/delete-data-table.tool.js +17 -9
- package/dist/tools/data-tables/delete-data-table.tool.js.map +1 -1
- package/dist/tools/data-tables/get-data-table-schema.tool.d.ts +7 -8
- package/dist/tools/data-tables/get-data-table-schema.tool.js +5 -3
- package/dist/tools/data-tables/get-data-table-schema.tool.js.map +1 -1
- package/dist/tools/data-tables/insert-data-table-rows.tool.d.ts +14 -15
- package/dist/tools/data-tables/insert-data-table-rows.tool.js +22 -12
- package/dist/tools/data-tables/insert-data-table-rows.tool.js.map +1 -1
- package/dist/tools/data-tables/list-data-tables.tool.d.ts +7 -3
- package/dist/tools/data-tables/list-data-tables.tool.js +8 -6
- package/dist/tools/data-tables/list-data-tables.tool.js.map +1 -1
- package/dist/tools/data-tables/query-data-table-rows.tool.d.ts +49 -8
- package/dist/tools/data-tables/query-data-table-rows.tool.js +14 -12
- package/dist/tools/data-tables/query-data-table-rows.tool.js.map +1 -1
- package/dist/tools/data-tables/rename-data-table-column.tool.d.ts +15 -14
- package/dist/tools/data-tables/rename-data-table-column.tool.js +16 -9
- package/dist/tools/data-tables/rename-data-table-column.tool.js.map +1 -1
- package/dist/tools/data-tables/update-data-table-rows.tool.d.ts +51 -14
- package/dist/tools/data-tables/update-data-table-rows.tool.js +19 -9
- package/dist/tools/data-tables/update-data-table-rows.tool.js.map +1 -1
- package/dist/tools/executions/debug-execution.tool.d.ts +8 -2
- package/dist/tools/executions/debug-execution.tool.js +5 -3
- package/dist/tools/executions/debug-execution.tool.js.map +1 -1
- package/dist/tools/executions/get-execution.tool.d.ts +8 -2
- package/dist/tools/executions/get-execution.tool.js +5 -3
- package/dist/tools/executions/get-execution.tool.js.map +1 -1
- package/dist/tools/executions/get-node-output.tool.d.ts +14 -2
- package/dist/tools/executions/get-node-output.tool.js +14 -17
- package/dist/tools/executions/get-node-output.tool.js.map +1 -1
- package/dist/tools/executions/list-executions.tool.d.ts +11 -3
- package/dist/tools/executions/list-executions.tool.js +16 -14
- package/dist/tools/executions/list-executions.tool.js.map +1 -1
- package/dist/tools/executions/run-workflow.tool.d.ts +17 -15
- package/dist/tools/executions/run-workflow.tool.js +35 -25
- package/dist/tools/executions/run-workflow.tool.js.map +1 -1
- package/dist/tools/executions/stop-execution.tool.d.ts +7 -4
- package/dist/tools/executions/stop-execution.tool.js +8 -3
- package/dist/tools/executions/stop-execution.tool.js.map +1 -1
- package/dist/tools/filesystem/create-tools-from-mcp-server.js +2 -1
- package/dist/tools/filesystem/create-tools-from-mcp-server.js.map +1 -1
- package/dist/tools/index.d.ts +67 -2380
- package/dist/tools/index.js +9 -15
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/nodes/explore-node-resources.tool.d.ts +23 -10
- package/dist/tools/nodes/explore-node-resources.tool.js +27 -25
- package/dist/tools/nodes/explore-node-resources.tool.js.map +1 -1
- package/dist/tools/nodes/get-node-description.tool.d.ts +7 -20
- package/dist/tools/nodes/get-node-description.tool.js +5 -3
- package/dist/tools/nodes/get-node-description.tool.js.map +1 -1
- package/dist/tools/nodes/get-node-type-definition.tool.d.ts +29 -6
- package/dist/tools/nodes/get-node-type-definition.tool.js +9 -7
- package/dist/tools/nodes/get-node-type-definition.tool.js.map +1 -1
- package/dist/tools/nodes/get-suggested-nodes.tool.d.ts +7 -12
- package/dist/tools/nodes/get-suggested-nodes.tool.js +9 -7
- package/dist/tools/nodes/get-suggested-nodes.tool.js.map +1 -1
- package/dist/tools/nodes/list-nodes.tool.d.ts +7 -3
- package/dist/tools/nodes/list-nodes.tool.js +8 -6
- package/dist/tools/nodes/list-nodes.tool.js.map +1 -1
- package/dist/tools/nodes/node-search-engine.d.ts +1 -0
- package/dist/tools/nodes/node-search-engine.js +12 -9
- package/dist/tools/nodes/node-search-engine.js.map +1 -1
- package/dist/tools/nodes/search-nodes.tool.d.ts +12 -24
- package/dist/tools/nodes/search-nodes.tool.js +21 -17
- package/dist/tools/nodes/search-nodes.tool.js.map +1 -1
- package/dist/tools/orchestration/add-plan-item.tool.d.ts +5 -0
- package/dist/tools/orchestration/add-plan-item.tool.js +91 -0
- package/dist/tools/orchestration/add-plan-item.tool.js.map +1 -0
- package/dist/tools/orchestration/blueprint-accumulator.d.ts +50 -0
- package/dist/tools/orchestration/blueprint-accumulator.js +215 -0
- package/dist/tools/orchestration/blueprint-accumulator.js.map +1 -0
- package/dist/tools/orchestration/blueprint.schema.d.ts +271 -0
- package/dist/tools/orchestration/blueprint.schema.js +61 -0
- package/dist/tools/orchestration/blueprint.schema.js.map +1 -0
- package/dist/tools/orchestration/browser-credential-setup.tool.d.ts +15 -12
- package/dist/tools/orchestration/browser-credential-setup.tool.js +26 -21
- package/dist/tools/orchestration/browser-credential-setup.tool.js.map +1 -1
- package/dist/tools/orchestration/build-workflow-agent.prompt.d.ts +1 -1
- package/dist/tools/orchestration/build-workflow-agent.prompt.js +43 -149
- package/dist/tools/orchestration/build-workflow-agent.prompt.js.map +1 -1
- package/dist/tools/orchestration/build-workflow-agent.tool.d.ts +11 -4
- package/dist/tools/orchestration/build-workflow-agent.tool.js +50 -82
- package/dist/tools/orchestration/build-workflow-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/cancel-background-task.tool.d.ts +7 -3
- package/dist/tools/orchestration/cancel-background-task.tool.js +5 -3
- package/dist/tools/orchestration/cancel-background-task.tool.js.map +1 -1
- package/dist/tools/orchestration/correct-background-task.tool.d.ts +9 -3
- package/dist/tools/orchestration/correct-background-task.tool.js +8 -6
- package/dist/tools/orchestration/correct-background-task.tool.js.map +1 -1
- package/dist/tools/orchestration/data-table-agent.prompt.d.ts +1 -1
- package/dist/tools/orchestration/data-table-agent.prompt.js +20 -0
- package/dist/tools/orchestration/data-table-agent.prompt.js.map +1 -1
- package/dist/tools/orchestration/data-table-agent.tool.d.ts +9 -4
- package/dist/tools/orchestration/data-table-agent.tool.js +22 -25
- package/dist/tools/orchestration/data-table-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/delegate.schemas.d.ts +12 -0
- package/dist/tools/orchestration/delegate.schemas.js +17 -0
- package/dist/tools/orchestration/delegate.schemas.js.map +1 -1
- package/dist/tools/orchestration/delegate.tool.d.ts +1 -10
- package/dist/tools/orchestration/delegate.tool.js +40 -41
- package/dist/tools/orchestration/delegate.tool.js.map +1 -1
- package/dist/tools/orchestration/plan-agent-prompt.d.ts +1 -0
- package/dist/tools/orchestration/plan-agent-prompt.js +76 -0
- package/dist/tools/orchestration/plan-agent-prompt.js.map +1 -0
- package/dist/tools/orchestration/plan-with-agent.tool.d.ts +2 -0
- package/dist/tools/orchestration/plan-with-agent.tool.js +277 -0
- package/dist/tools/orchestration/plan-with-agent.tool.js.map +1 -0
- package/dist/tools/orchestration/plan.tool.d.ts +7 -39
- package/dist/tools/orchestration/plan.tool.js +15 -13
- package/dist/tools/orchestration/plan.tool.js.map +1 -1
- package/dist/tools/orchestration/report-verification-verdict.tool.d.ts +23 -3
- package/dist/tools/orchestration/report-verification-verdict.tool.js +27 -28
- package/dist/tools/orchestration/report-verification-verdict.tool.js.map +1 -1
- package/dist/tools/orchestration/research-with-agent.tool.d.ts +11 -4
- package/dist/tools/orchestration/research-with-agent.tool.js +25 -21
- package/dist/tools/orchestration/research-with-agent.tool.js.map +1 -1
- package/dist/tools/orchestration/submit-plan.tool.d.ts +3 -0
- package/dist/tools/orchestration/submit-plan.tool.js +81 -0
- package/dist/tools/orchestration/submit-plan.tool.js.map +1 -0
- package/dist/tools/orchestration/update-tasks.tool.d.ts +1 -9
- package/dist/tools/orchestration/update-tasks.tool.js.map +1 -1
- package/dist/tools/orchestration/verify-built-workflow.tool.d.ts +13 -7
- package/dist/tools/orchestration/verify-built-workflow.tool.js +14 -15
- package/dist/tools/orchestration/verify-built-workflow.tool.js.map +1 -1
- package/dist/tools/shared/ask-user.tool.d.ts +42 -31
- package/dist/tools/shared/ask-user.tool.js +16 -15
- package/dist/tools/shared/ask-user.tool.js.map +1 -1
- package/dist/tools/templates/search-template-parameters.tool.d.ts +14 -7
- package/dist/tools/templates/search-template-parameters.tool.js +17 -15
- package/dist/tools/templates/search-template-parameters.tool.js.map +1 -1
- package/dist/tools/templates/search-template-structures.tool.d.ts +11 -8
- package/dist/tools/templates/search-template-structures.tool.js +13 -11
- package/dist/tools/templates/search-template-structures.tool.js.map +1 -1
- package/dist/tools/web-research/fetch-url.tool.d.ts +9 -23
- package/dist/tools/web-research/fetch-url.tool.js +30 -14
- package/dist/tools/web-research/fetch-url.tool.js.map +1 -1
- package/dist/tools/web-research/web-search.tool.d.ts +12 -2
- package/dist/tools/web-research/web-search.tool.js +20 -18
- package/dist/tools/web-research/web-search.tool.js.map +1 -1
- package/dist/tools/workflows/apply-workflow-credentials.tool.d.ts +11 -5
- package/dist/tools/workflows/apply-workflow-credentials.tool.js +7 -5
- package/dist/tools/workflows/apply-workflow-credentials.tool.js.map +1 -1
- package/dist/tools/workflows/build-workflow.tool.d.ts +26 -5
- package/dist/tools/workflows/build-workflow.tool.js +23 -20
- package/dist/tools/workflows/build-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/delete-workflow.tool.d.ts +13 -14
- package/dist/tools/workflows/delete-workflow.tool.js +15 -11
- package/dist/tools/workflows/delete-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/get-workflow-as-code.tool.d.ts +6 -10
- package/dist/tools/workflows/get-workflow-as-code.tool.js +5 -3
- package/dist/tools/workflows/get-workflow-as-code.tool.js.map +1 -1
- package/dist/tools/workflows/get-workflow-version.tool.d.ts +8 -16
- package/dist/tools/workflows/get-workflow-version.tool.js +6 -4
- package/dist/tools/workflows/get-workflow-version.tool.js.map +1 -1
- package/dist/tools/workflows/get-workflow.tool.d.ts +7 -15
- package/dist/tools/workflows/get-workflow.tool.js +5 -3
- package/dist/tools/workflows/get-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/list-workflow-versions.tool.d.ts +11 -3
- package/dist/tools/workflows/list-workflow-versions.tool.js +13 -11
- package/dist/tools/workflows/list-workflow-versions.tool.js.map +1 -1
- package/dist/tools/workflows/list-workflows.tool.d.ts +9 -10
- package/dist/tools/workflows/list-workflows.tool.js +12 -10
- package/dist/tools/workflows/list-workflows.tool.js.map +1 -1
- package/dist/tools/workflows/materialize-node-type.tool.d.ts +29 -11
- package/dist/tools/workflows/materialize-node-type.tool.js +9 -7
- package/dist/tools/workflows/materialize-node-type.tool.js.map +1 -1
- package/dist/tools/workflows/publish-workflow.tool.d.ts +6 -20
- package/dist/tools/workflows/publish-workflow.tool.js +29 -24
- package/dist/tools/workflows/publish-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/restore-workflow-version.tool.d.ts +13 -15
- package/dist/tools/workflows/restore-workflow-version.tool.js +15 -8
- package/dist/tools/workflows/restore-workflow-version.tool.js.map +1 -1
- package/dist/tools/workflows/setup-workflow.service.d.ts +0 -1
- package/dist/tools/workflows/setup-workflow.service.js +23 -6
- package/dist/tools/workflows/setup-workflow.service.js.map +1 -1
- package/dist/tools/workflows/setup-workflow.tool.d.ts +7 -144
- package/dist/tools/workflows/setup-workflow.tool.js +10 -14
- package/dist/tools/workflows/setup-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/submit-workflow.tool.d.ts +12 -9
- package/dist/tools/workflows/submit-workflow.tool.js +15 -17
- package/dist/tools/workflows/submit-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/unpublish-workflow.tool.d.ts +13 -15
- package/dist/tools/workflows/unpublish-workflow.tool.js +15 -11
- package/dist/tools/workflows/unpublish-workflow.tool.js.map +1 -1
- package/dist/tools/workflows/update-workflow-version.tool.d.ts +13 -3
- package/dist/tools/workflows/update-workflow-version.tool.js +12 -10
- package/dist/tools/workflows/update-workflow-version.tool.js.map +1 -1
- package/dist/tools/workflows/write-sandbox-file.tool.d.ts +9 -9
- package/dist/tools/workflows/write-sandbox-file.tool.js +8 -6
- package/dist/tools/workflows/write-sandbox-file.tool.js.map +1 -1
- package/dist/tools/workspace/cleanup-test-executions.tool.d.ts +15 -14
- package/dist/tools/workspace/cleanup-test-executions.tool.js +19 -15
- package/dist/tools/workspace/cleanup-test-executions.tool.js.map +1 -1
- package/dist/tools/workspace/create-folder.tool.d.ts +15 -16
- package/dist/tools/workspace/create-folder.tool.js +25 -12
- package/dist/tools/workspace/create-folder.tool.js.map +1 -1
- package/dist/tools/workspace/delete-folder.tool.d.ts +19 -14
- package/dist/tools/workspace/delete-folder.tool.js +24 -17
- package/dist/tools/workspace/delete-folder.tool.js.map +1 -1
- package/dist/tools/workspace/list-folders.tool.d.ts +7 -3
- package/dist/tools/workspace/list-folders.tool.js +5 -3
- package/dist/tools/workspace/list-folders.tool.js.map +1 -1
- package/dist/tools/workspace/list-projects.tool.d.ts +3 -3
- package/dist/tools/workspace/list-projects.tool.js +3 -1
- package/dist/tools/workspace/list-projects.tool.js.map +1 -1
- package/dist/tools/workspace/list-tags.tool.d.ts +3 -6
- package/dist/tools/workspace/list-tags.tool.js +3 -1
- package/dist/tools/workspace/list-tags.tool.js.map +1 -1
- package/dist/tools/workspace/move-workflow-to-folder.tool.d.ts +17 -14
- package/dist/tools/workspace/move-workflow-to-folder.tool.js +20 -16
- package/dist/tools/workspace/move-workflow-to-folder.tool.js.map +1 -1
- package/dist/tools/workspace/tag-workflow.tool.d.ts +15 -14
- package/dist/tools/workspace/tag-workflow.tool.js +16 -12
- package/dist/tools/workspace/tag-workflow.tool.js.map +1 -1
- package/dist/tracing/langsmith-tracing.d.ts +1 -0
- package/dist/tracing/langsmith-tracing.js +47 -57
- package/dist/tracing/langsmith-tracing.js.map +1 -1
- package/dist/types.d.ts +24 -50
- package/dist/utils/eval-agents.d.ts +10 -0
- package/dist/utils/eval-agents.js +54 -0
- package/dist/utils/eval-agents.js.map +1 -0
- package/dist/workflow-builder/sdk-prompt-sections.d.ts +1 -4
- package/dist/workflow-builder/sdk-prompt-sections.js +5 -513
- package/dist/workflow-builder/sdk-prompt-sections.js.map +1 -1
- package/dist/workflow-loop/guidance.js +3 -5
- package/dist/workflow-loop/guidance.js.map +1 -1
- package/dist/workspace/daytona-filesystem.js +15 -1
- package/dist/workspace/daytona-filesystem.js.map +1 -1
- package/package.json +15 -9
- package/dist/memory/working-memory-template.d.ts +0 -1
- package/dist/memory/working-memory-template.js +0 -25
- package/dist/memory/working-memory-template.js.map +0 -1
- package/dist/runtime/working-memory-tracing.d.ts +0 -19
- package/dist/runtime/working-memory-tracing.js +0 -111
- package/dist/runtime/working-memory-tracing.js.map +0 -1
- package/dist/tools/best-practices/guides/chatbot.d.ts +0 -1
- package/dist/tools/best-practices/guides/chatbot.js +0 -111
- package/dist/tools/best-practices/guides/chatbot.js.map +0 -1
- package/dist/tools/best-practices/guides/content-generation.d.ts +0 -1
- package/dist/tools/best-practices/guides/content-generation.js +0 -108
- package/dist/tools/best-practices/guides/content-generation.js.map +0 -1
- package/dist/tools/best-practices/guides/data-extraction.d.ts +0 -1
- package/dist/tools/best-practices/guides/data-extraction.js +0 -115
- package/dist/tools/best-practices/guides/data-extraction.js.map +0 -1
- package/dist/tools/best-practices/guides/data-persistence.d.ts +0 -1
- package/dist/tools/best-practices/guides/data-persistence.js +0 -198
- package/dist/tools/best-practices/guides/data-persistence.js.map +0 -1
- package/dist/tools/best-practices/guides/data-transformation.d.ts +0 -1
- package/dist/tools/best-practices/guides/data-transformation.js +0 -139
- package/dist/tools/best-practices/guides/data-transformation.js.map +0 -1
- package/dist/tools/best-practices/guides/document-processing.d.ts +0 -1
- package/dist/tools/best-practices/guides/document-processing.js +0 -326
- package/dist/tools/best-practices/guides/document-processing.js.map +0 -1
- package/dist/tools/best-practices/guides/form-input.d.ts +0 -1
- package/dist/tools/best-practices/guides/form-input.js +0 -166
- package/dist/tools/best-practices/guides/form-input.js.map +0 -1
- package/dist/tools/best-practices/guides/notification.d.ts +0 -1
- package/dist/tools/best-practices/guides/notification.js +0 -128
- package/dist/tools/best-practices/guides/notification.js.map +0 -1
- package/dist/tools/best-practices/guides/scheduling.d.ts +0 -1
- package/dist/tools/best-practices/guides/scheduling.js +0 -145
- package/dist/tools/best-practices/guides/scheduling.js.map +0 -1
- package/dist/tools/best-practices/guides/scraping-and-research.d.ts +0 -1
- package/dist/tools/best-practices/guides/scraping-and-research.js +0 -151
- package/dist/tools/best-practices/guides/scraping-and-research.js.map +0 -1
- package/dist/tools/best-practices/guides/triage.d.ts +0 -1
- package/dist/tools/best-practices/guides/triage.js +0 -142
- package/dist/tools/best-practices/guides/triage.js.map +0 -1
- package/dist/tools/filesystem/get-file-tree.tool.d.ts +0 -22
- package/dist/tools/filesystem/get-file-tree.tool.js +0 -64
- package/dist/tools/filesystem/get-file-tree.tool.js.map +0 -1
- package/dist/tools/filesystem/list-files.tool.d.ts +0 -30
- package/dist/tools/filesystem/list-files.tool.js +0 -100
- package/dist/tools/filesystem/list-files.tool.js.map +0 -1
- package/dist/tools/filesystem/read-file.tool.d.ts +0 -25
- package/dist/tools/filesystem/read-file.tool.js +0 -83
- package/dist/tools/filesystem/read-file.tool.js.map +0 -1
- package/dist/tools/filesystem/search-files.tool.d.ts +0 -31
- package/dist/tools/filesystem/search-files.tool.js +0 -96
- package/dist/tools/filesystem/search-files.tool.js.map +0 -1
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDocumentation = getDocumentation;
|
|
4
|
-
function getDocumentation() {
|
|
5
|
-
return `# Best Practices: Data Persistence
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
Data persistence involves storing, updating, or retrieving records from durable storage systems. This technique is essential when you need to maintain data beyond the lifetime of a single workflow execution, or when you need to access existing data that users have stored in their spreadsheets, tables, or databases as part of your workflow logic.
|
|
10
|
-
|
|
11
|
-
## When to Use Data Persistence
|
|
12
|
-
|
|
13
|
-
Use data persistence when you need to:
|
|
14
|
-
- Store workflow results for later retrieval or audit trails
|
|
15
|
-
- Maintain records that multiple workflows can access and update
|
|
16
|
-
- Create a centralized data repository for your automation
|
|
17
|
-
- Archive historical data for reporting or compliance
|
|
18
|
-
- Build data that persists across workflow executions
|
|
19
|
-
- Track changes or maintain state over time
|
|
20
|
-
- Store raw form inputs
|
|
21
|
-
|
|
22
|
-
## Choosing the Right Storage Node
|
|
23
|
-
|
|
24
|
-
### Data Table (n8n-nodes-base.dataTable) - PREFERRED
|
|
25
|
-
|
|
26
|
-
**Best for:** Quick setup, small to medium amounts of data
|
|
27
|
-
|
|
28
|
-
Advantages:
|
|
29
|
-
- No credentials or external configuration required
|
|
30
|
-
- Built directly into n8n
|
|
31
|
-
- Fast and reliable for small to medium datasets
|
|
32
|
-
- Ideal for prototyping and internal workflows
|
|
33
|
-
- No additional costs or external dependencies
|
|
34
|
-
|
|
35
|
-
When to use:
|
|
36
|
-
- Internal workflow data storage
|
|
37
|
-
- Temporary or staging data
|
|
38
|
-
- Admin/audit trails
|
|
39
|
-
- Simple record keeping
|
|
40
|
-
- Development and testing
|
|
41
|
-
|
|
42
|
-
### Google Sheets (n8n-nodes-base.googleSheets)
|
|
43
|
-
|
|
44
|
-
**Best for:** Collaboration, reporting, easy data sharing
|
|
45
|
-
|
|
46
|
-
Advantages:
|
|
47
|
-
- Familiar spreadsheet interface for non-technical users
|
|
48
|
-
- Easy to share and collaborate on data
|
|
49
|
-
- Built-in visualization and formula capabilities
|
|
50
|
-
- Good for reporting and dashboards
|
|
51
|
-
- Accessible from anywhere
|
|
52
|
-
|
|
53
|
-
When to use:
|
|
54
|
-
- Data needs to be viewed/edited by multiple people
|
|
55
|
-
- Non-technical users need access to data
|
|
56
|
-
- Integration with other Google Workspace tools
|
|
57
|
-
- Simple data structures without complex relationships
|
|
58
|
-
- Workflow needs access to existing spreadsheets in Google Sheets
|
|
59
|
-
|
|
60
|
-
Pitfalls:
|
|
61
|
-
- API rate limits can affect high-volume workflows
|
|
62
|
-
- Not suitable for frequently changing data
|
|
63
|
-
- Performance degrades with very large datasets (>10k rows)
|
|
64
|
-
|
|
65
|
-
### Airtable (n8n-nodes-base.airtable)
|
|
66
|
-
|
|
67
|
-
**Best for:** Structured data with relationships, rich field types
|
|
68
|
-
|
|
69
|
-
Advantages:
|
|
70
|
-
- Supports relationships between tables
|
|
71
|
-
- Rich field types (attachments, select, links, etc.)
|
|
72
|
-
- Better structure than spreadsheets
|
|
73
|
-
|
|
74
|
-
When to use:
|
|
75
|
-
- Data has relationships or references between records
|
|
76
|
-
- Need structured database-like features
|
|
77
|
-
- Managing projects, tasks, or inventory
|
|
78
|
-
- Workflow needs access to existing data in Airtable
|
|
79
|
-
|
|
80
|
-
Pitfalls:
|
|
81
|
-
- Requires Airtable account and API key
|
|
82
|
-
- Schema changes require careful planning
|
|
83
|
-
|
|
84
|
-
## Storage Patterns
|
|
85
|
-
|
|
86
|
-
### Immediate Storage Pattern
|
|
87
|
-
|
|
88
|
-
Store data immediately after collection or generation:
|
|
89
|
-
|
|
90
|
-
\`\`\`mermaid
|
|
91
|
-
flowchart LR
|
|
92
|
-
Trigger --> Process_Data["Process Data"]
|
|
93
|
-
Process_Data --> Storage_Node["Storage Node"]
|
|
94
|
-
Storage_Node --> Continue_Workflow["Continue Workflow"]
|
|
95
|
-
\`\`\`
|
|
96
|
-
|
|
97
|
-
Best for: Raw data preservation, audit trails, form submissions
|
|
98
|
-
|
|
99
|
-
### Batch Storage Pattern
|
|
100
|
-
|
|
101
|
-
Collect multiple items and store them together:
|
|
102
|
-
|
|
103
|
-
\`\`\`mermaid
|
|
104
|
-
flowchart LR
|
|
105
|
-
Trigger --> Loop_Split["Loop/Split"]
|
|
106
|
-
Loop_Split --> Process["Process"]
|
|
107
|
-
Process --> Aggregate["Aggregate"]
|
|
108
|
-
Aggregate --> Storage_Node["Storage Node"]
|
|
109
|
-
\`\`\`
|
|
110
|
-
|
|
111
|
-
Best for: Processing lists, batch operations, scheduled aggregations
|
|
112
|
-
|
|
113
|
-
### Update Pattern
|
|
114
|
-
|
|
115
|
-
Retrieve, modify, and update existing records:
|
|
116
|
-
|
|
117
|
-
\`\`\`mermaid
|
|
118
|
-
flowchart LR
|
|
119
|
-
Trigger --> Retrieve["Retrieve from Storage"]
|
|
120
|
-
Retrieve --> Modify["Modify"]
|
|
121
|
-
Modify --> Update_Storage["Update Storage Node"]
|
|
122
|
-
\`\`\`
|
|
123
|
-
|
|
124
|
-
Best for: Maintaining state, updating records, tracking changes
|
|
125
|
-
|
|
126
|
-
### Lookup Pattern
|
|
127
|
-
|
|
128
|
-
Query storage to retrieve specific records:
|
|
129
|
-
|
|
130
|
-
\`\`\`mermaid
|
|
131
|
-
flowchart LR
|
|
132
|
-
Trigger --> Query_Storage["Query Storage Node"]
|
|
133
|
-
Query_Storage --> Use_Data["Use Retrieved Data"]
|
|
134
|
-
Use_Data --> Continue_Workflow["Continue Workflow"]
|
|
135
|
-
\`\`\`
|
|
136
|
-
|
|
137
|
-
Best for: Enrichment, validation, conditional logic based on stored data
|
|
138
|
-
|
|
139
|
-
## Key Considerations
|
|
140
|
-
|
|
141
|
-
### Data Structure
|
|
142
|
-
|
|
143
|
-
- **Plan your schema ahead:** Define what fields you need before creating storage
|
|
144
|
-
- **Use consistent field names:** Match field names across your workflow for easy mapping
|
|
145
|
-
- **Consider data types:** Ensure your storage supports the data types you need
|
|
146
|
-
- **Think about relationships:** If data is related, consider Airtable or use multiple tables
|
|
147
|
-
|
|
148
|
-
### Performance
|
|
149
|
-
|
|
150
|
-
- **Batch operations when possible:** Multiple small writes are slower than batch operations
|
|
151
|
-
- **Use appropriate operations:** Use "append" for new records, "update" for modifications
|
|
152
|
-
- **Consider API limits:** Google Sheets has rate limits; plan accordingly for high-volume workflows
|
|
153
|
-
|
|
154
|
-
### Data Integrity
|
|
155
|
-
|
|
156
|
-
- **Store raw data first:** Keep unmodified input before transformations
|
|
157
|
-
- **Handle errors gracefully:** Use error handling to prevent data loss on failures
|
|
158
|
-
- **Validate before storing:** Ensure data quality before persistence
|
|
159
|
-
- **Avoid duplicates:** Use unique identifiers or upsert operations when appropriate
|
|
160
|
-
|
|
161
|
-
## Referencing Documents, Sheets, or Tables
|
|
162
|
-
|
|
163
|
-
When configuring storage nodes, use ResourceLocator mode "list". This will allow users to select from existing documents, sheets, or tables rather than passing IDs dynamically.
|
|
164
|
-
Use modes "id", "url" or "name" only when user specifically mentions it in their prompt.
|
|
165
|
-
|
|
166
|
-
## Important Distinctions
|
|
167
|
-
|
|
168
|
-
### Storage vs. Transformation
|
|
169
|
-
|
|
170
|
-
- **Set/Merge nodes are NOT storage:** They transform data in memory only
|
|
171
|
-
- **Storage happens explicitly:** Data won't persist unless you explicitly write it to storage
|
|
172
|
-
|
|
173
|
-
### Temporary vs. Persistent Storage
|
|
174
|
-
|
|
175
|
-
- **NOT covered by this technique:** Redis, caching, session storage, in-memory operations
|
|
176
|
-
- **This technique covers:** Durable storage that persists beyond workflow execution
|
|
177
|
-
- **Focus on permanence:** Use these nodes when you need data to survive restarts and be queryable later
|
|
178
|
-
|
|
179
|
-
## Common Pitfalls to Avoid
|
|
180
|
-
|
|
181
|
-
### Not Handling Duplicates
|
|
182
|
-
|
|
183
|
-
Without proper unique identifiers or upsert logic, you may create duplicate records. Use unique IDs or check for existing records before inserting.
|
|
184
|
-
|
|
185
|
-
### Ignoring Storage Limits
|
|
186
|
-
|
|
187
|
-
Each storage system has limits (row counts, API rates, file sizes). Design your workflow to work within these constraints or implement pagination/batching.
|
|
188
|
-
|
|
189
|
-
### Not Handling Empty Query Results
|
|
190
|
-
|
|
191
|
-
Data Tables and other storage nodes return 0 items when:
|
|
192
|
-
- The table is freshly created and has no rows yet
|
|
193
|
-
- A filter/lookup query matches nothing
|
|
194
|
-
|
|
195
|
-
This silently breaks the downstream chain — all nodes after the empty result are skipped. Always set \`alwaysOutputData: true\` on data-fetching nodes (operation: 'get') when downstream nodes depend on their output.
|
|
196
|
-
`;
|
|
197
|
-
}
|
|
198
|
-
//# sourceMappingURL=data-persistence.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-persistence.js","sourceRoot":"","sources":["../../../../src/tools/best-practices/guides/data-persistence.ts"],"names":[],"mappings":";;AAAA,4CAiMC;AAjMD,SAAgB,gBAAgB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+LP,CAAC;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getDocumentation(): string;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDocumentation = getDocumentation;
|
|
4
|
-
function getDocumentation() {
|
|
5
|
-
return `# Best Practices: Data Transformation
|
|
6
|
-
|
|
7
|
-
## Workflow Design
|
|
8
|
-
|
|
9
|
-
### Core Principles
|
|
10
|
-
- **Structure**: Always follow Input -> Transform -> Output pattern
|
|
11
|
-
- **Optimization**: Filter and reduce data early to improve performance
|
|
12
|
-
|
|
13
|
-
### Design Best Practices
|
|
14
|
-
- Plan transformation requirements in plain language before building
|
|
15
|
-
- Use Modular Design: Create reusable sub-workflows for common tasks like "Data Cleaning" or "Error Handler"
|
|
16
|
-
- Batch datasets over 100 items using Split In Batches node to prevent timeouts
|
|
17
|
-
|
|
18
|
-
## Recommended Nodes
|
|
19
|
-
|
|
20
|
-
### Essential Transformation Nodes
|
|
21
|
-
|
|
22
|
-
#### Edit Fields (Set) (n8n-nodes-base.set)
|
|
23
|
-
|
|
24
|
-
**Purpose**: Create, modify, rename fields; change data types
|
|
25
|
-
|
|
26
|
-
**Key Setting**: "Keep Only Set" - drops all fields not explicitly defined (default: disabled)
|
|
27
|
-
|
|
28
|
-
**Use Cases**:
|
|
29
|
-
- Extract specific columns
|
|
30
|
-
- Add calculated fields
|
|
31
|
-
- Convert data types (string to number)
|
|
32
|
-
- Format dates using expressions
|
|
33
|
-
|
|
34
|
-
**Pitfalls**:
|
|
35
|
-
- Not understanding "Keep Only Set" behavior can lead to data loss
|
|
36
|
-
- Enabled: Drops all fields not explicitly defined (data loss risk)
|
|
37
|
-
- Disabled: Carries forward all fields (potential bloat)
|
|
38
|
-
- Always verify output structure after configuration
|
|
39
|
-
|
|
40
|
-
**Testing tip**: When transforming data from a workflow trigger, you can set values with a fallback default e.g. set name to {{$json.name || 'Jane Doe'}} to help test the workflow.
|
|
41
|
-
|
|
42
|
-
#### IF/Filter Nodes
|
|
43
|
-
|
|
44
|
-
**IF Node** (n8n-nodes-base.if):
|
|
45
|
-
- **Purpose**: Conditional processing and routing
|
|
46
|
-
- **Best Practice**: Use early to validate inputs and remove bad data
|
|
47
|
-
- **Example**: Check if required fields exist before processing
|
|
48
|
-
|
|
49
|
-
**Filter Node** (n8n-nodes-base.filter):
|
|
50
|
-
- **Purpose**: Filter items based on conditions
|
|
51
|
-
- **Best Practice**: Use early in workflow to reduce data volume
|
|
52
|
-
|
|
53
|
-
#### Merge Node (n8n-nodes-base.merge)
|
|
54
|
-
|
|
55
|
-
**Purpose**: Combine two data streams
|
|
56
|
-
|
|
57
|
-
**Modes**:
|
|
58
|
-
- Merge by Key (like database join)
|
|
59
|
-
- Merge by Index
|
|
60
|
-
- Append
|
|
61
|
-
|
|
62
|
-
**Pitfalls**:
|
|
63
|
-
- **Missing Keys**: Trying to merge on non-existent fields
|
|
64
|
-
- **Field Name Mismatch**: Different field names in sources
|
|
65
|
-
- **Solution**: Use Edit Fields node to normalize field names before merging
|
|
66
|
-
|
|
67
|
-
#### Code Node (n8n-nodes-base.code)
|
|
68
|
-
|
|
69
|
-
**Execution Modes**:
|
|
70
|
-
- "Run Once per Item": Process each item independently
|
|
71
|
-
- "Run Once for All Items": Access entire dataset (for aggregation)
|
|
72
|
-
|
|
73
|
-
**Return Format**: Must return array of objects with json property
|
|
74
|
-
\`\`\`javascript
|
|
75
|
-
return items; // or return [{ json: {...} }];
|
|
76
|
-
\`\`\`
|
|
77
|
-
|
|
78
|
-
**Pitfalls**:
|
|
79
|
-
- Wrong return format: Not returning array of objects with json property
|
|
80
|
-
- Overly complex: Stuffing entire workflow logic in one Code node
|
|
81
|
-
- Keep code nodes focused on single transformation aspect
|
|
82
|
-
|
|
83
|
-
#### Summarize Node (n8n-nodes-base.summarize)
|
|
84
|
-
|
|
85
|
-
**Purpose**: Pivot table-style aggregations (count, sum, average, min/max)
|
|
86
|
-
|
|
87
|
-
**Configuration**:
|
|
88
|
-
- Fields to Summarize: Choose aggregation function
|
|
89
|
-
- Fields to Split By: Grouping keys
|
|
90
|
-
|
|
91
|
-
**Output**: Single item with summary or multiple items per group
|
|
92
|
-
|
|
93
|
-
### Data Restructuring Nodes
|
|
94
|
-
|
|
95
|
-
- **Split Out** (n8n-nodes-base.splitOut): Convert single item with array into multiple items
|
|
96
|
-
- **Aggregate** (n8n-nodes-base.aggregate): Combine multiple items into one
|
|
97
|
-
- **Remove Duplicates** (n8n-nodes-base.removeDuplicates): Delete duplicate items based on field criteria
|
|
98
|
-
- **Sort** (n8n-nodes-base.sort): Order items alphabetically/numerically
|
|
99
|
-
- **Limit** (n8n-nodes-base.limit): Trim to maximum number of items
|
|
100
|
-
|
|
101
|
-
### Batch Processing
|
|
102
|
-
|
|
103
|
-
**Split In Batches** (n8n-nodes-base.splitInBatches):
|
|
104
|
-
- **Purpose**: Process large datasets in chunks
|
|
105
|
-
- **Use When**: Handling 100+ items with expensive operations (API calls, AI)
|
|
106
|
-
|
|
107
|
-
## Input Data Validation
|
|
108
|
-
- Validate external data before processing: check for nulls, empty values, and edge cases (special chars, empty arrays)
|
|
109
|
-
|
|
110
|
-
## Common Pitfalls to Avoid
|
|
111
|
-
|
|
112
|
-
### Critical Mistakes
|
|
113
|
-
|
|
114
|
-
#### Edit Fields Node Issues
|
|
115
|
-
- **Mistake**: Not understanding "Keep Only Set" behavior
|
|
116
|
-
- Enabled: Drops all fields not explicitly defined (data loss risk)
|
|
117
|
-
- Disabled: Carries forward all fields (potential bloat)
|
|
118
|
-
- **Solution**: Always verify output structure after configuration
|
|
119
|
-
|
|
120
|
-
#### Code Node Errors
|
|
121
|
-
- **Wrong Return Format**: Not returning array of objects with json property
|
|
122
|
-
- **Fix**: Always return \`items\` or \`[{ json: {...} }]\`
|
|
123
|
-
- **Overly Complex**: Stuffing entire workflow logic in one Code node
|
|
124
|
-
- **Fix**: Keep code nodes focused on single transformation aspect
|
|
125
|
-
|
|
126
|
-
#### Merge Node Problems
|
|
127
|
-
- **Field Name Mismatch**: Different field names in sources
|
|
128
|
-
- **Fix**: Normalize field names with Edit Fields before merging
|
|
129
|
-
|
|
130
|
-
### Performance Pitfalls
|
|
131
|
-
- Processing large datasets without batching -> timeouts
|
|
132
|
-
- Not filtering early -> unnecessary processing overhead
|
|
133
|
-
- Excessive node chaining -> visual clutter and slow execution
|
|
134
|
-
|
|
135
|
-
### Data Validation Pitfalls
|
|
136
|
-
- Assuming input data is always perfect -> runtime errors
|
|
137
|
-
`;
|
|
138
|
-
}
|
|
139
|
-
//# sourceMappingURL=data-transformation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-transformation.js","sourceRoot":"","sources":["../../../../src/tools/best-practices/guides/data-transformation.ts"],"names":[],"mappings":";;AAAA,4CAsIC;AAtID,SAAgB,gBAAgB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoIP,CAAC;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getDocumentation(): string;
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDocumentation = getDocumentation;
|
|
4
|
-
function getDocumentation() {
|
|
5
|
-
return `# Best Practices: Document Processing Workflows
|
|
6
|
-
|
|
7
|
-
## Workflow Design
|
|
8
|
-
|
|
9
|
-
Document processing workflows extract and act on content from files like PDFs, images, Word documents, and spreadsheets. Design your workflow following these core patterns:
|
|
10
|
-
|
|
11
|
-
### Core Architecture Pattern
|
|
12
|
-
Trigger -> Capture Binary -> Extract Text -> Parse/Transform -> Route to Destination -> Notify
|
|
13
|
-
|
|
14
|
-
### Common Flow Patterns
|
|
15
|
-
|
|
16
|
-
**Simple Document Processing:**
|
|
17
|
-
- Gmail Trigger -> Check file type -> Extract from File -> DataTable -> Slack notification
|
|
18
|
-
- Best for: Basic text-based PDFs with straightforward data extraction
|
|
19
|
-
|
|
20
|
-
**Complex Document Processing with AI:**
|
|
21
|
-
- Webhook -> File Type Check -> OCR (if image) -> AI Extract -> Validate -> CRM Update -> Multiple notifications
|
|
22
|
-
- Best for: Varied document formats requiring intelligent parsing
|
|
23
|
-
|
|
24
|
-
**Batch Document Processing:**
|
|
25
|
-
- Main workflow: Schedule Trigger -> Fetch Files -> Split In Batches -> Sub-workflow -> Merge Results -> Bulk Update
|
|
26
|
-
- Sub-workflow When Executed by Another Workflow -> Process result
|
|
27
|
-
- Best for: High-volume processing with API rate limits
|
|
28
|
-
|
|
29
|
-
**Multi-Source Document Aggregation:**
|
|
30
|
-
- Multiple Triggers (Email + Drive + Webhook) -> Set common fields -> Standardize -> Process -> Store
|
|
31
|
-
- Best for: Documents from various channels needing unified processing
|
|
32
|
-
|
|
33
|
-
### Branching Strategy
|
|
34
|
-
|
|
35
|
-
Always branch early based on document characteristics:
|
|
36
|
-
- **File Type Branching**: Use IF/Switch nodes immediately after ingestion to route PDFs vs images vs spreadsheets
|
|
37
|
-
- **Provider Branching**: Route documents to provider-specific processing (e.g., different invoice formats)
|
|
38
|
-
- **Quality Branching**: Separate high-confidence extractions from those needing manual review
|
|
39
|
-
|
|
40
|
-
## Binary Data Management
|
|
41
|
-
Documents in n8n are handled as binary data that must be carefully preserved throughout the workflow.
|
|
42
|
-
|
|
43
|
-
### Referencing Binary Data from Other Nodes
|
|
44
|
-
When you need to reference binary data from a previous node, use this syntax:
|
|
45
|
-
- Expression: '{{ $('Node Name').item.binary.property_name }}' or {{ $binary.property_name }} if previous item
|
|
46
|
-
- Example for Gmail attachments: '{{ $('Gmail Trigger').item.binary.attachment_0 }}' or {{ $binary.attachment_0 }} if previous item
|
|
47
|
-
- Example for webhook data: '{{ $('Webhook').item.binary.data }}' or {{ $binary.data }} if previous item
|
|
48
|
-
- Important: The property name depends on how the previous node names the binary data
|
|
49
|
-
|
|
50
|
-
### Preserving Binary Data
|
|
51
|
-
- Many nodes (Code, Edit Fields, AI nodes) output JSON and drop binary data by default
|
|
52
|
-
- Use parallel branches: one for processing, one to preserve the original file
|
|
53
|
-
- Rejoin branches with Merge node in pass-through mode
|
|
54
|
-
- Alternative: Configure nodes to keep binary (e.g., Edit field node's "Include Other Input Fields" option ON)
|
|
55
|
-
|
|
56
|
-
### Memory Optimization
|
|
57
|
-
For high-volume processing:
|
|
58
|
-
- Process files sequentially or in small batches
|
|
59
|
-
- Drop unnecessary binary data after extraction to free memory
|
|
60
|
-
|
|
61
|
-
### File Metadata
|
|
62
|
-
Documents uploaded via a form trigger will have various bits of metadata available - filename, mimetype and size.
|
|
63
|
-
These are accessible using an expression like {{ $json.documents[0].mimetype }} to access each of the document's details.
|
|
64
|
-
Multiple files can be uploaded to a form which is the reason for the documents array.
|
|
65
|
-
|
|
66
|
-
## Text Extraction Strategy
|
|
67
|
-
|
|
68
|
-
Choose extraction method based on document type and content:
|
|
69
|
-
|
|
70
|
-
### Critical: File Type Detection
|
|
71
|
-
**ALWAYS check the file type before using Extract from File node** (unless the file type is already known):
|
|
72
|
-
- Use IF node to check file extension or MIME type first
|
|
73
|
-
- The Extract from File node has multiple operations, each for a specific file type:
|
|
74
|
-
- "Extract from PDF" for PDF files
|
|
75
|
-
- "Extract from MS Excel" for Excel files (.xlsx, .xls)
|
|
76
|
-
- "Extract from MS Word" for Word documents (.docx, .doc)
|
|
77
|
-
- "Extract from CSV" for CSV files
|
|
78
|
-
- "Extract from HTML" for HTML files
|
|
79
|
-
- "Extract from RTF" for Rich Text Format files
|
|
80
|
-
- "Extract from Text File" for plain text files
|
|
81
|
-
- Using the wrong operation will result in errors or empty output
|
|
82
|
-
|
|
83
|
-
### Decision Tree for Extraction
|
|
84
|
-
1. **Check file type** -> Route to appropriate extraction method
|
|
85
|
-
2. **Scanned image/PDF?** -> Use OCR service (OCR.space, AWS Textract, Google Vision)
|
|
86
|
-
3. **Structured invoice/receipt?** -> Use specialized parser (Mindee) or AI extraction
|
|
87
|
-
4. **Text-based document?** -> Use Extract from File with the correct operation for that file type
|
|
88
|
-
|
|
89
|
-
### Fallback Strategy
|
|
90
|
-
Always implement fallback for extraction failures:
|
|
91
|
-
- Check if text extraction returns empty
|
|
92
|
-
- If empty, automatically route to OCR
|
|
93
|
-
- If OCR fails, send to manual review queue
|
|
94
|
-
|
|
95
|
-
## Data Parsing & Classification
|
|
96
|
-
|
|
97
|
-
### AI-Powered Extraction Pattern
|
|
98
|
-
For varied or complex documents:
|
|
99
|
-
|
|
100
|
-
Option 1 - Using Document Loader (Recommended for binary files):
|
|
101
|
-
1. Pass binary data directly to Document Loader node (set Data Source to "Binary")
|
|
102
|
-
2. Connect to AI Agent or LLM Chain for processing
|
|
103
|
-
3. Validate extracted fields before processing
|
|
104
|
-
|
|
105
|
-
Option 2 - Using text extraction:
|
|
106
|
-
1. Extract raw text using Extract from File or OCR
|
|
107
|
-
2. Pass to AI Agent or LLM Chain with structured prompt
|
|
108
|
-
3. Validate extracted fields before processing
|
|
109
|
-
|
|
110
|
-
Example system prompt structure:
|
|
111
|
-
"Extract the following fields from the document: [field list]. Return as JSON with this schema: [schema example]"
|
|
112
|
-
|
|
113
|
-
### Document Classification Flow
|
|
114
|
-
Classify before processing for better accuracy:
|
|
115
|
-
1. Initial AI classification (Invoice vs Receipt vs Contract)
|
|
116
|
-
2. Route to specialized sub-workflow based on type
|
|
117
|
-
3. Use type-specific prompts and validation rules
|
|
118
|
-
4. This reduces errors and improves extraction quality
|
|
119
|
-
|
|
120
|
-
## Error Handling Strategy
|
|
121
|
-
|
|
122
|
-
Build resilience at every step:
|
|
123
|
-
|
|
124
|
-
### Validation Checkpoints
|
|
125
|
-
- After extraction: Verify text not empty
|
|
126
|
-
- After AI parsing: Validate JSON schema
|
|
127
|
-
- Before database insert: Check required fields
|
|
128
|
-
- After API calls: Verify success response
|
|
129
|
-
|
|
130
|
-
## Performance Optimization
|
|
131
|
-
|
|
132
|
-
### Batch Processing Strategy
|
|
133
|
-
- Use Split In Batches node: process 5-10 files at a time
|
|
134
|
-
- Implement delays between batches for rate-limited APIs
|
|
135
|
-
- Monitor memory usage and adjust batch size accordingly
|
|
136
|
-
|
|
137
|
-
## Recommended Nodes
|
|
138
|
-
|
|
139
|
-
### Triggers & Input
|
|
140
|
-
|
|
141
|
-
**Gmail Trigger (n8n-nodes-base.gmailTrigger)**
|
|
142
|
-
Purpose: Monitor Gmail for emails with attachments (Recommended over IMAP)
|
|
143
|
-
Advantages: Real-time processing, simpler authentication, better integration with Google Workspace
|
|
144
|
-
Critical Configuration for Attachments:
|
|
145
|
-
- **MUST set "Simplify" to FALSE** - otherwise attachments won't be available
|
|
146
|
-
- **MUST set "Download Attachments" to TRUE** to retrieve files
|
|
147
|
-
- Set appropriate label filters
|
|
148
|
-
- Set "Property Prefix Name" (e.g., "attachment_") - attachments will be named with this prefix plus index
|
|
149
|
-
- Important: When referencing its binary data, it will be referenced "attachment_0", "attachment_1", etc., NOT "data"
|
|
150
|
-
|
|
151
|
-
**Email Read (IMAP) (n8n-nodes-base.emailReadImap)**
|
|
152
|
-
Purpose: Alternative email fetching if there's no specialized node for email provider
|
|
153
|
-
Configuration:
|
|
154
|
-
- Enable "Download Attachments" to retrieve files
|
|
155
|
-
- Set "Property Prefix Name" (e.g., "attachment_") - attachments will be named with this prefix plus index
|
|
156
|
-
- Important: When referencing binary data, it will be referenced "attachment_0", "attachment_1", etc., NOT "data"
|
|
157
|
-
|
|
158
|
-
**HTTP Webhook (n8n-nodes-base.webhook)**
|
|
159
|
-
Purpose: Receive file uploads from web forms
|
|
160
|
-
Configuration: Enable "Raw Body" for binary data
|
|
161
|
-
|
|
162
|
-
**Google Drive Trigger (n8n-nodes-base.googleDriveTrigger)**
|
|
163
|
-
Purpose: Monitor folders for new documents
|
|
164
|
-
Configuration: Set appropriate folder and file type filters
|
|
165
|
-
|
|
166
|
-
### Text Extraction
|
|
167
|
-
|
|
168
|
-
**Extract from File (n8n-nodes-base.extractFromFile)**
|
|
169
|
-
Purpose: Extract text from various file formats using format-specific operations
|
|
170
|
-
Critical: ALWAYS check file type first with an IF or Switch before and select the correct operation (Extract from PDF, Extract from MS Excel, etc.)
|
|
171
|
-
Critical: If the user requests handling of multiple file types (PDF, CSV, JSON, etc) then a Switch (n8n-nodes-base.switch) node should be used
|
|
172
|
-
to check the file type before text extraction. Multiple text extraction nodes should be used to handle each of the different file types. For example,
|
|
173
|
-
if the workflow contains a form trigger node which receives a file, then a Switch node MUST be used to split the different options out to different extraction nodes.
|
|
174
|
-
Output: Extracted text is returned under the "text" key in JSON (e.g., access with {{ $json.text }})
|
|
175
|
-
Pitfalls:
|
|
176
|
-
- Returns empty for scanned documents - always check and fallback to OCR; Using wrong operation causes errors
|
|
177
|
-
- If connecting to a document upload form (n8n-nodes-base.formTrigger) use a File field type and then connect it to the extract from file node using the field name.
|
|
178
|
-
For example if creating a form trigger with field "Upload Document" then set the extract from file input binary field to "Upload_Document"
|
|
179
|
-
|
|
180
|
-
**AWS Textract (n8n-nodes-base.awsTextract)**
|
|
181
|
-
Purpose: Advanced OCR with table and form detection
|
|
182
|
-
Best for: Structured documents like invoices and forms
|
|
183
|
-
|
|
184
|
-
**Mindee (n8n-nodes-base.mindee)**
|
|
185
|
-
Purpose: Specialized invoice and receipt parsing
|
|
186
|
-
Returns: Structured JSON with line items, totals, dates
|
|
187
|
-
|
|
188
|
-
### Data Processing
|
|
189
|
-
|
|
190
|
-
**AI Agent (@n8n/n8n-nodes-langchain.agent)**
|
|
191
|
-
Purpose: Intelligent document parsing and decision making
|
|
192
|
-
Configuration: Include structured output tools for consistent results
|
|
193
|
-
|
|
194
|
-
**LLM Chain (@n8n/n8n-nodes-langchain.chainLlm)**
|
|
195
|
-
Purpose: Document classification and data extraction
|
|
196
|
-
|
|
197
|
-
**Document Loader (@n8n/n8n-nodes-langchain.documentLoader)**
|
|
198
|
-
Purpose: Load and process documents directly from binary data for AI processing
|
|
199
|
-
Critical: Use the "Binary" data source option to handle binary files directly - no need to convert to JSON first
|
|
200
|
-
Configuration: Select "Binary" as Data Source, specify the binary property name (by default data unless renamed in a previous node)
|
|
201
|
-
Best for: Direct document processing in AI workflows without intermediate extraction steps
|
|
202
|
-
|
|
203
|
-
**Structured Output Parser (@n8n/n8n-nodes-langchain.outputParserStructured)**
|
|
204
|
-
Purpose: Ensure AI outputs match expected JSON schema
|
|
205
|
-
Critical for: Database inserts and API calls
|
|
206
|
-
|
|
207
|
-
### Vector Storage (for RAG/Semantic Search)
|
|
208
|
-
**Simple Vector Store (@n8n/n8n-nodes-langchain.vectorStore) - RECOMMENDED**
|
|
209
|
-
Purpose: Easy-to-setup vector storage for document embeddings
|
|
210
|
-
Advantages:
|
|
211
|
-
- No external dependencies or API keys required
|
|
212
|
-
- Works out of the box with local storage
|
|
213
|
-
- Perfect for prototyping and small to medium datasets
|
|
214
|
-
Configuration: Just connect and use - no complex setup needed
|
|
215
|
-
Best for: Most document processing workflows that need semantic search
|
|
216
|
-
|
|
217
|
-
### Flow Control
|
|
218
|
-
|
|
219
|
-
**Split In Batches (n8n-nodes-base.splitInBatches)**
|
|
220
|
-
Purpose: Process multiple documents in controlled batches
|
|
221
|
-
Configuration: Set batch size based on API limits and memory
|
|
222
|
-
Outputs (in order):
|
|
223
|
-
- Output 0 "done": Executes after all batches are processed - use for final aggregation or notifications
|
|
224
|
-
- Output 1 "loop": Connect processing nodes here - executes for each batch
|
|
225
|
-
Important: Connect processing logic to the second output (loop), completion logic to the first output (done)
|
|
226
|
-
|
|
227
|
-
**Merge (n8n-nodes-base.merge)**
|
|
228
|
-
Purpose: Combine data from multiple branches that need to execute together
|
|
229
|
-
Critical: Merge node waits for ALL input branches to complete - do NOT use for independent/optional branches
|
|
230
|
-
Modes: Use "Pass Through" to preserve binary from one branch
|
|
231
|
-
|
|
232
|
-
**Edit Fields (Set) (n8n-nodes-base.set)**
|
|
233
|
-
Purpose: Better choice for combining data from separate/independent branches
|
|
234
|
-
Use for: Adding fields from different sources, preserving binary while adding processed data
|
|
235
|
-
Configuration: Set common fields and use "Include Other Input Fields" ON to preserve existing data including binary
|
|
236
|
-
|
|
237
|
-
**Execute Workflow Trigger (n8n-nodes-base.executeWorkflowTrigger)**
|
|
238
|
-
Purpose: Start point for sub-workflows that are called by other workflows
|
|
239
|
-
Configuration: Automatically receives data from the calling workflow including binary data
|
|
240
|
-
Best practice: Use for modular workflow design, heavy processing tasks, or reusable workflow components
|
|
241
|
-
Pairing: Must be used with Execute Workflow node in the parent workflow
|
|
242
|
-
|
|
243
|
-
**Execute Workflow (n8n-nodes-base.executeWorkflow)**
|
|
244
|
-
Purpose: Call and execute another workflow from within the current workflow
|
|
245
|
-
Critical configurations:
|
|
246
|
-
- Workflow ID: Use expression "{{ $workflow.id }}" to reference sub-workflows in the same workflow
|
|
247
|
-
- Choose execution mode: "Run Once for All Items" or "Run Once for Each Item"
|
|
248
|
-
- Binary data is automatically passed to the sub-workflow
|
|
249
|
-
Best practice: Use for delegating heavy processing, creating reusable modules, or managing memory in large batch operations
|
|
250
|
-
|
|
251
|
-
### Data Destinations
|
|
252
|
-
|
|
253
|
-
**DataTable (n8n-nodes-base.dataTable)**
|
|
254
|
-
Purpose: Store extracted data in n8n's built-in data tables
|
|
255
|
-
Operations: Insert, Update, Select rows without external dependencies
|
|
256
|
-
Best for: Self-contained workflows that don't require external storage
|
|
257
|
-
|
|
258
|
-
**Google Sheets (n8n-nodes-base.googleSheets)**
|
|
259
|
-
Purpose: Log extracted data in external spreadsheet
|
|
260
|
-
Operations: Use "Append" for new rows, "Update" with key column for existing
|
|
261
|
-
Best for: Collaborative review and manual data validation
|
|
262
|
-
|
|
263
|
-
**Database Nodes**
|
|
264
|
-
- Postgres (n8n-nodes-base.postgres)
|
|
265
|
-
- MySQL (n8n-nodes-base.mySql)
|
|
266
|
-
- MongoDB (n8n-nodes-base.mongoDb)
|
|
267
|
-
Purpose: Store structured extraction results in production databases
|
|
268
|
-
Best Practice: Validate data schema before insert
|
|
269
|
-
|
|
270
|
-
### Utilities
|
|
271
|
-
|
|
272
|
-
**IF/Switch (n8n-nodes-base.if, n8n-nodes-base.switch)**
|
|
273
|
-
Purpose: Route based on file type, extraction quality, or classification
|
|
274
|
-
|
|
275
|
-
**Function/Code (n8n-nodes-base.function, n8n-nodes-base.code)**
|
|
276
|
-
Purpose: Custom validation, data transformation, or regex extraction
|
|
277
|
-
|
|
278
|
-
**HTTP Request (n8n-nodes-base.httpRequest)**
|
|
279
|
-
Purpose: Call external OCR APIs (OCR.space, Google Vision, Mistral OCR)
|
|
280
|
-
Configuration: Set "Response Format: File" for downloads
|
|
281
|
-
Critical: NEVER set API keys directly in the request - user can set credentials from the UI for secure API key management
|
|
282
|
-
|
|
283
|
-
## Common Pitfalls to Avoid
|
|
284
|
-
|
|
285
|
-
### Binary Data Loss
|
|
286
|
-
|
|
287
|
-
**Problem**: Binary file "disappears" after processing nodes
|
|
288
|
-
**Solution**:
|
|
289
|
-
- Use Merge node to reattach binary after processing
|
|
290
|
-
- Or configure nodes to explicitly keep binary data
|
|
291
|
-
- In Code nodes: copy items[0].binary to output
|
|
292
|
-
|
|
293
|
-
### Incorrect OCR Fallback
|
|
294
|
-
|
|
295
|
-
**Problem**: Not detecting when text extraction fails
|
|
296
|
-
**Solution**:
|
|
297
|
-
- Always check if extraction result is empty
|
|
298
|
-
- Implement automatic OCR fallback for scanned documents
|
|
299
|
-
- Don't assume all PDFs have extractable text
|
|
300
|
-
|
|
301
|
-
### API Format Mismatches
|
|
302
|
-
|
|
303
|
-
**Problem**: Sending files in wrong format to APIs
|
|
304
|
-
**Solution**:
|
|
305
|
-
- Check if API needs multipart/form-data vs Base64
|
|
306
|
-
- Use "Extract from File" and "Convert to File" format conversion
|
|
307
|
-
|
|
308
|
-
### Memory Overload
|
|
309
|
-
|
|
310
|
-
**Problem**: Workflow crashes with large or multiple files
|
|
311
|
-
**Solution**:
|
|
312
|
-
- Process files sequentially or in small batches
|
|
313
|
-
- Enable filesystem mode for binary data storage
|
|
314
|
-
- Drop unnecessary data after extraction
|
|
315
|
-
- Create a sub-workflow in the same workflow using "When Executed by Another Workflow" and "Execute Workflow". Delegate the heavy part of the workflow to the sub-workflow.
|
|
316
|
-
|
|
317
|
-
### Duplicate Processing
|
|
318
|
-
|
|
319
|
-
**Problem**: Same documents processed repeatedly
|
|
320
|
-
**Solution**:
|
|
321
|
-
- Configure email triggers to mark as read
|
|
322
|
-
- Use "unseen" filters for email fetching
|
|
323
|
-
- Implement deduplication logic based on file hash or name
|
|
324
|
-
`;
|
|
325
|
-
}
|
|
326
|
-
//# sourceMappingURL=document-processing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"document-processing.js","sourceRoot":"","sources":["../../../../src/tools/best-practices/guides/document-processing.ts"],"names":[],"mappings":";;AAAA,4CAiUC;AAjUD,SAAgB,gBAAgB;IAC/B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+TP,CAAC;AACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getDocumentation(): string;
|