SwarmGen+n8n

SwarmGen + n8n

Open-source workflow automation with image generation built in

n8n's open-source approach gives you full control over your automation infrastructure. Adding SwarmGen to any n8n workflow is a single HTTP Request node — configure it once and reuse across pipelines. Trigger image renders from webhooks, database row changes, scheduled crons, or any of n8n's 350+ built-in integrations.

How to set it up

  1. 1

    Create your SwarmGen template

    Design an HTML template with the merge fields you need. Save it and copy the template ID from the editor.

  2. 2

    Add an HTTP Request node

    In your n8n workflow, add an HTTP Request node. Set the method to POST and the URL to https://swarmgen.io/api/templates/YOUR_TEMPLATE_UUID/render. Add an Authorization header set to Bearer sgk_YOUR_API_KEY.

  3. 3

    Map upstream data to merge fields

    Set the body content type to JSON. Use n8n expressions to build the "data" object — reference values from earlier nodes with {{ $node["NodeName"].json["field"] }} syntax. Add "returnUrl": true to get a URL back.

  4. 4

    Use the URL in downstream nodes

    The response contains { "url": "...", "jobId": "...", "format": "png", "expiresAt": "..." }. Reference the URL with {{ $json.url }} in any downstream node — pass it to Google Drive, send it in an email, or write it to a database. Render URLs are valid for 5 days — download and re-host for long-lived use.

Code example

n8n HTTP Request node — JSON bodyjson
// POST https://swarmgen.io/api/templates/YOUR_TEMPLATE_UUID/render
// Authorization: Bearer sgk_YOUR_API_KEY
// Response: { "url": "https://...", "jobId": "...", "format": "png", "expiresAt": "..." }

{
  "data": {
    "title": "={{ $node['Trigger'].json['title'] }}",
    "description": "={{ $node['Trigger'].json['excerpt'] }}",
    "author": "={{ $node['Trigger'].json['author']['name'] }}",
    "published_at": "={{ $now.toFormat('dd LLL yyyy') }}"
  },
  "returnUrl": true
}

Bespoke integrations are not supported by our team. The sample code here is for guidance and you will need technical knowledge or a developer to implement it. We plan to release dedicated plugins for key tools as demand grows.

Ready to connect n8n?

Create a free account, build a template, and start generating images from your n8n workflows in minutes.

Get started free

More integrations