Include specific data (fix data) in summarize chain ouput

I’m building a workflow to summarize slack threads. In the output of the summerization chain node, I would like to include specific data from the input data so that I can map the response to an item from the input. Is this possible? I can’t figure out how to change the structure of the response, and there is nothing in the response that I can use to merge the input and output. Perhaps there is another stratgey?

Specifically, in my case, I have an input

"parent": {
  {
    "messageText": "Hey, have you ever visited the Egyptian pyramids?",
    "userId": "a user id",
    "timestamp": "1743511848.919049"
  }
},
"replies": [ {a reply}, {another reply}, ... ]

and an output

{
  "response": {
    "text": " Jamie and Alex discuss the mystery and history of the Egyptian pyramids, including the construction and theories involving the use of ramps, despite certain unknowns. "
  }
}

I want the timestamp included in the response.

Thanks in advance

You could use Merge node in Combine by position mode.

If this answers your question, please mark this post as a :white_check_mark: Solution.

1 Like

Thanks @Olek for your response. I have tried combine which will do for a now, however can we be sure of the order? I think probably yes, n8n nodes seem to preserve the order, however I’ve read anything in the documentation to that effect.

The algo behind n8n is deterministic.

Just be aware that the AI tools can refer the first input item only. So, employ Loop with batch size 1 whenever you want the AI agent node to process multiple items, to remain on the safer side.

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