AutomationFlowsWeb Scraping › Polygam Content Automation (final Architecture)

Polygam Content Automation (final Architecture)

Polygam Content Automation (Final Architecture). Uses httpRequest. Webhook trigger; 11 nodes.

Webhook trigger★★★★☆ complexity11 nodesHTTP Request
Web Scraping Trigger: Webhook Nodes: 11 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": "Polygam Content Automation (Final Architecture)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "polygam-project",
        "responseMode": "responseNode",
        "authentication": "headerAuth",
        "options": {}
      },
      "id": "Webhook",
      "name": "Webhook Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 1.1,
      "position": [
        200,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const input = $input.first().json;\nreturn { json: {\n  project_name: input.project_name || input.title || \"Unnamed Project\",\n  client: input.client || \"Unknown\",\n  location: input.location || \"\",\n  description: input.description || input.details || \"\",\n  challenges: input.challenges || \"\",\n  solution: input.solution || \"\",\n  results: input.results || \"\",\n  raw: input\n}};"
      },
      "id": "Normalizer",
      "name": "Input Normalizer",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        420,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4o"
            },
            {
              "name": "temperature",
              "value": "0.2"
            },
            {
              "name": "messages",
              "value": "={{[{\"role\":\"system\",\"content\":\"You are an engineering analyst. Extract a structured project profile from raw information about water and wastewater infrastructure projects. Return ONLY JSON.\"},{\"role\":\"user\",\"content\":\"Project:\\nName: \"+$json.project_name+\"\\nClient: \"+$json.client+\"\\nLocation: \"+$json.location+\"\\nDescription: \"+$json.description+\"\\nChallenges: \"+$json.challenges+\"\\nSolution: \"+$json.solution+\"\\nResults: \"+$json.results}]}}"
            }
          ]
        },
        "options": {}
      },
      "id": "Analyst",
      "name": "Project Analyst",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        640,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const content = $input.first().json.choices[0].message.content;\nlet parsed;\ntry {\n  parsed = JSON.parse(content);\n} catch (e) {\n  const start = content.indexOf('{');\n  const end = content.lastIndexOf('}');\n  if (start !== -1 && end !== -1 && end > start) {\n    try {\n      parsed = JSON.parse(content.slice(start, end + 1));\n    } catch (e2) {\n      parsed = { raw: content };\n    }\n  } else {\n    parsed = { raw: content };\n  }\n}\nreturn { json: parsed };"
      },
      "id": "ParseProfile",
      "name": "Parse Profile",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        860,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4o"
            },
            {
              "name": "messages",
              "value": "={{[{\"role\":\"system\",\"content\":\"Generate a structured engineering fact sheet for a water infrastructure project. Separate HARD FACTS from NARRATIVE ANGLES.\"},{\"role\":\"user\",\"content\":\"Profile:\\n\"+JSON.stringify($json)}]}}"
            }
          ]
        },
        "options": {}
      },
      "id": "FactSheet",
      "name": "Generate Fact Sheet",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1080,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4o"
            },
            {
              "name": "messages",
              "value": "={{[{\"role\":\"system\",\"content\":\"Write a professional engineering case study based on the provided fact sheet. Documentary tone, no advertising.\"},{\"role\":\"user\",\"content\":$json.choices[0].message.content}]}}"
            }
          ]
        },
        "options": {}
      },
      "id": "CaseStudy",
      "name": "Write Case Study",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1300,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4o"
            },
            {
              "name": "messages",
              "value": "={{[{\"role\":\"system\",\"content\":\"Act as a technical QA reviewer for engineering publications. Verify technical consistency and return the corrected case study.\"},{\"role\":\"user\",\"content\":$json.choices[0].message.content}]}}"
            }
          ]
        },
        "options": {}
      },
      "id": "TechnicalQA",
      "name": "Technical QA",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1520,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4o"
            },
            {
              "name": "messages",
              "value": "={{[{\"role\":\"system\",\"content\":\"Convert the case study into multiple independent but related Bale-style posts. Each post must have a strong hook, a distinct angle, and stand alone.\"},{\"role\":\"user\",\"content\":$json.choices[0].message.content}]}}"
            }
          ]
        },
        "options": {}
      },
      "id": "Serializer",
      "name": "Serialize Posts",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1740,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "authentication": "headerAuth",
        "requestMethod": "POST",
        "url": "https://api.openai.com/v1/chat/completions",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "gpt-4o"
            },
            {
              "name": "messages",
              "value": "={{[{\"role\":\"system\",\"content\":\"Act as a B2B marketing editor. Improve hook strength, clarity, internal Bale SEO, star/emoji formatting. Return final posts only.\"},{\"role\":\"user\",\"content\":$json.choices[0].message.content}]}}"
            }
          ]
        },
        "options": {}
      },
      "id": "MarketingQA",
      "name": "Marketing QA",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1960,
        300
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const posts = $input.first().json.choices[0].message.content;\nconst footer = \"\\n\\n*\ud83d\udd0e \u062c\u0647\u062a \u0645\u0634\u0627\u0648\u0631\u0647 \u0648 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u06cc\u0634\u062a\u0631 :*\\n \ud83d\udce8@polygum_support\\n\\n\ud83d\udd17 \u06a9\u0627\u0646\u0627\u0644 \u062a\u062e\u0635\u0635\u06cc *\u067e\u0644\u06cc\u200c\u06af\u0627\u0645* \u062f\u0631 \\\"\u0628\u0644\u0647\\\" :\\n \ud83c\udf10@Polygum\";\nreturn { json: { final_posts: posts + footer } };"
      },
      "id": "AppendFooter",
      "name": "Append Footer",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        2180,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {}
      },
      "id": "Response",
      "name": "Return Result",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1,
      "position": [
        2400,
        300
      ]
    }
  ],
  "connections": {
    "Webhook Trigger": {
      "main": [
        [
          {
            "node": "Input Normalizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Input Normalizer": {
      "main": [
        [
          {
            "node": "Project Analyst",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Project Analyst": {
      "main": [
        [
          {
            "node": "Parse Profile",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Profile": {
      "main": [
        [
          {
            "node": "Generate Fact Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Fact Sheet": {
      "main": [
        [
          {
            "node": "Write Case Study",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Case Study": {
      "main": [
        [
          {
            "node": "Technical QA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Technical QA": {
      "main": [
        [
          {
            "node": "Serialize Posts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Serialize Posts": {
      "main": [
        [
          {
            "node": "Marketing QA",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Marketing QA": {
      "main": [
        [
          {
            "node": "Append Footer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Footer": {
      "main": [
        [
          {
            "node": "Return Result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {},
  "versionId": "1"
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Polygam Content Automation (Final Architecture). Uses httpRequest. Webhook trigger; 11 nodes.

Source: https://gist.github.com/tinamansour996/7012ad690799de7a188182d17f7c5bcf — 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

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
Web Scraping

Sign PDF documents with legally-compliant digital signatures using X.509 certificates. Supports multiple PAdES signature levels (B, T, LT, LTA) with optional visible stamps.

Execute Command, HTTP Request, Read Write File +1