Call a logicblock from a logicblock

I understand there is a concern for the endless loop, but I would just love to be able to “chain” logic blocks together using IF and AND so that we get the right out come depending on conditions
I used to use Stringify till the got bought out and service withdrawn. And that use to be perfect for setting up “flows” to achieve my desired results. And it was visual which made it a lot easier me to follow

1 Like

Another use case: I want to close the garage door via voice and get a notification in case the door could not be closed.

It would go like this:
Alexa command “close door” -> IFTTT -> Logicblock 1 (close the door via SmartLife) --> wait 15 sec --> Logic Block 2 (verify door is closed via SmartLife sensor) --> Notify user via IFTTT is door is not closed.

Right now, I need an IFTTT applet in the middle which does nothing but invoke the second LB:
Alexa command “close door” -> IFTTT -> Logicblock 1 (close the door via SmartLife) --> wait 15 sec --> Trigger IFTTT applet via Apilio event --> Logic Block 2 (verify door is closed via SmartLife sensor) --> Notify user via IFTTT is door is not closed.

4 Likes

Hello :slight_smile: we now have a way to stay within Apilio and connect your Logicblocks: you can call a Logicblock from a Logicblock using the new webhooks.

This is how you could set it up:

  1. Go to the Logicblock you want to evaluate as a result of another evaluation and, from the show view, copy the evaluation webhook:

  2. Now go to the second Logicblock, the one that is going to call the first one, and create an HTTP action

  3. In the action, paste your evaluation webhook in the URL.

  4. Save your Logicblock

Now when you evaluate the Logicblock that has the HTTP action, it will launch the evaluation of the other Logicblock.

You can also use this method to update a variable as a result of a Logicblock being evaluated: use the webhook URL to update the variable in a webhook action.

I’ll probably write a more detailed step-by-step guide on how to set this up :slight_smile: Let me know if this initial idea helps! Thanks

1 Like

#amazing :bowing_man: thank you!

@Anna, is there any reason why you selected “PATCH” as HTTP method in your screenshot? I always use GET to call other logicblocks

2 Likes

Woops, sorry about that funky screenshot! I didn’t notice.

You are totally right, Apilio only accepts GET or POST. I’ve fixed the silly screenshot:

1 Like

No problem, I guessed so.

1 Like