Parallel nodes - ERROR: no data, execute ... node first

Describe the problem/error/question

Dear Community,

So I created a simple workflow to parse an email with a photo attachment and create a Wordpress post out of it. Here is what it does:

  • gets the body text of the email and passes it on to OpenAI to generate a more elaborate Post
  • creates the Post using the WordPress node
  • since the WordPress node cannot attach the photo to that Post, the workaround is using HTTP-Request node to upload to WordPress (due to the way WordPress works, you need to first upload the image to the Media folder, and then go and map the id of the image to the id of the Post)
  • an HTTP-Request node takes the photo (attachment_0) and uploads it to WordPress media (POST to /wp-json/wp/v2/media)
  • another HTTP-Request node (HTTP-Request1) takes the “image id” coming from the previous HTTP-Request and the “Post id” coming from the WordPress node, and maps the two (POST to /wp-json/wp/v2/posts//{{ $(‘Wordpress’).first().json.id }} - using the appropriate id from the WordPress node)

The workflow works fine when I test the nodes one by one, but when I test the entire workflow, it appears that only the first path executed, not the second:

What is the error message (if any)?

Error Message:

Problem in node “HTTP Request1”
no data, execute “HTTP Request” first

Note that the arrows turn green for both paths, but the arrow joining the two paths stays gray:

Please share your workflow

{
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “9ab2a49c1c944967cfc4b110219876b9a892b46c2abf81cd972048f349c88f20”
},
“nodes”: [
{
“parameters”: {
“modelId”: {
“__rl”: true,
“value”: “gpt-3.5-turbo”,
“mode”: “list”,
“cachedResultName”: “GPT-3.5-TURBO”
},
“messages”: {
“values”: [
{
“content”: “Take the following as an input and write an engaging blog post on this topic of approx. 500 words. Make sure the output is in British English.”
},
{
“content”: “={{ $json.text }}”
}
]
},
“options”: {}
},
“id”: “78380acf-238c-4091-9f71-15bc76c7410d”,
“name”: “OpenAI”,
“type”: “@n8n/n8n-nodes-langchain.openAi”,
“typeVersion”: 1,
“position”: [
880,
140
],
“credentials”: {
“openAiApi”: {
“id”: “WLNOTZyR5iGpOYyN”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“format”: “resolved”,
“options”: {}
},
“id”: “bdf78209-e82a-4a4a-bebe-bdf8f2821ec2”,
“name”: “Email Trigger (IMAP)”,
“type”: “n8n-nodes-base.emailReadImap”,
“typeVersion”: 2,
“position”: [
600,
320
],
“credentials”: {
“imap”: {
“id”: “HwMNuOZQLlPeZ4D4”,
“name”: “IMAP account”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://costablancacalida.com/wp-json/wp/v2/media”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “wordpressApi”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Content-Disposition”,
“value”: “attachment; filename="image.png"”
}
]
},
“sendBody”: true,
“contentType”: “binaryData”,
“inputDataFieldName”: “attachment_0”,
“options”: {}
},
“id”: “5a30f074-4060-4162-af0d-f9ceffc73780”,
“name”: “HTTP Request”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.1,
“position”: [
1280,
320
],
“credentials”: {
“wordpressApi”: {
“id”: “Y18pQHGrWxfORFjR”,
“name”: “Wordpress account”
}
}
},
{
“parameters”: {
“title”: “={{ $(‘Email Trigger (IMAP)’).item.json.headers.subject.replace("Subject: ", "") }}”,
“additionalFields”: {
“content”: “={{ $json.message.content }}”,
“status”: “publish”,
“commentStatus”: “open”,
“categories”: [
6
]
}
},
“id”: “9666288b-90bc-4e48-850b-47a1d37b7926”,
“name”: “Wordpress”,
“type”: “n8n-nodes-base.wordpress”,
“typeVersion”: 1,
“position”: [
1280,
140
],
“credentials”: {
“wordpressApi”: {
“id”: “Y18pQHGrWxfORFjR”,
“name”: “Wordpress account”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “=https://costablancacalida.com/wp-json/wp/v2/posts/{{ $(‘Wordpress’).first().json.id }}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “wordpressApi”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{}
]
},
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “featured_media”,
“value”: “={{ $(‘HTTP Request’).first().json.id }}”
}
]
},
“options”: {}
},
“id”: “bc648ec0-e806-4246-97f2-008dd7cb16d4”,
“name”: “HTTP Request1”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.1,
“position”: [
1520,
140
],
“credentials”: {
“wordpressApi”: {
“id”: “Y18pQHGrWxfORFjR”,
“name”: “Wordpress account”
}
}
}
],
“connections”: {
“OpenAI”: {
“main”: [
[
{
“node”: “Wordpress”,
“type”: “main”,
“index”: 0
}
]
]
},
“Email Trigger (IMAP)”: {
“main”: [
[
{
“node”: “OpenAI”,
“type”: “main”,
“index”: 0
},
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
},
“HTTP Request”: {
“main”: [
[
{
“node”: “HTTP Request1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Wordpress”: {
“main”: [
[
{
“node”: “HTTP Request1”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {}
}

Share the output returned by the last node

The Post gets created in WordPress, but the image does not upload when I test the entire workflow (the node HTTP-Request does not execute)

Do I need to do anything in particular to get the second path to execute when the trigger node fires (i.e., when an email is received)?

Thanks for your help!

Information on your n8n setup

  • n8n version: latest
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows 10

@maraboux , your workflow has a flow in my opinion. HTTP Request node’s output needs to be merged with the output of Wordpress. The merged data containing now the post ID and the image ID can be fed into HTTP Request1 node. Visually, it should look something like this

1 Like

Awesome!
That was exactly it - just added the merge node and everything works perfectly!
Thanks!

For everyone’s reference, here is the updated workflow (I also changed the name of the nodes to make it more understandable):

{
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “9ab2a49c1c944967cfc4b110219876b9a892b46c2abf81cd972048f349c88f20”
},
“nodes”: [
{
“parameters”: {
“modelId”: {
“__rl”: true,
“value”: “gpt-3.5-turbo”,
“mode”: “list”,
“cachedResultName”: “GPT-3.5-TURBO”
},
“messages”: {
“values”: [
{
“content”: “Take the following as an input and write an engaging blog post on this topic of approx. 500 words. Make sure the output is in British English.”
},
{
“content”: “={{ $json.text }}”
}
]
},
“options”: {}
},
“id”: “78380acf-238c-4091-9f71-15bc76c7410d”,
“name”: “OpenAI”,
“type”: “@n8n/n8n-nodes-langchain.openAi”,
“typeVersion”: 1,
“position”: [
880,
140
],
“credentials”: {
“openAiApi”: {
“id”: “WLNOTZyR5iGpOYyN”,
“name”: “OpenAi account”
}
}
},
{
“parameters”: {
“format”: “resolved”,
“options”: {}
},
“id”: “bdf78209-e82a-4a4a-bebe-bdf8f2821ec2”,
“name”: “Email Trigger (IMAP)”,
“type”: “n8n-nodes-base.emailReadImap”,
“typeVersion”: 2,
“position”: [
600,
320
],
“credentials”: {
“imap”: {
“id”: “HwMNuOZQLlPeZ4D4”,
“name”: “IMAP account”
}
}
},
{
“parameters”: {
“method”: “POST”,
“url”: “https://costablancacalida.com/wp-json/wp/v2/media”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “wordpressApi”,
“sendHeaders”: true,
“headerParameters”: {
“parameters”: [
{
“name”: “Content-Disposition”,
“value”: “attachment; filename="image.png"”
}
]
},
“sendBody”: true,
“contentType”: “binaryData”,
“inputDataFieldName”: “attachment_0”,
“options”: {}
},
“id”: “5a30f074-4060-4162-af0d-f9ceffc73780”,
“name”: “Upload Image to WP”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.1,
“position”: [
1280,
320
],
“credentials”: {
“wordpressApi”: {
“id”: “Y18pQHGrWxfORFjR”,
“name”: “Wordpress account”
}
}
},
{
“parameters”: {
“title”: “={{ $(‘Email Trigger (IMAP)’).item.json.headers.subject.replace("Subject: ", "") }}”,
“additionalFields”: {
“content”: “={{ $json.message.content }}”,
“status”: “publish”,
“commentStatus”: “open”,
“categories”: [
6
]
}
},
“id”: “9666288b-90bc-4e48-850b-47a1d37b7926”,
“name”: “Wordpress”,
“type”: “n8n-nodes-base.wordpress”,
“typeVersion”: 1,
“position”: [
1280,
140
],
“credentials”: {
“wordpressApi”: {
“id”: “Y18pQHGrWxfORFjR”,
“name”: “Wordpress account”
}
}
},
{
“parameters”: {},
“id”: “df04007a-0257-4f81-b8f1-bf1478902c12”,
“name”: “Merge”,
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 2.1,
“position”: [
1460,
240
]
},
{
“parameters”: {
“method”: “POST”,
“url”: “=https://costablancacalida.com/wp-json/wp/v2/posts/{{ $(‘Wordpress’).first().json.id }}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “wordpressApi”,
“sendBody”: true,
“bodyParameters”: {
“parameters”: [
{
“name”: “featured_media”,
“value”: “={{ $(‘Upload Image to WP’).first().json.id }}”
}
]
},
“options”: {}
},
“id”: “bc648ec0-e806-4246-97f2-008dd7cb16d4”,
“name”: “Set Featured Image of WP Post”,
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.1,
“position”: [
1660,
240
],
“credentials”: {
“wordpressApi”: {
“id”: “Y18pQHGrWxfORFjR”,
“name”: “Wordpress account”
}
}
}
],
“connections”: {
“OpenAI”: {
“main”: [
[
{
“node”: “Wordpress”,
“type”: “main”,
“index”: 0
}
]
]
},
“Email Trigger (IMAP)”: {
“main”: [
[
{
“node”: “OpenAI”,
“type”: “main”,
“index”: 0
},
{
“node”: “Upload Image to WP”,
“type”: “main”,
“index”: 0
}
]
]
},
“Upload Image to WP”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 1
}
]
]
},
“Wordpress”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 0
}
]
]
},
“Merge”: {
“main”: [
[
{
“node”: “Set Featured Image of WP Post”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {}
}