Airtable sits at the heart of many teams' workflows. With SwarmGen, you can extend it to automatically generate images whenever records are created or updated. Use Airtable's built-in automations with a Run script action, or wire up a Send request action to call the SwarmGen API directly — no external tools required.
How to set it up
- 1
Build the template
Create a SwarmGen template whose merge fields match column names in your Airtable base — e.g. {{Name}}, {{Price}}, {{Image URL}}.
- 2
Create an Airtable automation
In Airtable, go to Automations and add a trigger — "When a record matches conditions" or "When a record is created". This fires whenever you're ready to generate an image.
- 3
Add a "Run a script" action
Use a Run script action to call the SwarmGen render API using the fetch() function. Pass the record's field values as merge data.
- 4
Write the render URL back to the record
Once the image is rendered, store the returned URL in an Airtable Attachment or URL field so it's available for sharing, embedding, or export.
Code example
// Airtable automation — Run a script action
const inputConfig = input.config();
const record = await base.getTable('Products').selectRecordAsync(inputConfig.recordId);
const response = await fetch('https://swarmgen.io/api/templates/YOUR_TEMPLATE_UUID/render', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer sgk_YOUR_API_KEY',
},
body: JSON.stringify({
data: {
title: record.getCellValueAsString('Name'),
price: record.getCellValueAsString('Price'),
image: record.getCellValueAsString('Image URL'),
},
returnUrl: true,
}),
});
const { url } = await response.json();
console.log('Rendered image URL:', url);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 Airtable?
Create a free account, build a template, and start generating images from your Airtable workflows in minutes.
Get started free