mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(Respond to Webhook Node): JSON output from expression fix (#7294)
Github issue / Community forum post (link here to close automatically): https://github.com/n8n-io/n8n/issues/7077
This commit is contained in:
parent
53a7502d20
commit
8bc369dd40
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue