# Batch API call from Workflow

**URL:** <https://community.hubspot.com/t/batch-api-call-from-workflow/120878>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [November 19, 2024, 6:21pm UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878 "2024-11-19T18:21:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DBhavi](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@DBhavi](https://community.hubspot.com/u/DBhavi)\
**Post date:** [November 19, 2024, 6:21pm UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878/1 "2024-11-19T18:21:32Z")

</div>

Hello,

We have a workflow , which runs everyday morning at 5AM.

This workflow has a filter criteria to filter the users who are mememers of a list ( who has list memembership) , once it read those users form the list , we have a custom code which creates a email body and calls : “hubspotClient.marketing.transactional.singleSendApi.sendEmail” API to send the emails to each user.

As of now, the API call will go for each users once.

After filers the custom code runs for each user everytime. We want to reduce the number of API calls. Is there any batch API or something in the workflow , which reads set of users for the first filter list and call the email in batch ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Berangere](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/berangere/32/220784_2.png) [@Berangere](https://community.hubspot.com/u/Berangere)\
**Post date:** [November 20, 2024, 10:08am UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878/2 "2024-11-20T10:08:34Z")

</div>

Hi @DBhavi, I hope that you are well!  
Thanks for asking the Community!  
I’d like to share this blog post “[Reducing HubSpot Requests: Utilizing Batch API and GraphQL for Better Optimization](https://developers.hubspot.com/blog/reducing-hubspot-requests-utilizing-batch-api-and-graphql-for-better-optimization)” that might be of interest to you!  
I’d love to put you in touch with our Top Experts and Community Members:  
Hi @KLeswing, @GRajput, @hli6, @EvaUR, @SteveHTM, @dsmarion, @brycekunkel, [@Kamil\_KK](https://community.hubspot.com/t5/user/viewprofilepage/user-id/111460) and @mangelet do you have suggestions to share with @DBhavi, please?  
Thanks so much and have a wonderful day!  
Best,  
Bérangère

---

<div class="post-metadata">

**Author:** ![DBhavi](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@DBhavi](https://community.hubspot.com/u/DBhavi)\
**Post date:** [November 20, 2024, 7:07pm UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878/3 "2024-11-20T19:07:17Z")

</div>

Hello [@BérangèreL](https://community.hubspot.com/t5/user/viewprofilepage/user-id/230185)

Thanks for the reply , I have gone through the page you have suggsted and that is not helpfull in pur case.

As I told you we are calling API from worflow, the first filter is giving one data per user.

The post suggest for batch API for task, what I’m looking for is batch API for transactional emails.

---

<div class="post-metadata">

**Author:** ![DBhavi](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@DBhavi](https://community.hubspot.com/u/DBhavi)\
**Post date:** [November 20, 2024, 8:58pm UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878/4 "2024-11-20T20:58:02Z")

</div>

Hello @KLeswing, @GRajput, @hli6, @EvaUR, @SteveHTM, @dsmarion, @brycekunkel, [@Kamil\_KK](https://community.hubspot.com/t5/user/viewprofilepage/user-id/111460) and @mangelet

It would be great , if I can connect with any of you to explain the requirment.

Regards,

Divya

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [November 25, 2024, 10:42am UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878/5 "2024-11-25T10:42:49Z")

</div>

Hi @DBhavi

I hope you are doing well. Currently, the HubSpot workflow does not allow for custom code actions to be performed on batches. However, it can be used to send transactional emails to individual users.

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.  
Thanks!

---

<div class="post-metadata">

**Author:** ![DBhavi](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@DBhavi](https://community.hubspot.com/u/DBhavi)\
**Post date:** [November 25, 2024, 7:28pm UTC](https://community.hubspot.com/t/batch-api-call-from-workflow/120878/6 "2024-11-25T19:28:10Z")

</div>

Thanks Rajat, our code is already sending the trasaction email to indivisuka users.

Thanks for your time.
