Error "Cannot read properties of undefined (reading 'forEach')" when sending email via SendGrid from API Workflow

I’m running into a recurring issue when using the Send Email (SendGrid) action in Bubble.

The error I get is:
Cannot read properties of undefined (reading 'forEach')

Here’s what I’ve noticed:

  • This error only happens when the trigger comes from an API Workflow (Backend Workflows).
  • When the email is triggered from the frontend (e.g. from a button click), it works perfectly.
  • I’m passing a single email address as a string into the “To Email Addresses” field.

Is there something different I need to do when triggering SendGrid email actions from backend workflows?
Do I need to format the email field differently (as a list, or array)? Or is there a workaround for this?

Any help is appreciated!

Are you using a plugin? Which one?

“To Email Addresses” seems like it needs a list of email instead of 1. Please post a screenshot.

Hey @ricardoreina are you using any custom code?

can you send some screenshots so can have better idea what you are currently implementing