Problem with a new feature Structured Output Parse

I am using an AI agent node, and in the parameters, I have enabled the “Require Specific Output Format” option, structured as a JSON example like this:

{
“topic_1”: “Entendiendo los agentes de IA”,
“topic_2”: “Contruyendo agentes de IA con n8n”,
“topic_3”: “Optimizacion de la Ingenieria de Prompt”,
“topic_4”: “Almacenando y consultando conocimientos de IA”,
“topic_5”: “Escalando negocios con AI”
}
In the output format I use for the AI agent, I have the “Structured Output Parse” node. Upon execution, it seems that the input to the node appears to be correct:
input:
json\n{\n "topic_1": "Introducción y fundamentos de las bases de datos vectoriales",\n "topic_2": "Técnicas de indexación y búsqueda en bases de datos vectoriales",\n "topic_3": "Aplicaciones y casos de uso de las bases de datos vectoriales",\n "topic_4": "Comparación de diferentes sistemas de bases de datos vectoriales",\n "topic_5": "Retos y oportunidades en el desarrollo de bases de datos vectoriales"\n}\n
output:
However, the output remains empty, despite the fact that I have included the images for better understanding.

nodo output

What is the error message (if any)?

I don’t encounter any error messages; the node simply outputs as empty.

Please share your workflow

(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": {
        "formTitle": "The Deepest Research",
        "formDescription": "Enter a search topic then sit back and relax.",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Search Topic",
              "placeholder": "Search Topic",
              "requiredField": true
            },
            {
              "fieldLabel": "Email",
              "placeholder": "[email protected]",
              "requiredField": true
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -1760,
        1280
      ],
      "id": "5e64d1ea-a9f5-48da-a392-eb3d275d4365",
      "name": "On form submission",
      "webhookId": "ba86447b-5cda-48ab-a4d6-1e1a07bad686"
    }
  ],
  "connections": {
    "On form submission": {
      "main": [
        []
      ]
    }
  },
  "pinData": {},
  "meta": {
    "instanceId": "b3290d3007af56082a2f9e0d409106ba2f24f6e2136968cfba3c020dc36e3afe"
  }
} 

