# Help Needed: PDF Webhook to Gmail Attachment Error

**URL:** <https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413>\
**Category:** Questions\
**Tags:** node, workflow-building\
**Created:** [March 14, 2025, 6:32pm UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413 "2025-03-14T18:32:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashafizullah](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ashafizullah/32/63363_2.png) [@ashafizullah](https://community.n8n.io/u/ashafizullah)\
**Post date:** [March 14, 2025, 6:32pm UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/1 "2025-03-14T18:32:31Z")

</div>

## My Workflow

I’ve created a workflow with the following nodes:

1. Webhook (receiving a PDF file)
2. Extract from File node (PDF)
3. AI Agent
4. Gmail (to send the PDF as an attachment)

## The Problem

When I try to run this workflow, I get the following error at the Gmail node:

```auto
Cannot read properties of undefined (reading '0') (item 0)

```

## What I’ve Tried

- I can see the PDF file in binary data from the webhook
- I’ve set the binary name in the Gmail attachment field
- The Extract from File node seems to be working correctly

## Details

- The PDF is successfully received by the webhook
- The Extract from File node processes the PDF
- When the data reaches the Gmail node, it fails with the error

## My Questions

1. Why am I getting this error if the binary data is visible from the webhook?
2. How should I properly configure the Gmail node to use the PDF as an attachment?

Any help would be greatly appreciated! Thank you.

Using n8n self hosting.

---

<div class="post-metadata">

**Author:** ![Olek](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/olek/32/59619_2.png) [@Olek](https://community.n8n.io/u/Olek)\
**Post date:** [March 14, 2025, 6:48pm UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/2 "2025-03-14T18:48:06Z")

</div>

Please share your workflow. Select all relevant elements on canvas, Ctrl/Cmd-C, then paste it in your post using `</>` button.

---

<div class="post-metadata">

**Author:** ![ashafizullah](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ashafizullah/32/63363_2.png) [@ashafizullah](https://community.n8n.io/u/ashafizullah)\
**Post date:** [March 14, 2025, 9:09pm UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/3 "2025-03-14T21:09:51Z")

</div>

Okay, this is my workflow, please help:

---

<div class="post-metadata">

**Author:** ![ashafizullah](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ashafizullah/32/63363_2.png) [@ashafizullah](https://community.n8n.io/u/ashafizullah)\
**Post date:** [March 31, 2025, 7:00am UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/4 "2025-03-31T07:00:07Z")

</div>

Hi sir, could you help me to solve my question? About sending an attachment using Gmail

---

<div class="post-metadata">

**Author:** ![Olek](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/olek/32/59619_2.png) [@Olek](https://community.n8n.io/u/Olek)\
**Post date:** [March 31, 2025, 7:58am UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/5 "2025-03-31T07:58:22Z")

</div>

Hi @ashafizullah , my apologies, missed this one.  
I can be wrong but I do not think AI agent is able to bypass binary files to its tools.  
There is also no way to refer to an earlier node as Gmail node expects a field name as a literal.  
I’d suggest using the Structured Output Parser tool to get data from the AI Agent and wire Merge and Gmail nodes after an AI node where you’d be able to attach a binary.  
Below is a wireframe of what you’d be looking for. I didn’t tune any nodes for your use case. It is just to give an idea of what a workaround would be.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![ashafizullah](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ashafizullah/32/63363_2.png) [@ashafizullah](https://community.n8n.io/u/ashafizullah)\
**Post date:** [March 31, 2025, 8:27am UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/6 "2025-03-31T08:27:54Z")

</div>

Thank you so much. Its working!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [April 7, 2025, 8:28am UTC](https://community.n8n.io/t/help-needed-pdf-webhook-to-gmail-attachment-error/88413/7 "2025-04-07T08:28:39Z")

</div>

Closed on April 7, 2025, 8:28am UTC

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