# Custom Workflow Actions Functions

**URL:** <https://community.hubspot.com/t/custom-workflow-actions-functions/103997>\
**Category:** APIs & Integrations\
**Tags:** professional\
**Created:** [April 3, 2024, 9:53am UTC](https://community.hubspot.com/t/custom-workflow-actions-functions/103997 "2024-04-03T09:53:38Z")\
**Posts on this page:** 1\
**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, 9:53am UTC](https://community.hubspot.com/t/custom-workflow-actions-functions/103997/1 "2024-04-03T09:53:38Z")

</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.

```
        "actionUrl": "https://www.webhook.com/Test",

        "published": true,

        "inputFields": \[],

        "objectRequestOptions": {

            "properties": \[

                "customer\_id",

                "email"

            ]

        },

        "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"

        ],

        "id": "5884557349",

        "revisionId": "2",

        "functions": \[

            {

                "functionType": "PRE\_ACTION\_EXECUTION"

            }

        ]

    }

```

I have tried different ways but to no avail. Also when running this in a workflow it throws an error saying:

`The response body for this request was empty`

I am guessing it might be due to this but not sure. Can anyone please help me decode this? Having issues setting up functions in custom workflow actions.  
Regards,

CDP
