Lune Logo

© 2025 Lune Inc.
All rights reserved.

support@lune.dev

Want to use over 200+ MCP servers inside your coding tools like Cursor?

Asked 5 months ago by OrbitalEnvoy819

Why is the n8n AI Agent Processing Small Data Sets So Slowly?

The post content has been automatically edited by the Moderator Agent for consistency and clarity.

I am using the AI Agent in n8n to analyze and categorize error data, but the processing is much slower than expected. For a dataset of only 5-10 entries, execution sometimes exceeds 2 minutes instead of the anticipated 20 seconds or less.

I tried adjusting various batch sizes, yet the performance remains an issue. Below is a fake dataset (not my real data) that represents my workflow:

Input:

JSON
[ { "title": "Printed Brochures", "data": [ { "id": "error-abc123", "job": "job-111111", "comment": "Brochures arrived with torn pages." }, { "id": "error-def456", "job": "job-222222", "comment": "Pages were printed in the wrong order." }, { "id": "error-ghi789", "job": "job-333333", "comment": "The brochure cover was printed in the wrong color." } ] }, { "title": "Flyers", "data": [ { "id": "error-jkl987", "job": "job-444444", "comment": "Flyers were misaligned during printing." }, { "id": "error-mno654", "job": "job-555555", "comment": "Flyers were cut incorrectly, leaving uneven edges." }, { "id": "error-pqr321", "job": "job-666666", "comment": "The wrong font was used in the printed text." } ] } ]

Output:

JSON
[ { "title": "Printed Brochures", "errors": [ { "errorType": "Physical Damage", "summary": "Brochures arrived with torn or damaged pages.", "job": ["job-111111"], "error": ["error-abc123"] }, { "errorType": "Print Order Issue", "summary": "Pages were printed in an incorrect sequence.", "job": ["job-222222"], "error": ["error-def456"] }, { "errorType": "Color Mismatch", "summary": "The cover was printed in the wrong color.", "job": ["job-333333"], "error": ["error-ghi789"] } ] }, { "title": "Flyers", "errors": [ { "errorType": "Print Alignment Issue", "summary": "Flyers were misaligned during the printing process.", "job": ["job-444444"], "error": ["error-jkl987"] }, { "errorType": "Cutting Issue", "summary": "Flyers were cut incorrectly, resulting in uneven edges.", "job": ["job-555555"], "error": ["error-mno654"] }, { "errorType": "Font Error", "summary": "Incorrect font was used in the printed text.", "job": ["job-666666"], "error": ["error-pqr321"] } ] } ]

Prompt Used in the AI Agent Node in n8n

You are an advanced data analysis and error categorization AI. Your task is to process input data containing error details grouped by “title”. Each group contains multiple error objects. Your goal is to identify unique error types from the comment field, generate concise summaries for each error type, and include relevant job and error values for those errors.

Input Fields:

  • title: The product group title.
  • data: An array of objects with the following fields:
    • id: Unique identifier for the error.
    • job: ID of the job.
    • comment: Description of the issue.

Objective:

  • Group errors by title.
  • Analyze the comment field to identify unique error types.
  • Generate meaningful summaries for each error type without repeating the comments verbatim.
  • Include all relevant job and error values for each error type.

Output Format:

JSON
[ { "title": "ProductGroupTitle", "errors": [ { "errorType": "Error Type", "summary": "Detailed summary of the issue.", "job": ["RelevantJobId1", "RelevantJobId2"], "error": ["RelevantErrorId1", "RelevantErrorId2"] } ] } ]

Guidelines:

  • Extract and group data by title.
  • Identify error types from the comment field.
  • Write concise, non-redundant summaries for each error type.
  • Include only relevant job and error values for each error type.
  • Return a clean, well-structured JSON array without additional text.

Input for Analysis: {{ JSON.stringify($input.all()[0].json.data) }}

Screenshot 2025-01-29 at 10.11.56

Information on your n8n setup

  • n8n version: 1.63.4
  • Database (default: SQLite): cloud
  • n8n EXECUTIONS_PROCESS setting (default: own, main): cloud
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: cloud
1

Comments 0

Answers 0

Views 173

0 Answers

Discussion

No comments yet.