
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 03:32 AM - edited 06-08-2023 10:57 PM
This article aims to provide guidance for working with the flow designer. I have often been asked this question in projects and I have also seen it a few times here in the community. So how do you jump back in the flow designer when certain actions need to go through again?
Common Requirement
You maybe remember the old times of Workflow editor where you easily could build in loop backs in your flows. An example requirement could be following:
- Someone (user A e.g. Technical Consultant) gets a task to create a design document which needs to be validated by someone else (user B e.g. Architect)
- So, after closing the task a Design check task will be created and assigned to the user B.
- If B completes the check without any concerns the workflow continues with the next steps
- If B does not accept the design the design task should be opened again and steps 1. and 2. should be repeated.
The complete flow is described in this activity diagram:
I know this is a bit contrived and could be also achieved with an approval, but it was only meant to illustrate similar problems.
This "rollback" was quite easy to build with the old workflow editor. But it’s easy in the Flow designer too. You just need to think a little bit like a programmer. I admit that sounds crazy, but it's not as hard as you might assume.
Seriously, I have been asked these questions several times by colleagues and read them here on the forum. I think for many developers the following is crystal clear, but maybe it helps someone anyway if I briefly outline the solution for such requirements here.
How to repeat and rollback steps within a flow?
As you know there is Flow Logic available to build a loop, like ‘For Each’ or ‘Do the following until’. For our example the second one is the useful function. The clou is, that the condition will be evaluated after all steps within the loop are executed. Means, although the condition is true before the loop will be entered, the loop will not be skipped directly. It will execute the steps within the loop at least one time. These steps can include, that the condition isn’t true afterwards and so the loop will be executed again. But be cautious don’t build infinity loops!
The important prerequisite is, that you can only use in the loop condition records which are created before the loop. That’s why we create the Architecture Task in the very beginning.
Setting the scene: The consultant creates a story, and the system automatically creates two task, one for the design and one for the architect to review the task. The story can go to state ready when the design is valid.
To summarize the steps of the described flow from the beginning. Until the architect sets the state of his task to complete the technical consultant needs to adjust the design – the consultant needs to work and rework on the design until the architect is happy.
Let’s build the flow for our example.
- Set the trigger: Story is created
- Add Action to create the Design task:
- Add Action to create the Architecture task. We need this task already now, otherwise we couldn’t use it in loop in next step as condition:
- Now the import part – the “Do the following Until” loop. We do again and again the following steps, until the architect closes his task with state complete. Even if the architect task would be completed already beforehand, this loop will be executing at least one time! The condition is evaluated at the end of the loop not before entering – programmer will know this as do-while loop.
- Now we wait within the flow until the consultant completes his task.
- The architect can now make his merciless judgment and gets his task set to status ready for it
- We wait until the architect came to a result, either he accepts the design and sets the status to complete, or he rejects it.
- If the Architect is not happy and cancels his task the flow sets the state of the Design task and Architecture task back to Draft.
- IF condition:
- Update the design task in the THEN part of the if condition:
And another Update Task action within the IF branch:
- With that we are at the end of the loop and the defined condition will be evaluated. Now two way the flow can follow up:
- If step 8.a – 8.c happened the condition of the loop is not true and all the steps beginning with step 5 will be repeated – rework until architect is happy.
- If the architect closed his task with complete in step 7 – he is happy, and the loop will be exited.
- After the loop the flow finishes with updating the story to state ready and the implementation of the awesome design can start.
Here is the whole flow in one picture:
The update set for this flow is attached.
Hope this will help someone. If yes please click the Thumbs up.
Greets
Daniel
Solved! Go to Solution.
- 4,784 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 01:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2023 01:41 AM
See Article in origin post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2024 06:48 AM
Hi Daniel great post. I am wanting to implement something similar but instead of waiting for the original task to be updated to 'Complete', I want to create a new task when the users sets the task to 'Fail' and continue to create a new task every time the user sets it to fail until a task is set to complete. However, cannot seem to get this to work.
Are you able to point me in the right direction.
Many thanks
Max

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2024 11:42 PM
Hi @CCZMAX1 , I think this is only possible if you have some flag on the RITM level. Maybe you create a hidden variable in the catalog item (True/False). The condition of the do-while loop could be if this flag is false. First step within this loop create you task, then you wait until "Complete". In this case you set the flag to true. If the Task is fail you keep the flag at false and the loop will start again.
Greets
Daniel
Please mark reply as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2024 04:58 PM
Hi Daniel, thank you so much for your reply. I did think of adding a field but then decided against it and came up with the following instead which works.