Skip to content

Commit

Permalink
fix(Respond to Webhook Node): JSON output from expression fix (#7294)
Browse files Browse the repository at this point in the history
Github issue / Community forum post (link here to close automatically):
#7077
  • Loading branch information
michael-radency authored Sep 28, 2023
1 parent 53a7502 commit 8bc369d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,13 @@ export class RespondToWebhook implements INodeType {
if (respondWith === 'json') {
const responseBodyParameter = this.getNodeParameter('responseBody', 0) as string;
if (responseBodyParameter) {
responseBody = jsonParse(responseBodyParameter, {
errorMessage: "Invalid JSON in 'Response Body' field",
});
if (typeof responseBodyParameter === 'object') {
responseBody = responseBodyParameter;
} else {
responseBody = jsonParse(responseBodyParameter, {
errorMessage: "Invalid JSON in 'Response Body' field",
});
}
}
} else if (respondWith === 'firstIncomingItem') {
responseBody = items[0].json;
Expand Down

0 comments on commit 8bc369d

Please sign in to comment.