Need Help: Problem with number of executions

Problem

Problem Description

I’m encountering an issue in my workflow where only one record gets inserted into the database instead of two, despite the workflow starting with two URLs. Here’s the breakdown of my workflow and the problem:

  1. Workflow Overview:
    • The sitemap node outputs two URLs.
    • These URLs are passed through each node until Edit Fields7.
    • At Edit Fields7, there are still two items as expected.
    • The workflow then checks (via Supabase5 node) whether records for each URL exist in the database.
  2. Expected Behavior:
    • Since I’m starting from scratch and the database is empty, the result of Supabase5 should be an empty JSON for both URLs.
    • The subsequent If node correctly determines that the results value is not greater than 0 for each URL and passes the execution to the Supabase8 node.
    • Supabase8 should then insert two records, one for each URL and its associated content.
  3. Actual Behavior:
    • Although there are two items up to Edit Fields7, starting from the Supabase5 node (which fetches records from the database), only one item is passed forward.
    • This seems to disrupt the logic for handling multiple records and causes the Supabase8 node to insert only one record.
  4. Steps I’ve Taken:
    • Checked the output of all nodes before Supabase5, and two items are correctly being passed along.
    • Verified that the database query in Supabase5 should return empty JSON for both URLs, as the database is empty.
  5. Question:
    • How can I ensure that both items (one for each URL) are processed and inserted into the database by Supabase8?

Share the output returned by the last node

Can be see in the workflow, but pasting a screenshot just in case you can’t see it:

Information on your n8n setup

  • n8n version: 1.67.1
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): no clue what this is
  • Running n8n via (Docker, npm, n8n cloud, desktop app): self-hosted, npm
  • Operating system: debian raspberry pi

Hey @fpcteam , you likely could do with Merge node. As I understated IF node is simply used to determine if all the records from Edit Fields7 are to be inserted. If that so, use “Choose Branch” mode as shown below

That implies the references to Edit Fields7 node in Insert into Supabase8 should be in the format {{ $json.field_name }}.

hey there. thanks for replying and helping out.

The IF is there to decide if there were records of the url in the database already. if true, delete old records and update (for vector store). If false, create new records.

So, am not sure if your suggestion would really work in my case. But, i really do appreciate you trying to help. It feels nice. :slightly_smiling_face:

I actually decided to take another path. I distributed my workflows into three triggers:

  • first run: manual first run
  • on new page creation
  • on page updation

that allows me to not worry about trying to handle the part of searching and then deciding whether to update or create. am posting the json in the next message.

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