How to make a flow fail (return an error, exception)

Hi Everyone,

how can I make a flow fail, that a calling flow will be aware of the failure.

I have an advanced flow, which I start from another advanced flow (like an subroutine) and when in the subroutine-flow an error occurs, I want to give this back to the calling flow to proceed on the red line.

thanks in advance
bischowski

1 Like

There are no subroutines.

Best is to call the original flow with for example a number tag that indicates the Error.

The excellent app Advanced Triggers has an option to return values but after trying it, I think the use case does not justify the complication.

You could set a variable in the called routine to indicate success or failure. E.g. set a boolean xxxFailed to true at the start and false at the successful outcome(s). You can then test the variable in the calling routine. I’ve just checked and when a called flow finishes it does return control to the calling flow so you can chain a test of the variable after the call.

For more information, you could use a string variable to store error messages and use ‘success’ to indicate successful completion.

If you don’t get control back in your situation, you could try adding a branch before the call with a delay before testing the variable. A kludge, but it might do what you need.

Andy

In 3+ years I’ve never experienced a flow itself fails for unknown reasons
It’s always:

  • me: I did something stupid, like deleting a variable which still was used in a flow
  • a variable which got an invalid value somehow
  • app crash / paused app: this causes all related flowcards to become unavailable. The flow breaks, and stops functioning, but,
    This wonderful app monitors all those variables, breaks, errors and mistakes and notifies you: Flow Checker

Advice: add Simple Log app log cards to each and every part of your flows, to be able to search historical data.
It even has a script to add log cards to all flows.

2 Likes

Well, starting a flow from another flow with text (JSON in this case) seems to be very close to a subroutine/procedure call in my opionion. The start-flow-with-text-card has a error-branch. How to use this branch, when there is no way to make the flow fail/return error state?

But nevertheless, thanks for the feedback. SimpleLog needs to do the job until this might be added in the future.

Grab your chance here, and ask why its absent, and/or propose what you’d like to see:

1 Like

There are a lot more important things to do for athom. Many of them are already asked. I will try to find the time to join the event, but … hmm, how to say. Even though I love homey for many years, I’m not a athom fanboy. Even if they created an amazing product, I don’t like their closed doors politics and the way they handle problems.

1 Like