Workflow stuck executing "old" Airtable record

Describe the problem/error/question

I have a content marketing workflow that has been working well for the last few months.

It runs via Airtable (to organize everything). Lately, no matter what I do, the workflow uses a previous article topic. Even though it has been previously marked as Completed.

So, in other words, the workflow udpates the correct record (row), but with an OLD topic. We are unable to write new topics because it is trying to produce the same article over and over.

For context, we have a tri-fork switch node that directs the article to the right subbranch, depending on what stage we are at with that article.

The input into our AI Agent node is working properly. The output of the AI Agent node is where it breaks. It’s as if the AI agent node is simply running from its cache (I have confirmed there is no data pinned anywhere).

I have already tried deleting the nodes and recreating them, updating n8n (painstakingly and to no avail), and creating brand new records in Airtable… nothing worked

What is the error message (if any)?

No error message. According to n8n it is successful. In Airtable, I see the issues.

Please share your workflow

{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
-1536,
848
],
“id”: “24043fb6-96df-4ab4-a267-0c025aaeccfd”,
“name”: “Manual Workflow Execution”
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“leftValue”: “={{ $json.Status }}”,
“rightValue”: “Status A”,
“operator”: {
“type”: “string”,
“operation”: “equals”
},
“id”: “dcf2f56a-4f3f-4b63-bf48-f378a980ae55”
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “Path 1”
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “f4620cd5-730e-4da5-ad25-ff5b9cb02ba2”,
“leftValue”: “={{ $json.Status }}”,
“rightValue”: “Status B”,
“operator”: {
“type”: “string”,
“operation”: “contains”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “Path 2”
},
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “4e114479-5e98-40d6-b826-ba1144b4f1dd”,
“leftValue”: “={{ $json.Status }}”,
“rightValue”: “Status C”,
“operator”: {
“type”: “string”,
“operation”: “equals”,
“name”: “filter.operator.equals”
}
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “Path 3”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.4,
“position”: [
-1104,
832
],
“id”: “073be42f-aa9f-4223-a1bc-5d8496321e2d”,
“name”: “Switch”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=You are an expert AI assistant tasked with data processing.\n\nAnalyze the following title and generate the foundational data based on the instructions below. \n\nITEM TITLE: {{ $json.fields[‘Item Title’] }}\n\nINSTRUCTIONS:\n1. Main Topic: Identify the primary topic.\n2. Related Terms: Provide 2-4 variation keywords, separated by commas.\n3. Output Value: Recommend a target numerical value based on complexity.\n4. Target Categories: Identify the specific categories relevant to this topic.\n5. Notes: Write a brief summary of the most important info to consider for this topic. \n\n## Your Job\n\nOUTPUT STRICT JSON ONLY:\n{\n “main_topic”: “string”,\n “related_terms”: “string”,\n “target_value”: number,\n “target_categories”: [“string”],\n “notes”: “string”\n}”,
“hasOutputParser”: true,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
-624,
208
],
“id”: “adad6b9d-4f42-4627-8938-354809101270”,
“name”: “AI Agent”
},
{
“parameters”: {
“options”: {}
},
“type”: “n8n-nodes-base.splitInBatches”,
“typeVersion”: 3,
“position”: [
-864,
192
],
“id”: “07e66167-f0e5-43a9-8f8d-a4c3d435ceba”,
“name”: “Loop Over Items”
},
{
“parameters”: {
“jsCode”: "const aiOutput = $input.first().json.text || $input.first().json.output;\n\ntry {\n const cleanJson = aiOutput.replace(/

Share the output returned by the last node

I do not see how this well help, in this case, as the output looks proper, only for a previous article.

Information on your n8n setup

  • n8n version: 2.25.7
  • Database (default: SQLite): PostgreSQL (specifically, Postgres 16)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu Linux (running a Debian Bookworm container)

Hi @jlbrown9, since this survived recreating the nodes, updating n8n, and brand-new records, I’d stop looking at the Switch/loop and check the AI Agent for a connected Memory sub-node. If a memory is wired in (Simple Memory or a Postgres chat memory) with the session key left on default, every run reuses the same stored conversation and just replays the old topic, which matches the “running from cache” behavior you’re seeing.

Is there a memory node on the agent, and if so what’s set as its session key?

Hi @jlbrown9

In addition to what @achamm has mentioned, you may also want to look out for these:

  1. Even if you recreated the nodes, if you are using expressions to map the AI output back to Airtable, there is a subtle n8n behavior that can cause this.
  • The Problem: If your “Update Airtable” node is referencing the AI Agent node using a syntax that accidentally points to a specific execution or a “fixed” version of the node’s output from a previous successful test run.
  • The Fix:
    • Open the Airtable Update node.
    • Delete the expression in the field where the AI content goes.
    • Re-drag the value from the current execution’s AI Agent output in the input panel.
    • Ensure the expression looks like {{ $json.output }} (or similar) and doesn’t contain a specific execution ID in the path.
  1. While less common for completely different topics, some LLM providers (and the way n8n interfaces with them) can occasionally suffer from context window pollution if the system prompt is too rigid.
  • The Problem: If your System Prompt says something like “You are an expert writer. You are currently writing an article about [Topic],” and that [Topic] variable isn’t updating correctly in the system prompt (even if the user prompt is correct), the AI may prioritize the system instruction over the user input.
  • The Fix:
    • Check the System Prompt of the AI Agent.
    • Verify that any variables used in the System Prompt are dynamically pulling from the current Airtable record and not a cached value.

Based on your description, I don’t think the AI Agent is actually caching the old topic. The fact that the workflow updates the correct Airtable record but generates content for a previous article suggests that somewhere in the workflow an older item is being referenced.

A few things I’d recommend checking:

  1. Open a recent execution and inspect the input data going into the AI Agent. Specifically, verify the value of:

    {{ $json.fields['Item Title'] }}

    If the old topic is already present there, the issue is occurring before the AI Agent.

  2. Check whether the Split In Batches node is reusing an older item or if the loop is not resetting correctly.

  3. Review any expressions that reference previous node data, such as:

    • $items()

    • .first()

    • references to another node’s output

    These can sometimes pull data from an earlier item instead of the current record.

  4. Confirm whether the AI Agent has any memory connected (Simple Memory, Window Buffer Memory, Redis Memory, etc.). If so, temporarily disable it and test again.

  5. In the Airtable node that fetches records, verify that the filter is truly excluding completed articles and that the expected record is being returned before it reaches the Switch node.

Could you share screenshots of:

  • The Airtable node that retrieves the records

  • The AI Agent input panel from a failed execution

  • The Split In Batches configuration

Those three screenshots should help pinpoint where the old topic is being introduced.

The reply above is pointing at the most likely cause, and it is worth checking first: a Memory sub-node on the AI Agent with the session key left on default. If a memory is wired in (Simple Memory, or a Postgres/Redis chat memory) and every run uses the same session key, the agent keeps reading back the same stored context, so it produces the same old topic no matter what the fresh Airtable record says. The new record is being read correctly, the agent is just answering from memory instead of from the input. Setting the session key to something unique per run (the Airtable record ID, for example) usually fixes it.

If there is no memory node, the next suspect is the Airtable read itself. A “get records” with a filter that is not actually excluding Completed, or a sort that keeps returning the same top row, will hand the workflow the old topic every time even though you marked the previous one done. Check the exact filter formula and confirm it returns the new row when you run just that node in isolation.

The reason this one is nasty: the workflow runs green every time and looks completely healthy, it just quietly produces the wrong thing. That is the failure that does not throw, so nothing flags it, you only catch it by reading the output. Once you fix it, worth adding a quick check that the topic it picked actually matches an open Airtable row, so a future regression shows up as a caught mismatch instead of weeks of duplicate content. Is there a Memory node connected to the agent? That is the fastest thing to rule in or out.