diff --git a/packages/bot-engine/src/continueBotFlow.ts b/packages/bot-engine/src/continueBotFlow.ts index 9e53ff402..1a9b0d53f 100644 --- a/packages/bot-engine/src/continueBotFlow.ts +++ b/packages/bot-engine/src/continueBotFlow.ts @@ -283,11 +283,16 @@ const processNonInputBlock = async ({ try { response = JSON.parse(reply.text); } catch (err) { - throw new TRPCError({ - code: "BAD_REQUEST", - message: "Provided response is not valid JSON", - cause: (await parseUnknownError({ err })).description, - }); + if (block.type === IntegrationBlockType.HTTP_REQUEST) + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Provided response is not valid JSON", + cause: (await parseUnknownError({ err })).description, + }); + response = { + statusCode: 200, + data: reply.text, + }; } const result = saveDataInResponseVariableMapping({ state,