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!”,
“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