Templated: Automating Image Generation for Facebook

Templated is an image automation API that can be used to automate your social media images, including Facebook. In this post, we will be automating the image generation for this platform using n8n. Templated now has a native n8n integration, which means you don’t need to use an HTTP node in your workflow.

For this particular tutorial, I will use a template from the Templated’s gallery only; however, if you have the base template already built in some other software (like Canva), you can use that in the editor and add layers over it, which you would like to automate.

Tools You Will Need To Programatically Automate Facebook Images

  • Account on Templated (Get 50 Free Credits when You Sign up)
  • Google Sheets to maintain a database
  • Account on n8n

Set Up Your Google Sheets Database

Let’s first hop onto our Google Sheets and create our database. I have already created it as per the template and layers I am automating.

As you can see in the tab “Sheet1”, row 1 has all the layers I want to change. These are ‘Blog Headings’, ‘Date of Publishing’ & ‘Min Read’. Below each particular layer, I have mentioned the text I would like to change.

In tab ‘Sheet2’, I am taking the output, which will be a URL of the image generated.

Choose and Customize a Template in Templated

Now let’s hop to Templated. As mentioned earlier, I am using the already present template from this tool.

You can see there are 3 layers, and they correspond to the columns in our Spreadsheet. For this tutorial, I am changing just the text of layers; you can do more with Templated. For instance, you can change text_font, text_color, and even the background image. To understand more about how you can do that, please refer to the documentation.

Create a Workflow in n8n

Now we know what we want to create, let’s go to n8n now.

Step 1: Google Sheets → Row Added

In n8n, create a new workflow. We are taking Google Sheets → Row Added as the first node.

Quick Tip — It’s good to keep testing every node you build when working with a workflow. This helps to eliminate issues as they may come.

Step 2: Add the Templated Node

Let’s now connect the next node, which will be Templated. If you’re using this node in n8n for the first time, you will have to install it. Here’s how you do it.

Once installed, you will see the node working, the action in it will be ‘create a render’, & below is the mapping you should do.

Step 3: Test the Render Output

Let’s now test this step also. It is working correctly, and we are getting the render_url data point.

Step 4: Send the Rendered Image Back to Google Sheets

The final step would be to take them back into our Spreadsheet in tab “Sheet2”. Here’s how we will be mapping our last node ‘Google Sheets → Append row’, taking the blog heading from our first node, and the rendered URL from the Templated node.

Wrapping up

Want to use this as is? Here is the Blueprint that you can use.
Businesses can use this to scale up this automation to any level as per the use case. You can use any no-code tool, including Zapier or Make.