Trouble with Airtable Trigger

Hey Jan,

Just trying to get Airtable talking to Customer.io. Two problems:

  1. Even though I set it to poll every minute, the script only runs when I click execute
  2. It always pulls the same airtable record. I want it to enter all the new records into Customer.io.
{
  "name": "airtable -> customer.io",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        360,
        350
      ]
    },
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "baseId": "appapmtU3BIbRusc2",
        "tableId": "Users",
        "triggerField": "created_at",
        "additionalFields": {}
      },
      "name": "Airtable Trigger",
      "type": "n8n-nodes-base.airtableTrigger",
      "position": [
        820,
        300
      ],
      "typeVersion": 1,
      "credentials": {
        "airtableApi": "beeper"
      }
    },
    {
      "parameters": {
        "id": "={{ $node[\"Airtable Trigger\"].json[\"id\"] }}",
        "jsonParameters": true,
        "additionalFieldsJson": "={\n\t\"created_at\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"created_at\"]}}\",\n\"country\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"country\"]}}\",\n\"daily_apps\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"daily_apps\"].join(', ')}}\",\n\"desktop_hours\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"desktop_hours\"]}}\",\n\"first_name\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"first_name\"]}}\",\n\"last_name\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"last_name\"]}}\",\n\"full_name\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"full_name\"]}}\",\n\"preferred_id\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"preferred_id\"]}}\",\n\"preferred_network\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"preferred_network\"]}}\",\n\"status\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"status\"]}}\",\n\"unsubscribed\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"unsubscribed\"]}}\",\n\"work_chat\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"work_chat\"]}}\",\n\"phone_number\":\"{{$node[\"Airtable Trigger\"].json[\"fields\"][\"phone_number\"]}}\"\n}"
      },
      "name": "CustomerIo",
      "type": "n8n-nodes-base.customerIo",
      "typeVersion": 1,
      "position": [
        1060,
        300
      ],
      "credentials": {
        "customerIoApi": "beeper"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        []
      ]
    },
    "Airtable Trigger": {
      "main": [
        [
          {
            "node": "CustomerIo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {},
  "id": "1"
}

Any tips?

Eric

Welcome to the community @ericmigi!

Did you activate the workflow?

When testing the workflow (after pressing “Execute Workflow”) will it only get the latest record and you will see the output in the Editor-UI.
If you activate the workflow (right top corner of the screen) it runs in production mode and checkes then (in your case) every minute if there are new records and executes the workflow if any have been found. But that execution you will not see in the Editor-UI. You will only see them under “Past Executions” if you have n8n setup to save successful workflow executions.

Yes I activated it. I don’t see anything in ‘past executions’

Do you have set in n8n to save successful executions and did you add anything new to the meantime to the meantime?

The AIrtable Trigger sadly works differently from other trigger nodes as they do not support webhooks.

Where do I set it to save successful executions?

Yes, many records have been added since. There must be a bug though because every time I click execute workflow at the bottom it pulls in the same record from Airtable.

Would it help to screenshare so I can show you the situation? can add me on matrix @eric:beeperhq.com or other chat works too

Ok I changed the ‘field’ that it’s triggered by to something else, and it seems to be running now. I don’t really get that trigger field though. Also it looks like it’s pulling in the entire base, rather than just new records. Is there a way for it to only grab new records?

Ok I changed the ‘field’ that it’s triggered by to something else, and it seems to be running now. I don’t really get that trigger field though. Also it looks like it’s pulling in the entire base, rather than just new records. Is there a way for it to only grab new records?

The Trigger field has to be of a specific type. Since you want to know about new records, you have to use the Created time type. You do not have to add anything to this field. Airtable automatically will fill it for you every time a record is added to the table. Also, make sure the Trigger Field matches the name of the Created time field. Continuing with this example, it will be Created Time.

Where do I set it to save successful executions?

You can find that under Setting in the left menu.

Yes, many records have been added since. There must be a bug though because every time I click execute workflow at the bottom it pulls in the same record from Airtable.

Every time you hit execute, it should return the last record in the table. Executing the workflow manually means you are in test mode. To facilitate the work for you, we return the last record in test mode. Else you would have to wait until a record is added to the Airtable table to test the workflow.

This approach might seem weird, but it’s done like that because of Airtable’s API limitations. Other trigger nodes should not be as “tricky” as this one.

1 Like

Ah that was my issue. I was using a computed created time in unix epoch rather than the default Airtable “Created Time” field. I think it’s working now, thanks for the help @RicardoE105 and @jan!

1 Like

Glad that it worked. Let us know if you have any other questions.