Hello, I need your help. ( webhook production no start )

I use n8n self-hosted on the Render platform, I have created a workflow triggered by a webhook and linked to my web interface for the front end, when I trigger the workflow in test mode and send my request from my web app everything works correctly, but when I try to go to production (I changed the redirection url in my front end), nothing happens, and I get an error displayed on my web app.



n8n version 1.100.1

Hey @sacha_fontrouge hope all is well, welcome to the community.

If you try to open the production url in the browser directly, what happens?

hey @jabbson, here’s the error I get in my browser: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

So I’d assume the the workflow returns a JSON?

yes, the workflow returns a Json to display the generated image in my web app

Do you think you could you embed the workflow with pinned JSON which Respond to Webhook node uses to respond?

voici le json de tout le workflow :{
“nodes”: [
{
“parameters”: {
“multipleMethods”: true,
“httpMethod”: [
“POST”
],
“path”: “DigitADS”,
“responseMode”: “responseNode”,
“options”: {}
},
“type”: “n8n-nodes-base.webhook”,
“typeVersion”: 2,
“position”: [
0,
0
],
“id”: “4a53f626-21f4-4564-a3aa-21d171a1c3f0”,
“name”: “Webhook”,
“webhookId”: “b4ff16aa-2a6b-4f0a-9050-5f5e50a8adc7”
},
{
“parameters”: {
“modelId”: {
“__rl”: true,
“value”: “o3-mini”,
“mode”: “list”,
“cachedResultName”: “O3-MINI”
},
“messages”: {
“values”: [
{
“content”: “=Tu es un expert en conception de prompts pour des visuels publicitaires modernes et percutants. À partir des choix de l’utilisateur, génère une description visuelle impactante, orientée marque, optimisée pour la génération d’images (ex : FLUX, MidJourney, Stable Diffusion). Concentre-toi sur la composition, l’identité de marque, le contexte produit/service et l’émotion dégagée.\nProduit/Service/Thème : {{ $json.body.briefText }}\nMots-clés supplémentaires : {{ $json["additionalKeywords"] || ‘’ }}\n\nRédige une seule phrase, riche visuellement, décrivant une scène publicitaire moderne. Inclue :\nUn sujet clair (ex : produit, personne ou scène en lien avec la marque ou la campagne)\nUn environnement et une perspective (ex : rue urbaine, intérieur cosy, extérieur dynamique, gros plan, plan large)\nL’éclairage et l’atmosphère (ex : lumière du jour vibrante, ombres marquées, lueur douce, contraste élevé)\nDes accents de couleurs de la marque (intègre les couleurs fournies si possible)\nDes détails qui suscitent l’émotion ou l’action (ex : mouvement énergique, reflets élégants, composition dynamique, éléments de branding subtils)\nÉvite toute narration, dialogue ou langage technique. N’utilise pas “une image de” ou “un prompt pour”. Retourne uniquement le prompt dans un objet JSON exemple :\n\n{\n "prompt": "Une chaussure de course élégante aux couleurs bleu et or de la marque jaillit à travers une éclaboussure d’eau sur une avenue ensoleillée, angle dynamique, mouvement énergique, reflets nets, style publicitaire moderne, éclairage cinématographique."\n}\n\n\nadapte la demande de l’utilisateur ({{ $json.prompt }})”
}
]
},
“jsonOutput”: true,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.openAi”,
“typeVersion”: 1.8,
“position”: [
440,
0
],
“id”: “f500c51b-2de9-4a52-bdca-cf867f8061e6”,
“name”: “Generate Prompt1”,
“credentials”: {
“openAiApi”: {
“id”: “Nbm66tp9VHV7eKUx”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“operation”: “toBinary”,
“sourceProperty”: “data[0].b64_json”,
“options”: {}
},
“type”: “n8n-nodes-base.convertToFile”,
“typeVersion”: 1.1,
“position”: [
1020,
0
],
“id”: “5fd4efcd-5fc6-4cf7-aa55-8f0f73e31a9e”,
“name”: “Convert to File1”
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://api.openai.com/v1/images/generations”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Authorization”,
“value”: “Bearer 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”
},
{
“name”: “Authorization”,
“value”: “Bearer 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”
}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “model”,
“value”: “gpt-image-1”
},
{
“name”: “prompt”,
“value”: “={{ $json.message.content.prompt }}”
},
{
“name”: “size”,
“value”: “=auto”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
800,
0
],
“id”: “a0476916-e996-40a7-9532-a9b988ce8e88”,
“name”: “Image (OpenAI)”
},
{
“parameters”: {
“values”: {
“string”: [
{
“name”: “prompt”,
“value”: “={{$json.body.briefText}}”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 2,
“position”: [
220,
0
],
“id”: “99eb5537-09ee-4f03-a3aa-f863e6c0e00f”,
“name”: “Edit Fields (Set)”
},
{
“parameters”: {
“values”: {
“string”: [
{
“name”: “image_url”,
“value”: “={{$json.data[0].url}}{{ $(‘Image (OpenAI)’).item.json.output_format }}”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 2,
“position”: [
1240,
0
],
“id”: “45d57740-cc03-4c85-b777-ac0f070108da”,
“name”: “Edit Fields (Set)1”
},
{
“parameters”: {
“enableResponseOutput”: true,
“respondWith”: “json”,
“responseBody”: “={\n "url": "{{ $json.url }}"\n}”,
“options”: {
“responseCode”: 200
}
},
“type”: “n8n-nodes-base.respondToWebhook”,
“typeVersion”: 1.4,
“position”: [
1680,
0
],
“id”: “2427c47e-9508-415c-8ff3-de979199dbbe”,
“name”: “Respond to Webhook”,
“alwaysOutputData”: true,
“executeOnce”: true
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://api.cloudinary.com/v1_1/dy6rstttw/image/upload”,
“authentication”: “genericCredentialType”,
“genericAuthType”: “httpBasicAuth”,
“sendBody”: true,
“contentType”: “multipart-form-data”,
“bodyParameters”: {
“parameters”: [
{
“parameterType”: “formBinaryData”,
“name”: “file”,
“inputDataFieldName”: “data”
},
{
“name”: “upload_preset”,
“value”: “DigitAds”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
1460,
0
],
“id”: “6df4cf3c-d800-465c-9654-b0b1ef368de1”,
“name”: “HTTP Request”,
“credentials”: {
“httpBasicAuth”: {
“id”: “vmyMtTSfhNrD1d7Z”,
“name”: “Unnamed credential 2”
}
}
}
],
“connections”: {
“Webhook”: {
“main”: [
[
{
“node”: “Edit Fields (Set)”,
“type”: “main”,
“index”: 0
}
],

]
},
“Generate Prompt1”: {
“main”: [
[
{
“node”: “Image (OpenAI)”,
“type”: “main”,
“index”: 0
}
]
]
},
“Convert to File1”: {
“main”: [
[
{
“node”: “Edit Fields (Set)1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Image (OpenAI)”: {
“main”: [
[
{
“node”: “Convert to File1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields (Set)”: {
“main”: [
[
{
“node”: “Generate Prompt1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields (Set)1”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “Respond to Webhook”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “85cbd813e14804f4f27b01cb78a1504a747c60c6a26b8f0778d211b2ee652b92”
}
}

Could you please try to follow the embed process, so that it is the workflow that is actually embedded and not the JSON of the workflow?

voici le workflow :


voici le node respond to webhook :

Please click on → embed

It needs to look like this:

Can you pin or paste the json which is used as an input to the webhook response node?
Also, it looks like your n8n is out of date.

Voici le JSON de réponse dans mon nœud “Respond to Webhook” :
{
“url”: “{{ $json.url }}”
}

Ma version n8n est : 1.100.1

No I mean the actual value of that $json, of the value of that $json.url.
Alternatively you could try to change {{ $json.url }} to an actual url and see if that work.

I’ll run the workflow as a test to show you what happens.

I’ve reached my GPT usage quota for today, the workflow doesn’t start

Well, if you can exclude the GPT from the equation, and just test the webhook response with some url, you could continue troubleshooting, but whatever is convenient for you.

I’ve tried replacing the node with a basic llm chain but nothing works.