# Accessing Webhook Data in Custom Code Inside Workflow

**URL:** <https://community.hubspot.com/t/accessing-webhook-data-in-custom-code-inside-workflow/110043>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [June 25, 2024, 11:09am UTC](https://community.hubspot.com/t/accessing-webhook-data-in-custom-code-inside-workflow/110043 "2024-06-25T11:09:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MAlMasri](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/malmasri/32/197464_2.png) [@MAlMasri](https://community.hubspot.com/u/MAlMasri)\
**Post date:** [June 25, 2024, 11:09am UTC](https://community.hubspot.com/t/accessing-webhook-data-in-custom-code-inside-workflow/110043/1 "2024-06-25T11:09:14Z")

</div>

Dears,

I have created a webhook in the workflow and added it as a trigger. I am triggering it via Postman with the following details:

**URL** : _**[https://api-na1.hubapi.com/automation/v4/webhook-triggers/X](https://api-na1.hubapi.com/automation/v4/webhook-triggers/X) XXXX**_

**Data in the Body** :

{ “firstname”: “mod”, “lastname”: “ree”, “midname”: “Q.”, “email”: “[test@gmail.com](mailto:test@gmail.com)” }

Could you please guide me on how I can access the posted data from the webhook within the custom code inside the workflow?  
i tried to log the **event** always empty:

```auto
exports.main = async (event, callback) => {
 / *****
 Use inputs to get data from any action in your workflow and use it in your code instead of having to use the HubSpot API.
 ***** /
 const email = event.inputFields['email'];
 / *****
 Use the callback function to output data that can be used in later actions in your workflow.
 ***** /
 callback({
 outputFields: {
 email: email
 }
 });
}

```

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 26, 2024, 3:59pm UTC](https://community.hubspot.com/t/accessing-webhook-data-in-custom-code-inside-workflow/110043/2 "2024-06-26T15:59:33Z")

</div>

Hey, @MAlMasri 👋 Thanks for posting your question. We’ll leave this open in case a community member has a suggestion for you. Please note that our members and champions are volunteers and may not be able to provide you a full custom solution. Often members find more success by building it out and then sharing where they are stuck, receiving errors, etc.

Best,

Jaycee
