How to convert the feedback from Summarization Chain (Node) to JSON for Mapping?

I successfully use Summarisation Chain (Node) to generate output as following:

[ {
“response”: {
“text”: “{\n “Type”: “Interest”,\n “Date”: “04/17/23”,\n “Description”: “Interest on credit balance”,\n “Tax withholding”: “0.35%”,\n “Currency”: “USD”,\n “Amount”: “$4.13”\n},\n{\n “Type”: “Dividend”,\n “Date”: “04/03/23”,\n “Description”: “Cash dividend on NUVEEN AMT FREE QUALITY”,\n “Tax withholding”: “Non-qualified dividend”,\n “Currency”: “USD”,\n “Amount”: “$14.00”\n}”
}
}]

How can I covert it back to a Json and split into 2 items for further node ? Thank you.

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hi @Wil

Thanks for posting here and welcome to the community! :cupcake:

It’s definitely possible to parse that string back into a valid JSON (with the Code Node for example), but I think what’s even better and more efficient is if you could get the right format to begin with.

What is your use case, aka what are you trying to do? Can you share your workflow?

Tip for sharing your workflow in the forum

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!


You could probably use our Structured Output Parser if you want to have consistent JSON output.

Have a look in our template collection, perhaps you can find something for your use case already:

I would like to capture the PDF from Dropbox and using ChatGPT to summarize the data from there and then export to a JSON Format.
Here is the copy of the workflow

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