# Webhook reply recognized at device command but ignored after device state trigger

**URL:** <https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433>\
**Category:** Help\
**Tags:** workflow\
**Created:** [November 27, 2020, 7:58pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433 "2020-11-27T19:58:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Assouad](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@Nicolas\_Assouad](https://forums.losant.com/u/Nicolas_Assouad)\
**Post date:** [November 27, 2020, 7:58pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433/1 "2020-11-27T19:58:54Z")

</div>

Hello,  
I have the following workflow interfacing Amazon Alexa.

This is the path where the command is received

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/f1a3c765c858845741c86e5d5acdb6c7c25cd2ae.png)

Here is Alexa Showing the replay

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/69e0c4522a224470684ce359754c68f37df23b7a.png)

Following the execution of the command the “Device State” Triggers following the command execution  
with the following stat at the end of the execution:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/8/86b6f54c10107ee2eb8d5b6808a773bb820a9420.png)

The webhook in the end of execution path following the device state Trigger is never recognized by Alexa

Any idea? The Payloads between the before and after execution are entirely different…

bt the way “shouldEndSession”: false in the first responding webhook…

Thanks

---

<div class="post-metadata">

**Author:** ![Brandon\_Cannaday](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/brandon_cannaday/32/14_2.png) [@Brandon\_Cannaday](https://forums.losant.com/u/Brandon_Cannaday)\
**Post date:** [November 27, 2020, 11:31pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433/3 "2020-11-27T23:31:23Z")

</div>

You’ve encountered some workflow fundamentals that can take a little time to fully understand.

First, let’s explain how a webhook is handled and ultimately replied to. When a webhook triggers a workflow, it places a `replyId` on the payload at `data.replyId`. When you use a Webhook Reply Node, this ID is how to tell the workflow which request to actually reply to. You can see this field in your first screenshot. For convenience, the Webhook Reply Node defaults to the value at `data.replyId`, since it is the most common implementation.

When your workflow is triggered by the Device: State Trigger (second screenshot), there is no `replyId` anywhere on the payload, so when you attempt to use the Webhook Reply Node, the workflow has no idea which request to reply to.

Multiple triggers in the same workflow generate their own payloads and payloads are entirely separate and independent. The only way to share data between separate runs of a workflow is to use [Workflow Storage](https://docs.losant.com/workflows/overview/#workflow-storage).

So in this case, the workflow triggered by the Webhook must store the `replyId` in Workflow Storage so that a Webhook Reply Node in a different run is able to retrieve and use that value in its own Webhook Reply Node.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Assouad](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@Nicolas\_Assouad](https://forums.losant.com/u/Nicolas_Assouad)\
**Post date:** [November 27, 2020, 11:56pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433/4 "2020-11-27T23:56:33Z")

</div>

Thanks,  
Suspected I was missing something basic… Reason why displayed the two debug nodes.  
You could save half day of work if you elaborate on:

\<\<\< The only way to share data between separate runs of a workflow is to use [Workflow Storage](https://docs.losant.com/workflows/overview/#workflow-storage).

So in this case, the workflow triggered by the Webhook must store the `replyId` in Workflow Storage so that a Webhook Reply Node in a different run is able to retrieve and use that value in its own Webhook Reply Node.\>\>\>

Thanks

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [November 30, 2020, 5:06pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433/6 "2020-11-30T17:06:04Z")

</div>

@Nicolas_Assouad,

You can find a really good example and practice using Workflow Storage using the Workflow Lab:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/5/52019f295d94f6ff70df2e8e059c2f903efcdfe3.jpeg)

> **[Home](https://docs.losant.com/workflow-lab/lab/)**
>
> Welcome to the Losant Documentation!

You find example workflows for the lab on [Github](https://github.com/Losant/losant-workflow-lab/tree/master/solution-workflows/) 🙂

---

<div class="post-metadata">

**Author:** ![anaptfox](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/anaptfox/32/873_2.png) [@anaptfox](https://forums.losant.com/u/anaptfox)\
**Post date:** [November 30, 2020, 5:26pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433/10 "2020-11-30T17:26:38Z")

</div>

Nice! Thanks for the update.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Assouad](https://avatars.discourse-cdn.com/v4/letter/n/41988e/32.png) [@Nicolas\_Assouad](https://forums.losant.com/u/Nicolas_Assouad)\
**Post date:** [November 30, 2020, 5:29pm UTC](https://forums.losant.com/t/webhook-reply-recognized-at-device-command-but-ignored-after-device-state-trigger/3433/11 "2020-11-30T17:29:37Z")

</div>

Thanks…

I got it going over the weekend by saving the original payload (the entire {{data}} and not {{data.replyid)) ) then restoring after the ““device state”” trigger node and then adding the local device status using the “Mutate” node prior to the last “webhook node”… Works great…

By the way, I have an open issue with the google home/assistant webhook reply…. Sent all the requested data… never got any answer.

Thanks for the outstanding support
