Parse json array Node Question/Answer chain

Describe the problem/error/question

Dear, I get an array json on “agregate “ node and on input of “Question/answer chain“, how can i declare my prompt to parse json automatically and answer the user to search words presents?

Thank you.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

After the aggregate . There are multiple ways to parse the json array

Here are some example.

Both can be used in AI prompt. Just ask AI to answer them each one by one.

(Use fake random emails as example)

I share you a sample of excel file,

Agregate node return this :

[
  {
    "data": [
      {
        "Agent": "A_AGENT",
        "ID": "ID_001",
        "Goal": "Goal n°1 Agent A",
        "Words": "\"phone number\", \"email\", \"address\""

      },
      {
        "Agent": "A_AGENT",
        "ID": "ID_002",
        "Goal": "Goal n°2 Agent A",
        "Words": "\"lastname\", \"firstname\", \"address\", \"email\""

      }
	  ]
	  }
	  ]

If i ask a question on Chat input, example: What is your lastname? , the Node “Question/answer“ must parse json (result from Agregate Node) and answer : ID: ID_002 and Goal: Goal n°2 Agent A because he found the word “lastname“ on the question and knows the ID is ID_002 by JSON parsing.

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