I have recursive workflows A and B.
A creates about 50 to 100 data records, and B makes changes to about 1 to 30 of the created records.
This works fine if I create and run separate triggers for each.
However, if I call A in step1 and B in step2 within one workflow, it will not work.
Specifically, changes in B are not reflected well (workflow processing is completed)
Even if I take a gap between B’s schedule start and current date +5min, it doesn’t work.
You’ve probably a race condition going on where the order of the updates is not quite how you expect it.
(Or, as outside thought, it might be a bubble limitation in there with chaining workflows together, which I have seen in some circs).
Without seeing the code, it is hard to tell, but I have a feeling about what might be going wrong…
I think you will need to save the changes you are making memory (custom state) and then use that list to make the second set of changes.
Or alternatively do this using some flags in the database to make items for further update (a bit hacky).
One way or another you need to the Unique IDs of the list you are changing in the first workflow, available for those that need changing in teh seocnd work flow.
A> Recursive workflow that creates dozens of data records (repeats N items)
Save the list of records created here in the custom state (how? Is it in the workflow of A or in step 2 of the trigger event? Either way, the values cannot be referenced)
Step 2: Execute schedule API “B”
B> Recursive workflow that references the list saved in the custom state and changes all of these values (repeats N items)
It is quite hard to be specific without seeing the exact workflow. A screen shot would be useful.
But broadly speaking, there will be a trigger when you start the process. Like say a button, or an event which will trigger a normal Workflow.
At that point you can store the list if items in a Custom State as a list, and then pass that to the back end workflow (I am assuming you mean an API Backend Workflow) to loop through the changes you want to make.
Again I am just guessing, but go and get the list of rows created in Workflow A, by using Do Search to retrieve them, and then push them into Workflow B.
A database trigger is a good idea. the other way is to mark data as you go for later change and then run the second query based on the results of the first.
Would you like to share screenshots so we can see what is going on. It helps for context, otherwise this is all very abstract, and we can only make suggestions based upon guesses.
You can have a two recursive WFs in the same backend WF. Perhaps you can reorganise and branch the backend WF. Then you can pass the results of one in to the other?