# Check if call service was successful

**URL:** <https://discourse.nodered.org/t/check-if-call-service-was-successful/73986>\
**Category:** General\
**Created:** [20 January 2023 20:21 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986 "2023-01-20T20:21:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhysgh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rhysgh/32/74195_2.png) [@Rhysgh](https://discourse.nodered.org/u/Rhysgh)\
**Post date:** [20 January 2023 20:21 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/1 "2023-01-20T20:21:01Z")

</div>

Hi I'm looking for recommendations for checking that a call service was successful

Yes I can wait 5 min and check the state but I'm looking for a very fast method

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [20 January 2023 20:36 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/2 "2023-01-20T20:36:23Z")

</div>

Hi @Rhysgh

No one can possibly help with that question - unless we have mind readers?  
I use nodes that has functions to "call a service".

With that in mind..

- What nodes are you using
- What is a "service call", and is it related to the nodes you're using?

Context is key here!

---

<div class="post-metadata">

**Author:** ![Rhysgh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rhysgh/32/74195_2.png) [@Rhysgh](https://discourse.nodered.org/u/Rhysgh)\
**Post date:** [20 January 2023 20:43 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/3 "2023-01-20T20:43:21Z")

</div>

Apologies, I was intentionally vague as I'm looking for inspiration rather than a fixed answer.

I'm using Node-red in HA, and I'm using a HA call service node, I i suppose, really, as there's no call back then I cant get a handshake to confirm the action is complete.. I guess ill have to wait and check an entity for a state change

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [20 January 2023 20:53 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/4 "2023-01-20T20:53:56Z")

</div>

Ok...

We have very little HA users here, but I think you answered it already.

One solution...

Create a subflow that executes whatever you need it to (taking an input of some kind)  
The same subflow will then, after a predefined time, check the value - and the subflow can return `true` or `false` based on the returned value

---

<div class="post-metadata">

**Author:** ![Rhysgh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rhysgh/32/74195_2.png) [@Rhysgh](https://discourse.nodered.org/u/Rhysgh)\
**Post date:** [20 January 2023 21:05 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/5 "2023-01-20T21:05:31Z")

</div>

Can you point me in the direction for the use of subflows? Why / when are they used?

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [20 January 2023 21:20 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/6 "2023-01-20T21:20:42Z")

</div>

Of course @Rhysgh ...

[https://nodered.org/docs/user-guide/editor/workspace/subflows](https://nodered.org/docs/user-guide/editor/workspace/subflows)

A subflow is a set of nodes, that can be reused, but represneted as a single node.  
I like to refer to a subflow as a 'blueprint' of logic.

each subflow you drag on your main flow, is a new instance of that logic.

Import below:

```auto
[{"id":"38b7f1c3f33825ab","type":"subflow","name":"Demo Subflow","info":"","category":"","in":[{"x":95,"y":95,"wires":[{"id":"78b9dbeaf2ea18ea"}]}],"out":[{"x":405,"y":95,"wires":[{"id":"78b9dbeaf2ea18ea","port":0}]}],"env":[{"name":"Name","type":"str","value":""}],"meta":{},"color":"#DDAA99"},{"id":"78b9dbeaf2ea18ea","type":"function","z":"38b7f1c3f33825ab","name":"function 5","func":"return {payload:`${msg.payload} is ${env.get('Name')}`}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":235,"y":95,"wires":[[]]},{"id":"e703a32b10267363","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"06dce03e6ce072e8","type":"subflow:38b7f1c3f33825ab","z":"e703a32b10267363","name":"","env":[{"name":"Name","value":"Marcus","type":"str"}],"x":475,"y":210,"wires":[["409d1943f7071a81"]]},{"id":"6fbd9041dfff7e5a","type":"inject","z":"e703a32b10267363","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"My name is : ","payloadType":"str","x":200,"y":215,"wires":[["06dce03e6ce072e8"]]},{"id":"409d1943f7071a81","type":"debug","z":"e703a32b10267363","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":210,"wires":[]},{"id":"34aeedbbe962b4b4","type":"subflow:38b7f1c3f33825ab","z":"e703a32b10267363","name":"","env":[{"name":"Name","value":"Davies","type":"str"}],"x":470,"y":280,"wires":[["46647b63c51bb06c"]]},{"id":"5430c409fa325651","type":"inject","z":"e703a32b10267363","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"My surname is : ","payloadType":"str","x":205,"y":285,"wires":[["34aeedbbe962b4b4"]]},{"id":"46647b63c51bb06c","type":"debug","z":"e703a32b10267363","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":725,"y":280,"wires":[]}]

```

Your subflow will do the heavy lifting, and finally return `true` or `false` based on its internal logic

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 March 2023 21:21 UTC](https://discourse.nodered.org/t/check-if-call-service-was-successful/73986/7 "2023-03-21T21:21:29Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
