Hello everybody, I am currently analyzing a request and all the impacts it could have but before touching anything, I would like to know if the spawnWithParameters or startWithParameters method could execute the same workflow at the same time without it Is there any error?
Let me explain, I have several workflows which run at the same time and which finish their processing almost at the same time. At the end of these workflows I would like to use one of two methods to launch a single generic workflow with parameters.
I think that startWithParameters is better than spawnWithParameters because the latter risks creating a lot of instances in the long term (unless it is deleted at the end of their processing) Thank you in advance for those who take the time to respond to me
Solved! Go to Solution.
Views
Replies
Total Likes
Hello @Ragsthenos,
The 'StartWithParameters' method can only be executed on a workflow being edited or finished.
The 'SpawnWithParameters' can do the trick, but as you said, it'll create lot of instances in the long term.
One good alternative is to use Sub-workflow activity. You can make your generic workflow as a sub-workflow, and use sub-workflow acitvity in other workflows to call it. I've just tested it, variables are passed from main workflow to sub-workflow.
main workflow :
sub-workflow :
result in main workflow :
Br,
Amine
Views
Replies
Total Likes
Hello @Ragsthenos,
The 'StartWithParameters' method can only be executed on a workflow being edited or finished.
The 'SpawnWithParameters' can do the trick, but as you said, it'll create lot of instances in the long term.
One good alternative is to use Sub-workflow activity. You can make your generic workflow as a sub-workflow, and use sub-workflow acitvity in other workflows to call it. I've just tested it, variables are passed from main workflow to sub-workflow.
main workflow :
sub-workflow :
result in main workflow :
Br,
Amine
Views
Replies
Total Likes
Hello, @Amine_Abedour The sub-workflow also creates a new instance on every run.
One of the solution could be to save the data from workflows in Options and then use the generic workflow to read the Options created by the main workflows
Views
Replies
Total Likes
Hello @_Manoj_Kumar_
Indeed, the sub-workflow creates an instance at each execution, but it destroys it immediately after the execution.
Br,
Amine
Views
Replies
Total Likes
Hello @Amine_Abedour,
Thank you for your answer, I actually created a sub-workflow yesterday after asking my question and this solution seems to be the most appropriate, the problem is that if the sub-workflow goes into error for one reason or another, the main workflow also fails.
It still meets my needs, I'll see what I can do to optimize.
Views
Replies
Total Likes
Views
Likes
Replies