diff --git a/apps/viewer/src/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts b/apps/viewer/src/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts index 44ae3eaa7..c0202b01a 100644 --- a/apps/viewer/src/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts +++ b/apps/viewer/src/pages/api/typebots/[typebotId]/blocks/[blockId]/executeWebhook.ts @@ -239,7 +239,7 @@ const getBodyContent = variables: Variable[] isCustomBody?: boolean }): Promise => { - return isEmpty(body) && isCustomBody !== true + return body === '{{state}}' || isEmpty(body) || isCustomBody !== true ? JSON.stringify( resultValues ? parseAnswers({ diff --git a/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts b/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts index d14233102..7b3c17272 100644 --- a/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts +++ b/packages/bot-engine/blocks/integrations/webhook/executeWebhookBlock.ts @@ -223,7 +223,7 @@ const getBodyContent = async ({ variables: Variable[] isCustomBody?: boolean }): Promise => { - return isEmpty(body) && isCustomBody !== true + return body === '{{state}}' || isEmpty(body) || isCustomBody !== true ? JSON.stringify( parseAnswers({ answers,