I have an n8n workflow that:
- Scrapes Reddit posts
- Filters out posts older than 12 hours or not marked “Relevant”
- Drafts a comment with OpenAI
- Appends each item to Google Sheets
- Retrieves the row and posts the comment back to Reddit
When I supply a list of, say, 10 posts/URLs, the workflow only ever posts one comment and then stops. I’m trying to loop over all items, but I get an error about an undefined variable called things
in the Create a comment in a post node.
Beyond that, I also want to:
- Filter out locked Reddit posts (i.e. don’t attempt to comment on posts where comments are locked)
- Automatically remove duplicates from my Google Sheet so I never post the same link twice
- Only post new items on each run (i.e. rows added in the last execution, not older rows)
- Keep the workflow running automatically, without manually triggering it, so it continually picks up new posts
Describe the problem/error/question
When I supply a list of, say, 10 posts/URLs, the workflow only ever posts one comment and then stops. I’m trying to loop over all items, but I get an error about an undefined variable called things
in the Create a comment in a post (Reddit) node.
What is the error message (if any)?
Cannot read properties of undefined (reading 'things')
This error occurs in the Create a comment in a post node. If I enable Continue on Fail, the workflow runs without crashing but still only processes the first item