Posting attachments to Airtable without a URL

Describe the problem/error/question

I am triggering a workflow by labelling a gmail with an attachment
I want the attachment to be posted to a new record in an airtable
I cannot see how to do this.

What is the error message (if any)?

Invalid input for ‘Attachment’ [item 0]
‘Attachment’ expects a array but we got ‘attachment_0’

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: - Web
  • Database (default: SQLite): - default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): - default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): - n8n cloud
  • Operating system: - MacOS Sonoma 14.6.1 / Chrome 132.0.6834.160

Hey @Cobley , uploading files to Airtable is not straightforward. There are two approaches you can take.

  1. Having your file publicly available via URL, Airtable attachement field still broken? - #4 by giulioandreini
  2. Utilizing HTTP Request node to upload via Airtable API, Airtable Web API

In the latter case, you need to base64 encode your binary file and POST it with the body as below

{
    "contentType": "<MIME TYPE>",
    "file": "<BASE64 ENCODED STRING>",
    "filename": "<FILE NAME>"
  }

The workflow itself would look like below. You do need to make sure to update the URL itself in HTTP Request node to point to the actual base, record and field in question in place of /{baseId}/{recordId}/{attachmentFieldIdOrName}/.

3 Likes

Bro thank you do much I don’t know where you found that Airtable endpoint but it works forreal