Hey all I’m new here, but have quite a bit of programming experience and some low code experience with unreal engine (as a hobby).
I’m trying to translate a piece of code into low code n8n nodes, to better observe the execution flow. This is part of a larger workflow that is getting hard to manage in normal code.
I’d like to share briefly what I’m doing in pseudo code and then rise some questions.
I am extracting user sentiment, pain points and “satisfaction” points from reddit comments and conversation on a given post.
The extraction algorithm in code looks something like this:
Analyze Comments Algorithm
Inputs:
- the comment to analyze
- a summary of the post that this comment is a child of
- a summary of the conversation thread that this comment is a child of. basically if this comment is nested 20 levels deep, I have a short summary of what the 20 ancestor comments were about.
Execution:
- I take the comment, the summary of the post and the summary of the conversation so far (which is blank initially) and I produce the comment analysis based on the summary of the post, the summary of the conversation if any, and the comment itself.
- If append the comment to the conversation summary, and if the new summary is larger than 3000 AI tokens I summarize it again.
- I loop thru all the replies of this comment and call the algorithm again for each reply, with the new conversation summary that was produced.
- I accumulate all the results from all the replies in a new object that contains the comment insights, and the children execution results
Output:
-I return the object that accumulated the insights for this comment and all the children executions.
What I seem to be missing are
- nodes that allow me to define workflow instance variables
Or nodes that give me a way to accumulate values across the execution of the workflow.
For example, I don’t see how I might be able to push
different items into an array based on the if branch I am currently on.
- the ability to read as input values that are not the immediate outputs of the nodes that were previous in the execution chain.
Is it feasible to implement the algorithm mentioned above in n8n? Would it be easier to follow than typescript code?
If not, would it be feasible to implement a series of custom nodes that might facilitate this functionality? Specifically the workflow instance variables?