ReAct & Plan and Execute Agents contstantly outputting empty strings

Describe the problem/error/question

Guy’s I’m having a problem and I cannot figure it out. Both the Plan and Execute and ReAct agents fail to output a query to the tool call workflow. It passes an empty Json and I haven’t been able to get it to work correctly one single time.

I’ve tried several different workarounds including prompting the human message to output a json, using an output parser, but nothing seems to work.

I feel like I’m doing something simple wrong and I can’t figure it out.

What is the error message (if any)?

“No Prompt Specified”

Please share your workflow

Here is the Exec Director

{
  "name": "REV Exec Director",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        -700,
        360
      ],
      "id": "0fcef8e4-00a9-4b8e-b75f-3d32da1de972",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "gLFq2rOZDJvrkTu8",
          "name": "OpenAi account 2"
        }
      }
    },
    {
      "parameters": {
        "name": "communicationManager",
        "description": "=Call this tool whenever any action needs to be taken related to communication.The input should ALWAYS be stringified object which contains \"query\" property. As such:\n\n{\n  \"query\":\"Your output data here\"\n}\n\nThis could be brand communication via social media (dms, comments, etc), Calendar management, Whatsapp messages, Telegram Messages, Text Messages, making phone calls, or dealing with voicemails.\n\nThe communication manager is responsible for handling all types of communication.\n\n",
        "workflowId": {
          "__rl": true,
          "value": "DJgSfAF03iCOQvST",
          "mode": "list",
          "cachedResultName": "iSunny.ai — Communications Manager"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 1.3,
      "position": [
        -380,
        400
      ],
      "id": "c7e314c5-f24a-4f0c-8e9e-81b36e4f7695",
      "name": "Communication Manager",
      "notesInFlow": false
    },
    {
      "parameters": {
        "name": "projectManager",
        "description": "=Call this tool when anything related to project management needs to be done.\n\nMeetings, Projects, CRM Management, Documents Management, or anything within Notion.\n\nThe projects manager is responsible for handling all types of project management and data storage ONLY. \n",
        "workflowId": {
          "__rl": true,
          "value": "Oc4OpzN5Vk73xTFx",
          "mode": "list",
          "cachedResultName": "iSunny.ai — Project Manager"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 1.3,
      "position": [
        -200,
        400
      ],
      "id": "d047e87e-dc0f-4e21-933e-8262138f0a55",
      "name": "Project Manager"
    },
    {
      "parameters": {
        "name": "researchManager",
        "description": "Call this tool whenever any research needs to be completed related to the task in question.\n\nThe Research Manager is responsible for managing the following agents:\n\n- Travel Research Agent\n- General Research Agent",
        "workflowId": {
          "__rl": true,
          "value": "OOWOr1WCRbOHTA6g",
          "mode": "list",
          "cachedResultName": "iSunny.ai — Research Manager"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 1.3,
      "position": [
        -380,
        580
      ],
      "id": "a3ed25f4-cfaa-4f81-9a6f-2794874a4c8a",
      "name": "Research Manager",
      "disabled": true
    },
    {
      "parameters": {
        "name": "contentManager",
        "description": "=Call this tool whenever you need to do anything with content management - including social media campaigns, posting, etc.\n\nThis could be content creation for TikTok, Facebook, Reels, Instagram, LinkedIn, etc. The content manager is also responsible for trend analysis and social media campaign creation.\n\nThe content manager is responsible for handling all types of content management and creation.\n\nThe Content Manager controls the following agents - each with different functionalities, responsibilities and tasks:\n\nLinkedin Agent\nTwitter Agent\nBlog Agent\nEmail Agent\nShort Form Video Agent\nCampaign Agent\nTrends Agent\n\n",
        "workflowId": {
          "__rl": true,
          "value": "1WKgJN2iVnSs3U1Z",
          "mode": "list",
          "cachedResultName": "iSunny.ai — Content Manager"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 1.3,
      "position": [
        -220,
        580
      ],
      "id": "976e41a6-e9b5-4f19-aece-d625f4343451",
      "name": "Content Manager",
      "disabled": true
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "8341e2f5-72ed-4e26-919e-acf34b072269",
                    "leftValue": "={{ $('Telegram Message').item.json.message.text }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Telegram Text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "72986e68-8391-481d-8320-b3ceec14b036",
                    "leftValue": "={{ $('Telegram Message').item.json.message.voice.file_id }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Telegram Voice"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "d2bd4016-6422-422b-a8ab-bf00c6eb46a6",
                    "leftValue": "",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text Message"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "71b8c2b6-5f1a-4bd5-9c1b-cfc8cb2687b1",
                    "leftValue": "",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "WhatsApp Message"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -780,
        -2420
      ],
      "id": "53b00f79-49f6-4201-b4db-06829ed3a2e7",
      "name": "Output Channel"
    },
    {
      "parameters": {
        "operation": "send",
        "additionalFields": {},
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        160,
        -2620
      ],
      "id": "ed89d22a-5a6a-4d70-950f-7169c050e5ea",
      "name": "WhatsApp Response",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        160,
        -2780
      ],
      "id": "7cc35310-d584-4ce1-b81c-f3ec62221d0d",
      "name": "Text Message Response",
      "disabled": true
    },
    {
      "parameters": {
        "agent": "planAndExecuteAgent",
        "promptType": "define",
        "text": "={{ $json.chatInput }}",
        "hasOutputParser": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        -520,
        200
      ],
      "id": "e28f693b-dd5c-4481-84bf-96ec4f29a864",
      "name": "Executive Director",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.message.voice.file_id }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Voice"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "0a66667b-90ac-462b-a12c-6c2abf838cef",
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": "",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -1740,
        -2240
      ],
      "id": "44d23384-d914-4b54-a50b-e8e31c632a8c",
      "name": "Switch"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "0ec32fb8-2f0e-4dfe-9ab4-2e1d85d0c8fd",
              "name": "text",
              "value": "={{ $('Switch').item.json.message.text }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1200,
        -2160
      ],
      "id": "c024f521-fe5e-4645-91a2-a465d3921d5f",
      "name": "Set \"Text\""
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.message.voice.file_id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -1480,
        -2340
      ],
      "id": "104a584f-30a9-4ad7-aaf6-76edf69c1a0f",
      "name": "Download Voice File",
      "credentials": {
        "telegramApi": {
          "id": "aRigjqxqJggSfRCY",
          "name": "Ai Agent Army Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "resource": "audio",
        "operation": "transcribe",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.7,
      "position": [
        -1200,
        -2340
      ],
      "id": "78cd51c6-e2ea-4691-a8df-791e1adaaa32",
      "name": "Transcribe Audio",
      "credentials": {
        "openAiApi": {
          "id": "gLFq2rOZDJvrkTu8",
          "name": "OpenAi account 2"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendChatAction",
        "chatId": "={{ $('Telegram Message').item.json.message.chat.id }}"
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -1480,
        -2160
      ],
      "id": "58e0765d-e5ad-468d-81e7-beac289b74aa",
      "name": "Send Typing Chat Action",
      "credentials": {
        "telegramApi": {
          "id": "aRigjqxqJggSfRCY",
          "name": "Ai Agent Army Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Telegram Message').item.json.message.chat.id }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -580,
        520
      ],
      "id": "ad1953ba-e855-41c8-8f7c-954f6b8f1440",
      "name": "Window Buffer Memory"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Message').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        -120,
        200
      ],
      "id": "83e618c7-917c-41b2-85f0-60dc2d6b2627",
      "name": "Telegram Text Response",
      "credentials": {
        "telegramApi": {
          "id": "aRigjqxqJggSfRCY",
          "name": "Ai Agent Army Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainSummarization",
      "typeVersion": 2,
      "position": [
        -540,
        -2360
      ],
      "id": "7673a813-f3a7-4641-95c0-f6c110087e82",
      "name": "Summarization Chain"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        -380,
        -2180
      ],
      "id": "ca75d8c8-ea05-41ea-9112-b7162ae87aeb",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "gLFq2rOZDJvrkTu8",
          "name": "OpenAi account 2"
        }
      }
    },
    {
      "parameters": {
        "resource": "audio",
        "input": "={{ $json.response.text }}",
        "voice": "onyx",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "typeVersion": 1.7,
      "position": [
        -160,
        -2360
      ],
      "id": "c86cb427-4f70-4082-84bd-665d2071d01c",
      "name": "Create Audio Response",
      "credentials": {
        "openAiApi": {
          "id": "gLFq2rOZDJvrkTu8",
          "name": "OpenAi account 2"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAudio",
        "chatId": "={{ $('Telegram Message').item.json.message.chat.id }}",
        "binaryData": true,
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        140,
        -2360
      ],
      "id": "66b0ae2f-3ace-4ca0-99d8-1da51daa3662",
      "name": "Send Audio File",
      "credentials": {
        "telegramApi": {
          "id": "aRigjqxqJggSfRCY",
          "name": "Ai Agent Army Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Message').item.json.message.chat.id }}",
        "text": "={{ $('Executive Director').item.json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        340,
        -2360
      ],
      "id": "91431d7b-6a13-47bc-8024-131e98404688",
      "name": "Send Text Response",
      "credentials": {
        "telegramApi": {
          "id": "aRigjqxqJggSfRCY",
          "name": "Ai Agent Army Telegram Bot"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "5c9e7f66-494d-4d0d-9f3e-ba09395d609c",
              "name": "=chatInput",
              "value": "Hi, the user has a received a new email. Please take appropiate action based on the data you have received.\\n\\nHere are the details:\\nName: Tyler Newborn\\nEmail Address: [email protected]\\nSubject: Subject: Concern About Closing Delays\\nEmail Body: ---------- Forwarded message ---------\\nFrom: Tyler Newborn <[email protected]>\\nDate: Wed, Jan 8, 2025 at 4:32 PM\\nSubject: Subject: Concern About Closing Delays\\nTo: [email protected] <[email protected]>\\n\\n\\nHi,\\n\\nI hope you’re doing well. I just received word that there might be delays\\nwith the closing process for the property on Elm Drive. This is concerning\\nbecause my current lease is ending soon, and I need to move in as planned.\\nCan you provide an update or let me know if there’s anything I can do to\\nhelp expedite the process?\\n\\nBest regards,\\nMichael",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -800,
        200
      ],
      "id": "32ad0fc5-2150-4602-982e-be5fdc3ce172",
      "name": "Edit Fields"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -1060,
        200
      ],
      "id": "5bf03f72-2719-49a4-8fdf-db88aa41a989",
      "name": "When clicking ‘Test workflow’"
    }
  ],
  "pinData": {},
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Executive Director",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Communication Manager": {
      "ai_tool": [
        [
          {
            "node": "Executive Director",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Project Manager": {
      "ai_tool": [
        [
          {
            "node": "Executive Director",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Research Manager": {
      "ai_tool": [
        [
          {
            "node": "Executive Director",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Content Manager": {
      "ai_tool": [
        [
          {
            "node": "Executive Director",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Output Channel": {
      "main": [
        [],
        [
          {
            "node": "Summarization Chain",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Text Message Response",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "WhatsApp Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Executive Director": {
      "main": [
        [
          {
            "node": "Telegram Text Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Download Voice File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Typing Chat Action",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set \"Text\"": {
      "main": [
        []
      ]
    },
    "Download Voice File": {
      "main": [
        [
          {
            "node": "Transcribe Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe Audio": {
      "main": [
        []
      ]
    },
    "Send Typing Chat Action": {
      "main": [
        [
          {
            "node": "Set \"Text\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "Executive Director",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Summarization Chain": {
      "main": [
        [
          {
            "node": "Create Audio Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Summarization Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create Audio Response": {
      "main": [
        [
          {
            "node": "Send Audio File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Audio File": {
      "main": [
        [
          {
            "node": "Send Text Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Executive Director",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a596a101-c937-4836-8e5c-46ee1a394c52",
  "meta": {
    "instanceId": "f738b6f51c0d6f8cdcd0683cab6a263f94b2bece7d93e81e9f6ea64f8f03e72c"
  },
  "id": "3hAnDj7sihJqq1ly",
  "tags": []
}```

Share the output returned by the last node

The workflow did not complete correctly - so there is no output returned by the last node.

Information on your n8n setup

  • n8n version: Cloud
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Cloud
  • Operating system: Windows 11 Home W/ Chrome

Hi @TheRealRiley,

You’ll be better off using the Tool Agent for this. We’ll probably deprecate the other Agents at some point.

1 Like

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