hey! newbie, here. created a workflow that given a chemical number gathers resources from two websites, and also a local database. than, i fed these parameters to basic llm chain. yet, i ha always problem with “\n” newline characters in output.
finally by using “item list output parser” i managed to get an array of markup lines as below:
[
{
“text”: “# Kimyasal Mal Giriş İzni Değerlendirme Raporu - 7664-41-7”
},
{
“text”: “## Kimyasal Bilgi Kartı”
},
[35 lines of markdown report text]
]
and i used aggregate as below to get 1 item output
output of aggregate is like:
[
{
“data”: [
{
“text”: “# Kimyasal Mal Giriş İzni Değerlendirme Raporu - 7664-41-7”
},
{
“text”: “## Kimyasal Bilgi Kartı”
},
…
what i am trying to achive is to combine these texts (markup lines) line by line to get a markup file that is downloadable.
i tried “Summarize”, “Edit Fields”, and “Code” nodes to map reduce the data, yet everytime there are “/n” brekup lines in output string. so not usable in case i should just copy and create an .md file from.
even js template result in “/n” on output.
also tried “Markdown”, “Convert to File” (text and html) nodes for no avail.
lastly, when text input field is a below expression i get what i need as contents of a valid markup file:
{{ $json.data.map(item => item.text).reduce((cur, next) => cur + “\n” + next) }}
result is like:
"
Kimyasal Mal Giriş İzni Değerlendirme Raporu - 7664-41-7
Kimyasal Bilgi Kartı
Bu Madde Hakkında
CAS Numarası: 7664-41-7
Kimyasalın Resmi Tanımı: AMMONIA, ANHYDROUS
Bu madde REACH Yönetmeliği kapsamında kayıtlıdır ve Avrupa Ekonomik Bölgesi’nde yılda ≥ 10.000.000 ton veya daha fazla miktarda üretilmekte ve/veya ithal edilmektedir.
…
"
maybe this is not even an n8n issue? could you guide me through? i want this content as a downloadable md file.
my n8n setup
- n8n version: 1.88.0
- self hosted ai starter kit
