Today’s tip is short: before your agent writes to Airtable, check that every field name it sends actually exists in the table. It takes one API call. I’m writing about it because my own image script hasn’t been doing it.
What broke
Every image on this site goes through one script: generate, compress, upload to the CDN, upload to WordPress. The last step logs the image to an Airtable table called Generated Images. It sends five fields: Image Model, Image URL, Name, Prompt, Site.
The table has no field called Name. I checked the schema this morning (24 November): 15 fields, and “Name” isn’t one of them. So Airtable answers every one of those writes like this:
HTTP 422
{"error":{"type":"UNKNOWN_FIELD_NAME","message":"Unknown field name: \"Name\""}}
Two things about that error surprised me when I tested it again today:
- One bad field sinks the whole record. I sent three valid fields plus “Name”. Airtable created nothing. The four good fields in the script’s payload get thrown away along with the bad one.
typecast: truedoesn’t save you. Typecast converts values, like turning text into a select option. It won’t map a field name that doesn’t exist.
Why nobody noticed
The script handles the failure “politely”. It prints a warning to stderr, leaves the record ID blank in its output, and still exits 0. The image is fine, the post is fine, the run counts as a success.
The image at the top of this post went through the same script a few minutes before I published it. Same 422, exit code 0, record ID blank.
My agents did see it. The warning shows up in my run logs at least as far back as 9 October (where it already says “still fails”), and again on 17 October, 18 October and 22 November. Some runs reported it and moved on, so that image never reached the table. Others added the row with a separate call and moved on. The work-around kept the table mostly filled, and it also kept the bug alive. I wrote about the same trap in 3 ways to catch an AI agent silent failure. This one slipped through anyway.

⚡ GET THE AI EDGE
Weekly AI tips that actually save you time and money. No fluff, no hype — just what works.
The table holds 1,042 rows today. None of them came from this script’s own logging step, because with “Name” in the payload it can’t create one. So for at least six weeks, the “log every image at the source” step has logged nothing. Every row since then got there because an agent wrote it separately.
The fix: a 10-line schema preflight
Airtable’s Meta API lists every table and field in a base. Ask it once, compare against the fields you’re about to send, and stop loudly if anything is missing:
import json, os, sys, urllib.request
base, table = os.environ["AIRTABLE_BASE_ID"], os.environ["AIRTABLE_TABLE"]
req = urllib.request.Request(
f"https://api.airtable.com/v0/meta/bases/{base}/tables",
headers={"Authorization": "Bearer " + os.environ["AIRTABLE_API_KEY"]})
tables = json.load(urllib.request.urlopen(req))["tables"]
fields = {f["name"] for t in tables if table in (t["id"], t["name"]) for f in t["fields"]}
payload = ["Image Model", "Image URL", "Name", "Prompt", "Site"]
missing = [f for f in payload if f not in fields]
if missing:
sys.exit(f"Airtable preflight failed, unknown fields: {missing}")
I ran it against my script’s five fields this morning. It printed unknown fields: ['Name'] and exited 1. That’s the line I wanted to see weeks ago.
Three notes if you copy it:
- Your token needs the
schema.bases:readscope. Without it the Meta API refuses, and that’s a loud failure too, which is fine. - Field names are exact. “Image URL” and “Image Url” are different fields. Someone renaming a column in the Airtable UI is enough to break an agent that ran fine yesterday.
- Treat a 422 as a failure, not a warning. If the write matters enough to make, a rejected write should change the exit code or send an alert.
What I’m doing about mine
Changing the script is on my list, not done. It needs two things: drop “Name” (or map it to a field that exists), and make a rejected log write show up as a failure. Until then, the agents keep logging images by hand, and now at least the reason is written down in public.
The takeaway: an agent that writes to a table it has never read is guessing. One schema call turns the guess into a check.
If you’re wiring agents into Airtable, also read make your AI agent read before it writes and why an empty result is a claim, not a fact. And if you’d like a second pair of eyes on your own agent pipeline, book an automation strategy session.

📥 FREE: THE AI PLAYBOOK
The exact tools and workflows I use to run a one-person agency. 25 years of marketing experience distilled into an actionable guide. Yours free.
