AutomationFlowsWeb Scraping › Pixart Image

Pixart Image

40_410_PIXART_IMAGE. Uses httpRequest. Webhook trigger; 9 nodes.

Webhook trigger★★★★☆ complexity9 nodesHTTP Request
Web Scraping Trigger: Webhook Nodes: 9 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_410_PIXART_IMAGE",
  "nodes": [
    {
      "id": "wh-410",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "path": "pixart-image",
        "httpMethod": "POST",
        "responseMode": "onReceived",
        "options": {}
      }
    },
    {
      "id": "prep-410",
      "name": "Prompt vorbereiten",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        0
      ],
      "parameters": {
        "jsCode": "const raw = $input.first().json;\nconst d = raw.body ?? raw;  // typeVersion-2 webhook: body under .body\nconst topic = d.topic || 'abstract AI technology';\nconst cat   = d.category || 'KI-Tools';\nconst prompt = d.prompt ?? `Professional digital artwork for blog post about \"${topic}\". Category: ${cat}. Modern tech aesthetic, vibrant colors, 4K, no text.`;\nreturn [{json:{pipeline_job_id: d.pipeline_job_id||'test', prompt, topic, category:cat, width:1024, height:1024}}];"
      }
    },
    {
      "id": "picsart-410",
      "name": "Picsart Text2Image",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        480,
        0
      ],
      "parameters": {
        "method": "POST",
        "url": "https://genai-api.picsart.io/v1/text2image",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Picsart-API-Key",
              "value": "={{ $env.PICSART_API_KEY }}"
            },
            {
              "name": "Accept",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "contentType": "json",
        "bodyParameters": {
          "parameters": [
            {
              "name": "prompt",
              "value": "={{ $json.prompt }}"
            },
            {
              "name": "width",
              "value": "={{ $json.width || 1024 }}"
            },
            {
              "name": "height",
              "value": "={{ $json.height || 1024 }}"
            },
            {
              "name": "count",
              "value": "1"
            }
          ]
        },
        "options": {
          "timeout": 30000
        }
      }
    },
    {
      "id": "poll-wait",
      "name": "Warte 18s",
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1,
      "position": [
        720,
        0
      ],
      "parameters": {
        "unit": "seconds",
        "amount": 18
      }
    },
    {
      "id": "poll-status",
      "name": "Bild-Status pr\u00fcfen",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        960,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "=https://genai-api.picsart.io/v1/text2image/inferences/{{ $('Picsart Text2Image').item.json.inference_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Picsart-API-Key",
              "value": "={{ $env.PICSART_API_KEY }}"
            }
          ]
        }
      }
    },
    {
      "id": "get-url",
      "name": "Bild-URL extrahieren",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1200,
        0
      ],
      "parameters": {
        "jsCode": "const r=$input.first().json;\nconst pj=$('Prompt vorbereiten').item.json;\nconst url=r.data?.[0]?.url||r.url||'';\nreturn [{json:{image_url:url,pipeline_job_id:pj.pipeline_job_id,source:'picsart'}}];"
      }
    },
    {
      "id": "nocodb-410",
      "name": "NocoDB media_assets",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1440,
        0
      ],
      "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": "asset_id",
              "value": "={{ $randomString(12) }}"
            },
            {
              "name": "source_service",
              "value": "picsart"
            },
            {
              "name": "asset_type",
              "value": "image"
            },
            {
              "name": "s3_url",
              "value": "={{ $json.image_url }}"
            },
            {
              "name": "file_name",
              "value": "={{ 'img-' + $json.pipeline_job_id + '.jpg' }}"
            },
            {
              "name": "mime_type",
              "value": "image/jpeg"
            },
            {
              "name": "pipeline_job_id",
              "value": "={{ $json.pipeline_job_id }}"
            },
            {
              "name": "status",
              "value": "ready"
            },
            {
              "name": "created_at",
              "value": "={{ $now.toISO() }}"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "find-pipeline-410",
      "name": "Pipeline Job finden",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1680,
        0
      ],
      "onError": "continueRegularOutput",
      "parameters": {
        "method": "GET",
        "url": "https://directus.automation-plus-ki.de/items/400_content_pipeline?filter[job_id][_eq]=${$json.pipeline_job_id}&limit=1",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer ={{ $env.DIRECTUS_TOKEN }}"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "patch-pipeline-410",
      "name": "Pipeline-Job updaten",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1900,
        0
      ],
      "onError": "continueRegularOutput",
      "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",
        "body": "={{ JSON.stringify([{Id:$json.data?.[0]?.Id,image_url:$('Bild-URL extrahieren').item.json.image_url,stage:'voice',status:'running'}]) }}",
        "options": {
          "response": {
            "response": {
              "neverError": true
            }
          }
        }
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Prompt vorbereiten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompt vorbereiten": {
      "main": [
        [
          {
            "node": "Picsart Text2Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Picsart Text2Image": {
      "main": [
        [
          {
            "node": "Warte 18s",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Warte 18s": {
      "main": [
        [
          {
            "node": "Bild-Status pr\u00fcfen",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bild-Status pr\u00fcfen": {
      "main": [
        [
          {
            "node": "Bild-URL extrahieren",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Bild-URL extrahieren": {
      "main": [
        [
          {
            "node": "NocoDB media_assets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "NocoDB media_assets": {
      "main": [
        [
          {
            "node": "Pipeline Job finden",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pipeline Job finden": {
      "main": [
        [
          {
            "node": "Pipeline-Job updaten",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null
}
Pro

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

About this workflow

40_410_PIXART_IMAGE. Uses httpRequest. Webhook trigger; 9 nodes.

Source: https://github.com/timo-goetz-ai/apki-core-platform/blob/main/automations/n8n-workflows/content-pipeline/40_410_PIXART_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