# adding custom code to workflow

**URL:** <https://community.hubspot.com/t/adding-custom-code-to-workflow/140090>\
**Category:** Tips, Tricks & Best Practices\
**Tags:** enterprise\
**Created:** [September 25, 2025, 3:46pm UTC](https://community.hubspot.com/t/adding-custom-code-to-workflow/140090 "2025-09-25T15:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DFeldman1](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@DFeldman1](https://community.hubspot.com/u/DFeldman1)\
**Post date:** [September 25, 2025, 3:46pm UTC](https://community.hubspot.com/t/adding-custom-code-to-workflow/140090/1 "2025-09-25T15:46:17Z")

</div>

I would like to add some custom code within a workflow that will scan whether or not a contact already has an owner and then puts the new contact owner in the secondary owner slot. Is there a way for me to do this without creating an access token? If not, how would I go about creating one?

---

<div class="post-metadata">

**Author:** ![karstenkoehler](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/karstenkoehler/32/68554_2.png) [@karstenkoehler](https://community.hubspot.com/u/karstenkoehler)\
**Post date:** [September 25, 2025, 3:54pm UTC](https://community.hubspot.com/t/adding-custom-code-to-workflow/140090/2 "2025-09-25T15:54:03Z")

</div>

Hi @DFeldman1,

This doesn’t sound like it necessarily requires custom code - and that it could be solved with branches and the edit record workflow action. Unless there is a more complex logic to it?

Best regards

---

<div class="post-metadata">

**Author:** ![DFeldman1](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@DFeldman1](https://community.hubspot.com/u/DFeldman1)\
**Post date:** [September 25, 2025, 4:51pm UTC](https://community.hubspot.com/t/adding-custom-code-to-workflow/140090/3 "2025-09-25T16:51:44Z")

</div>

We also have a slot for the 3rd and 4th contact owner, I am looking to  
hopefully minimize the amount of branches it would take
