Sorry for the late answer! It took me a while to come up with a way to do it currently without changing the code. It can be done with returning binary data.
Here a simple example workflow which receives the challenge via “GET” (to test easily) and the query parameter “challenge” returns it:
{
"nodes": [
{
"parameters": {
"path": "stripe",
"responseMode": "lastNode",
"responseData": "firstEntryBinary"
},
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [
500,
300
]
},
{
"parameters": {
"functionCode": "items[0].binary = {\n data: {\n data: new Buffer(items[0].json.query.challenge).toString('base64'),\n mimeType: 'text/plain',\n }\n}\nreturn items;"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
650,
300
]
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
}
}
}
So if test and you call the workflow like this:
http://localhost:5678/webhook-test/<WORKFLOW_ID>/webhook/stripe?challenge=test123
It should then return “test123” (without quotes)