# Workflow custom code and googleapis

**URL:** <https://community.hubspot.com/t/workflow-custom-code-and-googleapis/46374>\
**Category:** Data Hub\
**Tags:** workflows\
**Created:** [November 3, 2021, 12:09am UTC](https://community.hubspot.com/t/workflow-custom-code-and-googleapis/46374 "2021-11-03T00:09:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJankovic](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@DJankovic](https://community.hubspot.com/u/DJankovic)\
**Post date:** [November 3, 2021, 12:09am UTC](https://community.hubspot.com/t/workflow-custom-code-and-googleapis/46374/1 "2021-11-03T00:09:56Z")

</div>

Hello everyone,  
I’m tring to use Custom code module in workflow, when the new deal is created then create the new event to google calendar, so I try to use the Custom code to get deal details and I saw that we can use googleapis inside the Custom code module, but I can’t figure out to use the api without the refrech\_token and the consent screen. What i want is when the new deal is create the workflow create the new google event in the deal owner google calendar. I want to konw if this is possible to do inside the workflow and the Custom code module ?  
Thanks a lot in advance,  
Best regards,

Denis

---

<div class="post-metadata">

**Author:** ![TitiCuisset](https://avatars.discourse-cdn.com/v4/letter/t/8baadc/32.png) [@TitiCuisset](https://community.hubspot.com/u/TitiCuisset)\
**Post date:** [November 4, 2021, 8:47am UTC](https://community.hubspot.com/t/workflow-custom-code-and-googleapis/46374/2 "2021-11-04T08:47:09Z")

</div>

Hi @DJankovic

Thank you for reaching out.

I want to tag some of our experts on this - @himanshurauthan @tjoyce @JBeatty do you have any thoughts for @DJankovic on this?

Thank you!

Best

Tiphaine

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [November 9, 2021, 6:46am UTC](https://community.hubspot.com/t/workflow-custom-code-and-googleapis/46374/3 "2021-11-09T06:46:04Z")

</div>

Thank you [@TitiCuisset](https://community.hubspot.com/t5/user/viewprofilepage/user-id/89150),

So I’m sorry to say @DJankovic, but unfortunately, currently, there is no way to create a meeting with the workflow. 😥

---

<div class="post-metadata">

**Author:** ![arlogilbert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/arlogilbert/32/65470_2.png) [@arlogilbert](https://community.hubspot.com/u/arlogilbert)\
**Post date:** [November 28, 2021, 4:11am UTC](https://community.hubspot.com/t/workflow-custom-code-and-googleapis/46374/4 "2021-11-28T04:11:20Z")

</div>

Whoever answered you didn’t read your question.

You can do anything with the Google APIs, altough I’m unclear why the HubSpot team chose to include the googleapi NPM files since secrets have a 100 character limit and Google’s certificates for service accounts are 1500chars+ and API keys are deprecated on most googleapis, so you are stuck with oAuth as your only option. You could probably come up with some insecure and crummy way of storing oauth tokens in hubdb or some other shenanigans, but ultimately the answer is no, there is no simple or reasonable way to do it.

Your best bet is to make a google apps script hosted endpoint where you can code on Google for Google and then just send the necessary data to the api endpoint with some kind of “key” that only you and the endpoint know.
