Date formatting and Airtable

Describe the problem/error/question

Hi all, I’m having a weird new issue with my Airtable step, regarding the date.
As you can see [1] it’s arriving from the webhook as an ISO8601 date, but is resulting in an Airtable error [3].

What is particularly weird is that if I rerun the failed scenario from the point where it failed, it immediately works.

Anyone encountered this? What is tripping up the date field?

What is the error message (if any)?

Please share your workflow

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @memetican,

That is odd.
I’m not being able to replicate, could you share some more details about your set up and the wf to see if I can match your case better?

Thanks @mariana-na ,

It’s a self-hosted instance only running a few workflows.
Currently 1.23.0

Here’s the Airtble Date field configuration.
I changed it to ISO format in case that would help, but it hasn’t changed the error.

Thanks for providing more details!

Because n8n needs to convert the data to strings to pass it as a JSON along the workflow, sometimes this can cause format issues with the dates.
Could you try formatting the date to ISO before passing it to Airtable and see if this resolves the error?

An expression like {{ new Date($node["Set"].json["Date"]).toISOString() }} instead of {{ $json.Date }}

You can also read more about n8n’s usage of the Luxon library here: Handling dates | n8n Docs

1 Like

Thanks Mariana, that solved it.
I actually just modified the Set step to force it to an ISO datestring.

image

I’m a bit perplexed as to why in the errored cases the Airtable step is showing an ISO formatted date string as the input [1], but according to the Airtable error [2] the string actually being sent is in standard date string format. That’s what tripped me up.

Is that a bug, or is there a setting I can change to fix that?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

I suspect this is because you’re creating the date using {{ new Date() }} rather than n8n’s built-in functionality {{ $now }} or {{ $today }}.

But it is of course a bug that we should fix.

1 Like