Make retry until successful step

I’m trying to make this thing, maybe someone can help:
I need to insert a document to a database using a service that im writing in IS, but sometimes the user send a document and the database is not available for maintenance purpose, how can i continue make a retry until the database is available and the document could be inserted into it.

Any idea.

You can write all the documents to a directory and then insert all the documents together at a time when you are sure that the database is up. Or again, you can create a flow which writes the document to a directory if the database insert fails and then schedule another flow to scan the directory periodically and insert the files in the directory one by one to the database.

This is an interesting situation and very much doable!
God I love doing this!

Or you can configure the Trading Networs with number of retries to repeat the tasks.

Or this I am not sure, Can we use the repeat step to repeat until a specific condition is met?
Have a great day!

In my case, i want to make the retries and i tried using the configuration that is in TN, but it doesn’t work in a customized service, the main reason is that i want to catch the errors and send an email to the dba or to me, and know if finally the document was inserted into the db.
I try this and it works but…

– try-catch block –
repeat (on failure)
secuence (exit on success)
secuence (exit on failure)
execsql (insert into the db)
secuence (exit on done)
smtp (send an email to the dba)
var1= 0
do nothing
var1= 1
raise an error
end repeat

If you see, i have to raise an error, but in this case, the catch try block, is used to advise that the db is down, and i need to continue doing the repeat step, and it works, just that throw the error is doing by not good way, i mean, i’m trying to add a letter to a number using addInt function, it raises the error but is not the best way.

What do you think??
pd. sorry for my english.


You can check for the update count variable value to see if the insert was a success or not. If there was an error the update count value wont be present in the pipeline.
Will this help?