# Start next step in flow only after previous one has ended successfully

**URL:** <https://community.homey.app/t/start-next-step-in-flow-only-after-previous-one-has-ended-successfully/17604>\
**Category:** Questions & Help\
**Tags:** flow\
**Created:** [September 1, 2019, 9:45pm UTC](https://community.homey.app/t/start-next-step-in-flow-only-after-previous-one-has-ended-successfully/17604 "2019-09-01T21:45:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DGalama](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dgalama/32/10402_2.png) [@DGalama](https://community.homey.app/u/DGalama)\
**Post date:** [September 1, 2019, 9:45pm UTC](https://community.homey.app/t/start-next-step-in-flow-only-after-previous-one-has-ended-successfully/17604/1 "2019-09-01T21:45:53Z")

</div>

Hi, I would like to do the following:

Step 1: When sun sets, turn on the garden lights at 10%  
Step 2: Send notification that garden lights were turned on at 10%  
Step 3: Set dimmer to 100% during 3600 seconds (increases brightness over one hour)  
Step 4: **ONLY WHEN 100% IS REACHED** send notification that lights are now at 100%

So, I want my steps to be sequential. At this moment, when I run the flow all notifications are sent out at once.

How can I make the next step in a flow to start only when the previous one was (successfully) ended?

Thanks,

Dagmar

---

<div class="post-metadata">

**Author:** ![Osorkon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/osorkon/32/43026_2.png) [@Osorkon](https://community.homey.app/u/Osorkon)\
**Post date:** [September 1, 2019, 10:14pm UTC](https://community.homey.app/t/start-next-step-in-flow-only-after-previous-one-has-ended-successfully/17604/2 "2019-09-01T22:14:28Z")

</div>

One possible option:

Flow1:  
When sun sets  
Then turn on the garden lights at 10%  
And  
With a delay of 2 s Start flow2

Flow2:  
When flow was startet  
And the garden lights = 10%  
Then Send notification that garden lights were turned on at 10%  
And Set dimmer to 100% during 3600 seconds  
and Start Flow3 with a delay of 3602 s

Flow3  
When Flow was startet  
And dimmer = 100%  
Then send notification that lights are now at 100%

Another Option

Flow1:  
When sun sets  
Enable Flow2  
And  
Then turn on the garden lights at 10% with 1s delay  
And disable Flow2 with 5s delay

Flow2:  
When the garden light dimm level changes  
And the garden lights = 10%  
Then Send notification that garden lights were turned on at 10%  
And Set dimmer to 100% during 3600 seconds  
and Enable Flow3

Flow3  
When dimm level has changed  
And dimm level = 100%  
Then send notification that lights are now at 100%  
And disable Flow3 with 5s delay

---

<div class="post-metadata">

**Author:** ![DGalama](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dgalama/32/10402_2.png) [@DGalama](https://community.homey.app/u/DGalama)\
**Post date:** [September 2, 2019, 11:01am UTC](https://community.homey.app/t/start-next-step-in-flow-only-after-previous-one-has-ended-successfully/17604/4 "2019-09-02T11:01:46Z")

</div>

Hi Osorkon,

Thanks for this solution. However, it is not what I was looking for.  
What I meant is if it is possible at all to create dependancies within 1 flow. Your solution (well the first one…) is something I figured out myself. But, as an old UNIX-admin, that feels like creating 10 shell-scripts calling each other while you can also program one. It’s a bit messy to me.

I guess what I want is not (yet) possible with Homey.

---

<div class="post-metadata">

**Author:** ![anon8748058](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@anon8748058](https://community.homey.app/u/anon8748058)\
**Post date:** [September 2, 2019, 11:41am UTC](https://community.homey.app/t/start-next-step-in-flow-only-after-previous-one-has-ended-successfully/17604/5 "2019-09-02T11:41:21Z")

</div>

Hi,

I took an entirely different approach to get the end result. I asked on this forum if someone had an idea to simplify it (no-one responded, so it’s perfect probably 🙂)

> [@Suggestions to simplify flows for 'slowly' changing light colour and brightness](https://community.homey.app/t/suggestions-to-simplify-flows-for-slowly-changing-light-colour-and-brightness/17279):
>
> (( apologies for the formatting of the post. I’ll try to fix it if it is too messy at first )) Hi, I was wondering if people here have an idea to simplify a number of flows I currently have. End-goal: My end-goal is the following: I want my Philips Hue white ambiance (For those who are not familiar with it: They are white bulbs, varying light from very cold (blueish) to very warm (amberish) and everything in between) to slowly go ‘warmer’ based on the position of the sun. So, Suppose the l…

In your case it would boil down to this:  
First flow: (don’t turn on light here)  
Set variable to 0.1 (10%)  
Send event  
Start next flow

2nd flow: If variable is smaller than 1.0 Increase variable to +0.01  
Then restart this flow after 5 seconds (or something)  
Else send push message “light is 100%”

3rd flow:  
If variable is changed  
Set bulb to variable value

So:  
The first flow starts everything and sends you a message  
The second flow loops and changes a variable by a small value every so many seconds  
This way the 3rd flow manages the bulb brightness directly when the variable changes

In my example the bulb would raise from 10% to 100% (900 steps \* 5 seconds = 4500 seconds / 75 minutes)  
You may need to tweak it a little here and there, but the base idea works for me.
