How to Split Data and after do branches by turns

Hello everyone!
English is not my native language, sorry…

  1. First step n8n I Exec Storage Procedure (SP) in MS SQL Server and get 2 collections of data: By Select in SP + Set Variables after Exec SP in n8n.
    1st Collection can exist 1+ Rows or 0 if SP Returns <> 0. Var for SP Returns is Ret.
    2nd Collection Always has 1 Row.

  2. I need to stop workflow immediately if Ret <> 0.

  3. I need to Split Data to 2 Parts: MainTable(Select in SP) and Variables. I can do this using If condition, but any action with Variables can be only in the end of Workflow.

  4. MainTable Transform to JSON. I can do this.

  5. JSON sending to Kafka. I can do this. But Kafka can be unavailable and data will not sending.

  6. If data was successfully sending to Kafka, I use Variables (from Step 3) to Update Table in MS SQL Server — mark sending (to n8n) data to Delete it.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

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