{
“nodes”: [
{
“parameters”: {
“promptType”: “define”,
“text”: “={{ $json[‘Search Topic’] }}”,
“hasOutputParser”: true,
“options”: {
“systemMessage”: “# Resumen \nEres una IA asistente de investigación diseñada para generar cinco temas de búsqueda altamente relevantes y detallados a partir de un tema principal. Tu objetivo es dividir el tema proporcionado en cinco subtemas clave que permitan una investigación profunda y una comprensión integral. \n\n## Instrucciones: \n1) Desglosar el tema principal: Identifica cinco subtemas distintos pero interconectados que, al investigarse, brinden una comprensión completa del tema central. \n2) Garantizar profundidad y relevancia: Cada subtema debe ser lo suficientemente específico para explorar en profundidad, pero lo bastante amplio para ofrecer insights significativos. \n3) Evitar redundancias: Los cinco subtemas deben ser únicos y cubrir diferentes aspectos del tema principal. \n\n## Formato de salida (JSON): \n```json\n{ \n "topic_1": "<Primer tema de búsqueda en profundidad>",\n "topic_2": "<Segundo tema de búsqueda en profundidad>",\n "topic_3": "<Tercer tema de búsqueda en profundidad>",\n "topic_4": "<Cuarto tema de búsqueda en profundidad>",\n "topic_5": "<Quinto tema de búsqueda en profundidad>"\n}\n\n## Ejemplo de entrada y salida:\n## Entrada:\n"Automatización empresarial impulsada por IA"\n\nSalida:\n{\n "topic_1": "El papel de la IA en la automatización de procesos empresariales",\n "topic_2": "Automatización de flujos de trabajo con IA: herramientas y tecnologías",\n "topic_3": "Desafíos y consideraciones éticas en la automatización con IA",\n "topic_4": "Estudios de caso: Implementaciones exitosas de IA en automatización empresarial",\n "topic_5": "El futuro de la automatización con IA: tendencias e innovaciones emergentes"\n}\n\n## Notas finales\nTus respuestas deben ser concisas, relevantes y estar bien estructuradas para guiar investigaciones profundas de manera efectiva.”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.8,
“position”: [
-1520,
1280
],
“id”: “c3753edc-3c2d-4a05-9127-b6b1f2d27ee3”,
“name”: “Plan Topics”
}
],
“connections”: {
“Plan Topics”: {
“main”: [

]
}
},
“pinData”: {},
“meta”: {
“instanceId”: “b3290d3007af56082a2f9e0d409106ba2f24f6e2136968cfba3c020dc36e3afe”
}
}

Share the output returned by the last nodkfuPmNrlppcu8bECFz7WR9qPA.png)e

Information on your n8n setup

  • n8n version:
    1.83.2
  • Database (default: SQLite):
    dont use databse
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
    own
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
    docker
  • Operating system:
    linux debian

Can you please show the output of the AI Agent, please?

Instead of the output of the output parser

Hi solomon
Thank you very much for your response. Here is the agent’s output, but unfortunately, it still has no results. However, I noticed that if I switch the AI model to ChatGPT, it works. It seems that Mistral does not understand

I see. Sometimes the model has different requirements for the structure of the data sent to them, even though OpenAI’s structure is the standard.

I’m not sure if that’s a bug or simply a limitation of the model.
But I’m glad you found a way to make it work.

Salomon, thank you very much for your support. I wanted to try other options, but I know it works with ChatGPT and Claude. However, it does not work with Mistral

Have you tried another Mistral model?
Maybe pixtral-12b ?

Thank you for the advice, but I used the model version you suggested. However, the output does not meet the requirements, and the field remains empty as a result. I tested the same prompt on the other two models without making any changes, and it works. But when using the Mistral model, specifically the versions Pixtral-12-Latest and Pixtral-12 and other, it does not work

I’m gonna ping other supporters, because I really don’t know Mistral very well.

@Olek @jcuypers @mohamed3nan

2 Likes

Did you try to define a schema?

try to edit it to suit your needs…

Hi mohamed

Thank you very much, but even after switching to the schema, it still does not produce any output. I am sharing the screen and the schema used for your reference

schema:
{
“type”: “object”,
“properties”: {
“topic_1”: {
“type”: “string”
},
“topic_2”: {
“type”: “string”
},
“topic_3”: {
“type”: “string”
},
“topic_4”: {
“type”: “string”
},
“topic_5”: {
“type”: “string”
}
},
“required”: [
“topic_1”,
“topic_2”,
“topic_3”,
“topic_4”,
“topic_5”
]
}


this is imput

## Desglose del tema principal: "Base de datos vectoriales"\n\n1. "Conceptos fundamentales de bases de datos vectoriales: Definición, componentes y aplicaciones"\n2. "Técnicas de representación vectorial: Transformaciones y algoritmos utilizados en bases de datos vectoriales"\n3. "Aplicaciones prácticas de bases de datos vectoriales en el procesamiento de lenguaje natural (NLP)"\n4. "Desafíos y consideraciones en la implementación de bases de datos vectoriales: Escalabilidad y precisión"\n5. "Herramientas y tecnologías emergentes para la gestión y consulta de bases de datos vectoriales"\n\n```json\n{\n  "topic_1": "Conceptos fundamentales de bases de datos vectoriales: Definición, componentes y aplicaciones",\n  "topic_2": "Técnicas de representación vectorial: Transformaciones y algoritmos utilizados en bases de datos vectoriales",\n  "topic_3": "Aplicaciones prácticas de bases de datos vectoriales en el procesamiento de lenguaje natural (NLP)",\n  "topic_4": "Desafíos y consideraciones en la implementación de bases de datos vectoriales: Escalabilidad y precisión",\n  "topic_5": "Herramientas y tecnologías emergentes para la gestión y consulta de bases de datos vectoriales"\n}\n```

It works on my side!

I guess something wrong with your form, can you share it?

Thank you very much! Could you please let me know which Mistral model you used in the example?

pixtral-12b