Skip to content
Pixmato
Esc
↑↓navigate↵open⌘Jpreview
On this page

New Articles to Share Images

Make a social share image for every new blog or CMS article with n8n, Make or Zapier, using the site's RSS feed.

This recipe makes a share image each time a new article appears on your site, using the article’s title and author. The image link is added to a Google Sheet so you can find it, post it, or set it as the article’s preview image.

It starts from your site’s RSS feed, a list of recent articles that most blogs and content systems publish automatically. That means it works with WordPress, Ghost, Webflow, Squarespace, Substack and most others without connecting to the site itself. It works with n8n, Make or Zapier, using each tool’s general HTTP step to send a request to the Pixmato API (the address that makes images).

What you need

  • A Pixmato account with a share image template, usually 1200 × 630 pixels. The examples use two fields: title and author.
  • A Pixmato API key.
  • Your site’s feed address. For WordPress it is your site address followed by /feed/. Other systems usually link to it as RSS in the footer or settings. On this page it is written as YOUR_FEED_URL.
  • A Google Sheet with a tab named Share images, for the log.
  • An account with n8n, Make or Zapier.

Step 1: Get your API key

  1. Open the Pixmato dashboard and go to API keys.
  2. Click Create API key, give it a name such as Share images, and create it.
  3. Copy the key straight away. It is shown only once. Keys begin with pxm_.

On this page the key is written as YOUR_API_KEY. Paste your own key wherever you see it, and keep it private.

Step 2: Get the template ID and field names

  1. Go to Templates in the dashboard.
  2. Open the menu on your template and choose Copy template ID. On this page it is written as YOUR_TEMPLATE_ID.
  3. Open the template’s details to see its field names under API parameters, or choose Test template and open the Use via API tab.

How article details map to template fields

Article detail Name in the feed Template field Notes
Title title title Long titles are handled by the template’s text fitting.
Author creator author WordPress and Ghost include it. Some feeds leave it out.
Link link none Written to the log so you can match each image to its article.

Feeds rarely include the article’s cover photo, so these examples use text fields only. If your feed does include an image link, add an image field to the template and send that link to it.

Step 3: Set up the log sheet

Put these column names in the first row of the Share images tab:

article_title article_link image_url render_id status error

Each new article adds one row. status is completed when the image is ready, or Pixmato’s error code when it is not. error holds Pixmato’s explanation.

The request every recipe sends

Setting Value
Method POST
URL https://api.pixmato.com/v1/renders
Header Authorization: Bearer YOUR_API_KEY
Header Content-Type: application/json
{
  "template": "YOUR_TEMPLATE_ID",
  "modifications": {
    "title": "{{title}}",
    "author": "{{creator}}"
  },
  "output": { "format": "png", "scale": 1 }
}

modifications holds the field values. "scale": 1 keeps the image at the template’s own size, which suits share images; leave output out to get a PNG at twice the size.

Pixmato waits until the image is finished and answers with:

{
  "id": "rnd_01JY7R8Q7S2K3B4A5C6D7E8F9G",
  "status": "completed",
  "output_url": "https://storage.pixmato.com/workspaces/ws_01JY7R8Q7S2K3B4A5C6D7E8F9G/render-cache/v6-8d41e7.png",
  "duration_ms": 615,
  "template": "YOUR_TEMPLATE_ID"
}

output_url is the image link. Anyone with the link can open the image.

n8n

Written for n8n 2.47. The workflow uses the RSS Feed Trigger, HTTP Request (version 4.2), Switch, Wait and Google Sheets (version 4.7) nodes, which are all built into n8n.

  1. Download the workflow: n8n-new-article-share-image.json.
  2. In n8n, create a new workflow, open the … menu at the top right and choose Import from File. Pick the downloaded file. You can also choose Import from URL and paste https://pixmato.com/docs/recipes/n8n-new-article-share-image.json.
  3. Open New article in feed and replace YOUR_FEED_URL with your feed address. It checks the feed every hour; change Poll Times if you want it more or less often.
  4. Open Render share image. Under Credential for Header Auth, choose Create new credential and enter Name Authorization and Value Bearer YOUR_API_KEY. Replace YOUR_TEMPLATE_ID in the body with your template ID.
  5. Choose the same credential in Check render and Render share image again, and put your template ID in the body of Render share image again too.
  6. Open Log share image, connect your Google account, and choose your spreadsheet.
  7. Click Fetch Test Event on the trigger to try it with the latest article, then publish the workflow so it keeps running.

What the workflow does:

Node What it does
New article in feed Starts once for each article published since the last check.
Render share image Sends the request above.
What happened? Picks one of four paths based on Pixmato’s answer.
Image ready Goes straight to the log.
Still rendering Waits 30 seconds, then Check render asks Pixmato for the same render instead of starting again.
Try again For a temporary problem on Pixmato’s side: waits 1 minute and sends the request once more.
Needs a fix For a problem with the request, such as a wrong field name: goes to the log with the error.
Log share image Adds a row with the title, link, image link, render ID, status and error.

To deliver the image somewhere else, such as a Slack channel or your social scheduling tool, add a step after Log share image and use its image_url.

Make

