Using the item method doesn't work with pinned data in this scenario. Please unpin 'AI Agent' and try again

Describe the problem/error/question

Workflow throws an error after AI agent returns data (works if its just a single item) saying: Using the item method doesn’t work with pinned data in this scenario. Please unpin ‘AI Agent’ and try again.

No data has been pinned though. This error happened after adding an error workflow (Continue: using error output) so it seems that the error handling somehow breaks the item chain. If I switch it to just “Continue” on error it seems to work.

What is the error message (if any)?

Using the item method doesn’t work with pinned data in this scenario. Please unpin ‘AI Agent’ and try again.

Please share your workflow

This is a workflow on a self-hosted instance of n8n so unfortunately I cant share it at this point.

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

{
“nodes”: [
{
“parameters”: {
“promptType”: “define”,
“text”: “=REVIEW:\nProvider: {{ $json.title }}\nText: {{ $(‘Get Reviews’).item.json.review_text }}\nRating: {{ $(‘Get Reviews’).item.json.rating }}\nDate: {{ $(‘Get Reviews’).item.json.review_time }}\nReview ID: {{ $(‘Get Reviews’).item.json.id }}”,
“hasOutputParser”: true,
“options”: {
“systemMessage”: “prompt”,
“returnIntermediateSteps”: false
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.8,
“position”: [
420,
0
],
“id”: “ef631966-7728-4bf0-9ad2-6fa3a43f9d98”,
“name”: “AI Agent”,
“onError”: “continueErrorOutput”
}
],
“connections”: {
“AI Agent”: {
“main”: [
,

]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “a27f8ba846faf1ddc065af826c684e0fc52ec57ca2be7f43975923cd52744457”
}
}

Information on your n8n setup

  • **n8n version: 1.85.4
  • Database (default: SQLite): POSTGRES
  • n8n EXECUTIONS_PROCESS setting (default: own, main): not sure
  • Running n8n via (Docker, npm, n8n cloud, desktop app): not sure, its on railway.app

One thing you can do is to put a relevant part of the workflow under a Loop node control (with batch size 1).

Please repost your workflow json using the </> button. Do not remove triple backticks. They are required to render the workflow properly.

thanks! i fixed it for now by choosing (continue) for error handling and then adding an if node after filtering out errors. That seems to work and doesnt break the item chain. Which to me indicates that the separate error node seems to have a bug in that regard.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.