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.

Hello guys

Unfortunately the forum does not allow me to post more pictures/links in my post. Maybe it would be a better user experience to display a warning message when the user tries to add too many links/images in order not to waste too much time as I saw the restriction when I tried to submit the post :slight_smile:

The intended content:
I also have a few questions regarding the Airtable Trigger:

In this picture, the Trigger is working:

In this picture I did add an additional field Invoice without changing anything else:
image (1)|690x379
The response I receive is Created Time does not exist even though before it worked fine.

Having removed the additional field, I also added the field ‘Last modified time’ to the airtable base according to the trigger docs:

I receive ‘Last modified time’ does not exist:

I am honestly struggling with the Airtable trigger and would appreciate any insights :slight_smile:

Thank you so much!

Welcome to the community @Stephan_Muller

You have to add the Created Time field. So in the field fields do Invoice,Created Time

1 Like

Thanks a lot, it works fine like this :wink:

Hi,

I am facing a similar issue but with Airtable data that were filled in batch of 10 to Airtable. This make Airtable set the same “Created Time” value to all of these 10 data.

I guess that is the reason why n8n Airtable trigger select only one data.

So may the “id” data (which is generated by Airtable that guaranty that every data will have a unique value on this field) could make it works but no, only one data is selected.

I really can’t make n8n select more than one data from AirTable. My configuration is :

  • Docker version
  • Workflow is : saved, active and executed
  • poll is set every minute

Hey @Alexy!

Welcome to the community :sparkling_heart:

Does the node return one only item when it gets executed automatically? Or are you executing the node manually? If you’re executing it manually, then the node will return only one item (the first item).

1 Like

Hey, that was the case, thanks you for your answer

1 Like