The numbers in values such as {{2.data.output_url}} are module numbers; Make shows them on each module, and yours may differ.

  1. Create a scenario and add RSS › Watch RSS feed items. Enter your feed address. When asked where to start, choose From now on so that only new articles are used.

  2. Add HTTP › Make a request:

    • Authentication type: API key. Create a keychain with Key Bearer YOUR_API_KEY, API Key placement In the header, and API Key parameter name Authorization.
    • URL: https://api.pixmato.com/v1/renders
    • Method: POST
    • Body content type: application/json
    • Body input method: JSON string
    • Body content: paste the body below and map the RSS module’s Title and Author into it.
    • Parse response: Yes
    • Under Advanced settings, set Return error if HTTP request fails to No and Timeout to 60.
    {
      "template": "YOUR_TEMPLATE_ID",
      "modifications": {
        "title": "{{1.title}}",
        "author": "{{1.author}}"
      },
      "output": { "format": "png", "scale": 1 }
    }
  3. Add Google Sheets › Add a Row and choose the Share images sheet. Map:

    • article_title: the RSS module’s Title
    • article_link: the RSS module’s URL
    • image_url: {{2.data.output_url}}
    • render_id: {{if(2.statusCode = 200; 2.data.id; 2.data.details.jobId)}}
    • status: {{if(2.statusCode = 200; "completed"; 2.data.code)}}
    • error: {{2.data.error}}
  4. Click Run once to test, then turn the scenario on and choose how often it runs.

Article titles often contain straight double quotes ("), which break a JSON string body. If yours do, build the body with JSON › Create JSON and map its output into Body content instead.

Zapier

Webhooks by Zapier is available on paid Zapier plans.

  1. Trigger: RSS by Zapier › New Item in Feed. Enter your feed address.

  2. Action: Webhooks by Zapier › POST:

    • URL: https://api.pixmato.com/v1/renders

    • Payload Type: json

    • Data:

      Key Value
      template YOUR_TEMPLATE_ID
      modifications__title the Title from step 1
      modifications__author the Author from step 1
    • Headers: Authorization with the value Bearer YOUR_API_KEY.

    Zapier sends this body, with the article’s values filled in:

    {
      "template": "YOUR_TEMPLATE_ID",
      "modifications": {
        "title": "{{title}}",
        "author": "{{author}}"
      }
    }
  3. Action: Google Sheets › Create Spreadsheet Row on the Share images worksheet, with article_title from the trigger’s Title, article_link from its Link, image_url from Output Url in step 2, render_id from ID, and status from Status.

  4. Test each step, then publish the Zap.

When Pixmato answers with an error, Zapier stops the run at the POST step and shows Pixmato’s message in the Zap history. On plans that include it, open the … menu on the POST step and choose Add error handler, then add a Create Spreadsheet Row step on the error path that logs the error message.

When a render fails

Pixmato answers a failed request with an error code and a sentence that says what to change. For example, if the body uses a field name the template does not have:

{
  "code": "invalid_template_parameters",
  "error": "Invalid template parameters. \"byline\": Unknown template parameter. Check the field keys and value types with GET /v1/templates/{id}.",
  "status": 400,
  "details": [{ "key": "byline", "message": "Unknown template parameter." }]
}

The n8n workflow and the Make scenario write the code into status and the sentence into error.

Code What it means What to do
unauthorized The API key is missing, wrong or revoked. Check the Authorization value is Bearer, a space, then your key.
template_not_found The template ID is wrong or from another workspace. Copy the template ID again.
invalid_template_parameters A field name or value does not match the template. Fix the body. The message names the field.
credits_unavailable The plan’s render credits are used up. Wait for the monthly reset or upgrade the plan.
This workspace has reached its limit of 60 renders per minute rate_limited Nothing to fix. Wait a minute and run the automation again.
render_failed The image could not be drawn. Usually temporary. The n8n workflow tries once more by itself.

Failed renders and refused requests do not use render credits. The full list is in Errors.

A workspace can make 60 images a minute and have 10 in progress at once. A long sheet or a busy feed can reach that. The answer then has the status 429 and says how many seconds to wait. See Limits.

Retrying safely

  • A temporary failure (render_failed, render_timeout or internal_error) can be sent again. Nothing was charged for the failed attempt. The n8n workflow does this once by itself after a minute.
  • A slow render must not be sent again. When an image takes longer than 30 seconds, the answer has the status 202 and "status": "pending", and Pixmato is still making that image. Ask for it with GET https://api.pixmato.com/v1/renders/RENDER_ID, using the same Authorization header and the render ID from the answer’s id. The n8n workflow does this after 30 seconds. In Make and Zapier, the log row has the render ID; find the finished image under Render history in the dashboard.
  • A request that needs a fix fails the same way every time. Fix the template ID, field names or key, then replay the run.

Do not turn on automatic replays that resend the request after a slow render, such as Zapier’s autoreplay. Each request that finishes makes a separate image and uses a credit.

What a second run does

The feed trigger in each tool remembers the newest article it has seen. When it checks again, it starts only for articles published since then, so an article never gets a second image by accident, and a check that finds nothing new uses no render credits.

Two things do make a second image for the same article: replaying an old run, and clicking Fetch Test Event or Run once while testing. Each of those sends a new request and uses a credit, even though the image comes out the same. Updating an article’s title after it is published does not start the automation again; replay its run if you want a new image.

Was this page helpful?