# Using serverless functions in Custom Workflow Actions

**URL:** <https://community.hubspot.com/t/using-serverless-functions-in-custom-workflow-actions/104001>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [April 3, 2024, 10:07am UTC](https://community.hubspot.com/t/using-serverless-functions-in-custom-workflow-actions/104001 "2024-04-03T10:07:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CDP2023](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@CDP2023](https://community.hubspot.com/u/CDP2023)\
**Post date:** [April 3, 2024, 10:07am UTC](https://community.hubspot.com/t/using-serverless-functions-in-custom-workflow-actions/104001/1 "2024-04-03T10:07:43Z")

</div>

Hi!  
I was trying to use and create functions for custom workflow actions but it does not display in my workflow defination once created. What I mean by that is, I am sending the below payload to create a custom workflow action along with a simple function:

{

“actionUrl”: “[The premium domain name webhook.com is for sale!](https://www.webhook.com/Test)”,

“published”: true,

“inputFields”: [],

“labels”: {

```
    "en": {

        "actionName": "CDP-TP-1 opt-in consolidation",

        "actionDescription": "Workflow Action to consolidate opt-in and provide it as result for BU-1",

        "appDisplayName": "CDP-TP-1 OPT-IN App",

        "actionCardContent": "CDP-TP-1 OPT-IN Automation"

    }

},

```

“objectTypes”: [

```
"0-1"

```

],

“objectRequestOptions”: {

```
"properties": \[

  "customer\_id",

  "email"

]

```

},

“functions”: [

```
    {

        "functionType":"PRE\_ACTION\_EXECUTION",

        "functionSource":"exports.main = (event, callback) => {callback({\\"data\\": {\\"field\\": \\"email\\",\\"phone\\": \\"1234567890\\" }});"

    }

]

```

}  
Now when I fetch my function defination, it gives me this where only the function type is mentioned but not the source.

 ![CDP2023_0-1712138843425.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/4/4a85bd3ee88211c1cae3f308a60283343f089cc0.png)

---

<div class="post-metadata">

**Author:** ![HMir](https://avatars.discourse-cdn.com/v4/letter/h/dec6dc/32.png) [@HMir](https://community.hubspot.com/u/HMir)\
**Post date:** [April 26, 2024, 5:50am UTC](https://community.hubspot.com/t/using-serverless-functions-in-custom-workflow-actions/104001/2 "2024-04-26T05:50:12Z")

</div>

> * * *
> 
> @CDP2023 wrote:
> 
> Hi!  
> I was trying to use and create functions for custom workflow actions but it does not display in my workflow defination once created. What I mean by that is, I am sending the below payload to create a custom workflow action along with a simple function:
> 
> {
> 
> “actionUrl”: “[The premium domain name webhook.com is for sale!](https://www.webhook.com/Test)”,
> 
> “published”: true,
> 
> “inputFields”: [],
> 
> “labels”: {
> 
> ```
> "en": {
> 
> "actionName": "CDP-TP-1 opt-in consolidation",
> 
> "actionDescription": "Workflow Action to consolidate opt-in and provide it as result for BU-1",
> 
> "appDisplayName": "CDP-TP-1 OPT-IN App",
> 
> "actionCardContent": "CDP-TP-1 OPT-IN Automation"
> 
> }
> 
> },
> 
> ```
> 
> “objectTypes”: [
> 
> ```
> "0-1"
> 
> ```
> 
> ],
> 
> “objectRequestOptions”: {
> 
> ```
> "properties": \[
> 
> "customer\_id",
> 
> "email"
> 
> ]
> 
> ```
> 
> },
> 
> “functions”: [
> 
> ```
> {
> 
> "functionType":"PRE\_ACTION\_EXECUTION",
> 
> "functionSource":"exports.main = (event, callback) => {callback({\\"data\\": {\\"field\\": \\"email\\",\\"phone\\": \\"1234567890\\" }});"
> 
> }
> 
> ]
> 
> ```
> 
> }  
> Now when I fetch my function defination, it gives me this where only the function type is mentioned but not the source.

 ![CDP2023_0-1712138843425.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/4/4a85bd3ee88211c1cae3f308a60283343f089cc0.png)

> * * *

I am facing the same issue. Did you get your answer?
