# How to structure your flows

**URL:** <https://community.homey.app/t/how-to-structure-your-flows/25109>\
**Category:** Flows\
**Created:** [January 27, 2020, 10:31pm UTC](https://community.homey.app/t/how-to-structure-your-flows/25109 "2020-01-27T22:31:04Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![FKey](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/fkey/32/14793_2.png) [@FKey](https://community.homey.app/u/FKey)\
**Post date:** [January 27, 2020, 11:11pm UTC](https://community.homey.app/t/how-to-structure-your-flows/25109/11 "2020-01-27T23:11:19Z")

</div>

How to structure flows: **prepare your flows for debugging**

Bugs and strange behaviour, it will always happen.  
So you better be prepared…  
Structuring your flows makes it easier to find bugs, but you need a start for your bug search

- install a logging app (search the app store: [papertrails](https://homey.app/nl-nl/app/nu.dijker.papertrails/PaperTrails-Logboek/), [simple log](https://homey.app/nl-nl/app/nl.nielsdeklerk.log/Simple-LOG/)…)

1. Make sure _every THEN section_ in your flows has a logging point
2. If you use an AND also make sure to add a logging point in _the ELSE section_. Especially if your Else section does not have any cards! (How else can you determine if the flow triggered and hit the Else or did not trigger at all)
3. If you add a (long) delay, make sure to also add a logging point with that same delay. (After 1hr switch off the light, how will you ever trace that one if you do not log)

- set up [flow viewer](https://community.homey.app/t/how-to-view-your-homey-v2-flows-in-a-browser/7427)

1. In case of bugs, run flow viewer
2. Use the web browser to print to pdf
3. Open the file in a pdf viewer that support searching
4. Now you can search for the logging text or a device

---

_[View the full topic](https://community.homey.app/t/how-to-structure-your-flows/25109)._
