AutomationFlowsWeb Scraping › Content Image

Content Image

40_30_CONTENT_IMAGE. Uses httpRequest. Webhook trigger; 13 nodes.

Webhook trigger★★★★☆ complexity13 nodesHTTP Request
Web Scraping Trigger: Webhook Nodes: 13 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "40_30_CONTENT_IMAGE",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "content-image",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "webhook-trigger",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Input: { pipeline_job_id, topic, category, prompt? }\nconst body = $input.first().json.body ?? $input.first().json;\nconst prompt = body.prompt ?? `Professional hero image for blog titled \"${body.topic}\" in category \"${body.category}\". Style: professional, modern, cinematic. High quality, suitable for web header, no text overlays.`;\n\nreturn [{ json: { ...body, prompt, width: 1024, height: 1024 } }];"
      },
      "id": "prepare-prompt",
      "name": "Prompt vorbereiten",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        460,
        300
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://genai-api.picsart.io/v1/text2image",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-picsart-api-key",
              "value": "={{ $env.PICSART_API_KEY }}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "json",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.prompt }}"
            },
            {
              "name": "width",
              "value": "={{ $json.width }}"
            },
            {
              "name": "height",
              "value": "={{ $json.height }}"
            },
            {
              "name": "count",
              "value": 1
            }
          ]
        },
        "options": {
          "timeout": 30000
        }
      },
      "id": "picsart-start",
      "name": "Picsart: Job starten",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "amount": 5,
        "unit": "seconds"
      },
      "id": "wait-5s",
      "name": "5s warten",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        900,
        300
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "=https://genai-api.picsart.io/v1/text2image/inferences/{{ $('Picsart: Job starten').item.json.inference_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-picsart-api-key",
              "value": "={{ $env.PICSART_API_KEY }}"
            }
          ]
        },
        "options": {
          "timeout": 15000
        }
      },
      "id": "picsart-poll",
      "name": "Picsart: Status pr\u00fcfen",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1120,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true
          },
          "conditions": [
            {
              "id": "done-check",
              "leftValue": "={{ $json.status }}",
              "rightValue": "success",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ]
        }
      },
      "id": "check-done",
      "name": "Fertig?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        1340,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Bild-URL aus Picsart-Response extrahieren\nconst pollData  = $('Picsart: Status pr\u00fcfen').item.json;\nconst imageUrl  = pollData.data?.[0]?.url ?? '';\nconst inferenceId = $('Picsart: Job starten').item.json.inference_id;\nconst jobData   = $('Prompt vorbereiten').item.json;\n\nif (!imageUrl) throw new Error('Keine Bild-URL in Picsart-Response');\n\n// Dateiname aus URL ableiten\nconst urlParts = imageUrl.split('/');\nconst rawName  = urlParts[urlParts.length - 1].split('?')[0];\nconst fileName = `picsart-${inferenceId}-${rawName || 'image.jpg'}`;\n\nreturn [{ json: { ...jobData, imageUrl, inferenceId, fileName, mimeType: 'image/jpeg' } }];"
      },
      "id": "extract-url",
      "name": "Bild-URL extrahieren",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1560,
        220
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{ $json.imageUrl }}",
        "options": {
          "responseFormat": "file"
        }
      },
      "id": "download-image",
      "name": "Bild herunterladen",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1780,
        220
      ]
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "=https://noco-aios.fsn1.your-objectstorage.com/assets/image/{{ $now.format('yyyy-MM-dd') }}/{{ $('Bild-URL extrahieren').item.json.fileName }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "image/jpeg"
            },
            {
              "name": "x-amz-acl",
              "value": "public-read"
            }
          ]
        },
        "sendBody": true,
        "contentType": "binaryData",
        "inputDataFieldName": "data",
        "options": {
          "timeout": 30000
        }
      },
      "id": "upload-s3",
      "name": "S3 Upload",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2000,
        220
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://directus.automation-plus-ki.de/items/420_media_assets",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer ={{ $env.DIRECTUS_TOKEN }}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "json",
        "bodyParameters": {
          "parameters": [
            {
              "name": "source_service",
              "value": "picsart"
            },
            {
              "name": "asset_type",
              "value": "image"
            },
            {
              "name": "s3_url",
              "value": "=https://noco-aios.fsn1.your-objectstorage.com/assets/image/{{ $now.format('yyyy-MM-dd') }}/{{ $('Bild-URL extrahieren').item.json.fileName }}"
            },
            {
              "name": "file_name",
              "value": "={{ $('Bild-URL extrahieren').item.json.fileName }}"
            },
            {
              "name": "mime_type",
              "value": "image/jpeg"
            },
            {
              "name": "pipeline_job_id",
              "value": "={{ $('Prompt vorbereiten').item.json.pipeline_job_id }}"
            },
            {
              "name": "prompt_used",
              "value": "={{ $('Prompt vorbereiten').item.json.prompt }}"
            },
            {
              "name": "status",
              "value": "ready"
            },
            {
              "name": "created_at",
              "value": "={{ $now.toISO() }}"
            }
          ]
        }
      },
      "id": "nocodb-asset",
      "name": "NocoDB: media_assets anlegen",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2220,
        220
      ]
    },
    {
      "parameters": {
        "method": "PATCH",
        "url": "https://directus.automation-plus-ki.de/items/400_content_pipeline",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer ={{ $env.DIRECTUS_TOKEN }}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "json",
        "bodyParameters": {
          "parameters": [
            {
              "name": "Id",
              "value": "={{ $('Prompt vorbereiten').item.json.pipeline_job_id }}"
            },
            {
              "name": "image_url",
              "value": "=https://noco-aios.fsn1.your-objectstorage.com/assets/image/{{ $now.format('yyyy-MM-dd') }}/{{ $('Bild-URL extrahieren').item.json.fileName }}"
            },
            {
              "name": "stage",
              "value": "voice"
            },
            {
              "name": "status",
              "value": "idle"
            },
            {
              "name": "updated_at",
              "value": "={{ $now.toISO() }}"
            }
          ]
        }
      },
      "id": "update-pipeline",
      "name": "Pipeline Job aktualisieren",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        2440,
        220
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={ \"ok\": true, \"s3_url\": \"https://noco-aios.fsn1.your-objectstorage.com/assets/image/{{ $now.format('yyyy-MM-dd') }}/{{ $('Bild-URL extrahieren').item.json.fileName }}\", \"pipeline_job_id\": \"{{ $('Prompt vorbereiten').item.json.pipeline_job_id }}\" }"
      },
      "id": "respond-ok",
      "name": "Response OK",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        2660,
        220
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={ \"ok\": false, \"error\": \"Picsart noch nicht fertig \u2014 bitte retry\" }",
        "options": {
          "responseCode": 202
        }
      },
      "id": "respond-retry",
      "name": "Response: Retry",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1560,
        400
      ]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Prompt vorbereiten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompt vorbereiten": {
      "main": [
        [
          {
            "node": "Picsart: Job starten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Picsart: Job starten": {
      "main": [
        [
          {
            "node": "5s warten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5s warten": {
      "main": [
        [
          {
            "node": "Picsart: Status pr\u00fcfen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Picsart: Status pr\u00fcfen": {
      "main": [
        [
          {
            "node": "Fertig?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fertig?": {
      "main": [
        [
          {
            "node": "Bild-URL extrahieren",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Response: Retry",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bild-URL extrahieren": {
      "main": [
        [
          {
            "node": "Bild herunterladen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bild herunterladen": {
      "main": [
        [
          {
            "node": "S3 Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "S3 Upload": {
      "main": [
        [
          {
            "node": "NocoDB: media_assets anlegen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB: media_assets anlegen": {
      "main": [
        [
          {
            "node": "Pipeline Job aktualisieren",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pipeline Job aktualisieren": {
      "main": [
        [
          {
            "node": "Response OK",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1",
    "saveManualExecutions": true,
    "callerPolicy": "workflowsFromSameOwner",
    "errorWorkflow": ""
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "40_30_CONTENT_IMAGE_v1",
  "tags": [
    {
      "name": "content-pipeline"
    }
  ]
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

40_30_CONTENT_IMAGE. Uses httpRequest. Webhook trigger; 13 nodes.

Source: https://github.com/timo-goetz-ai/apki-core-platform/blob/main/automations/n8n-workflows/content-pipeline/40_30_CONTENT_IMAGE.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

This n8n template provides enterprise-level version control for your workflows using GitHub integration. Stop losing hours to broken workflows and manual exports – get proper commit history, visual di

n8n, Execute Workflow Trigger, HTTP Request +1
Web Scraping

This flow creates dummy files for every item added in your *Arrs (Radarr/Sonarr) with the tag .

HTTP Request, Ssh
Web Scraping

eek-Go v2 (Batch-Then-Review). Uses httpRequest. Webhook trigger; 75 nodes.

HTTP Request
Web Scraping

This workflow receives webhook requests from a content calendar and uses the X API v2 to publish text posts, threads, image/video posts, and polls, as well as delete existing posts and run a credentia

HTTP Request
Web Scraping

This workflow acts as a central API gateway for all technical indicator agents in the Binance Spot Market Quant AI system. It listens for incoming webhook requests and dynamically routes them to the c

HTTP Request