Wednesday Wisdom: Never Hardcode an ID Your Agent Can Look Up

daily resolve ids live 20260902

Here’s a bug that never shows up in a demo and always shows up in production: your agent knows an ID by heart that it should have looked up. It ran fine for weeks. Then the thing behind the ID quietly moved, and your automation kept confidently pointing at the wrong place.

I caught one of these on myself last night. My social scheduler posts a Pinterest pin to a specific board, and an older version of the routine grabbed the board ID from a note I’d saved on a previous run. Trouble is, Pinterest board IDs are not stable the way I’d assumed — the map had shifted, and the ID I’d cached now pointed at my Places board instead of Productivity. The post went out. To the wrong board. It only got fixed because the agent does a live board lookup by name before it commits, spotted the mismatch, deleted the stray pin, and re-created it in the right place. The hardcoded ID was wrong; the live lookup was right.

The wisdom: resolve by name at runtime, never trust a cached ID

An ID is an address, not a fact. Board IDs, Airtable field IDs, category IDs, channel IDs, section GIDs — the platform owns them, and the platform can renumber, migrate, or re-slug them without telling you. The name (“Productivity,” “Newsletter list,” “Drafts section”) is the thing you actually care about and the thing that stays meaningful to a human. So make the human-meaningful name the source of truth in your code, and let the agent resolve it to an ID live, every run, against the platform’s current state.

Jon Jones

⚡ GET THE AI EDGE

Weekly AI tips that actually save you time and money. No fluff, no hype — just what works.

Newsletter Signup - Blog CTA

Yes, it costs one extra API call. That call is the cheapest insurance you will ever buy. The alternative is silent, confident wrongness — the single most expensive failure mode an autonomous agent has, because nothing crashes and no alert fires.

Do this today

  1. Grep your automations for hardcoded IDs. Any bare number or opaque string that names a board, list, field, folder, or channel is a candidate. Note where it came from.
  2. Replace it with a lookup by name. Fetch the live list, match on the human name, use the ID it returns this run — don’t pin it in a config from three weeks ago.
  3. Add a mismatch guard. If the name resolves to nothing (or to two things), stop and alert instead of guessing. A loud failure beats a quiet wrong answer.

This is the same discipline behind making every agent action idempotent and knowing exactly where your agent can and cannot spend: you don’t let a machine act on stale assumptions. You make it check reality first, then move.

The takeaway: If your agent can look an ID up, it should. Hardcode the name; resolve the number. Reality drifts — build agents that re-check it instead of remembering it wrong.

The AI Playbook — Free Download

📥 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.

Lead Magnet - AI Playbook

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *