Hello everyone!
English is not my native language, sorry…
-
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.
-
I need to stop workflow immediately if Ret <> 0.
-
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.
-
MainTable Transform to JSON. I can do this.
-
JSON sending to Kafka. I can do this. But Kafka can be unavailable and data will not sending.
-
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.