Custom Workflow Action Not Sending Requests to Webhook

Hi HubSpot Community,

I’m working on creating a Custom Workflow Action that makes an HTTP POST request to an external API. However, I’m facing issues where no requests are being sent from HubSpot to my webhook endpoint, or not reaching my server for some reason.

I’ve configured the action to point to a public testing URL provided by webhook.site for testing, and also to point my own server, but any of them worked.

I’m sharing my custom definitions below, can u help me to figure out what could be wrong?, thank you in advance!

{
 "actionUrl": "https://webhook.site/#!/view/9936fc64-e469-471a-b4f7-f6a56c2469e1",
 "objectTypes": ["CONTACT"],
 "published": true,
 "inputFields": [
 {
 "isRequired": true,
 "typeDefinition": {
 "name": "ref",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"]
 },
 {
 "isRequired": true,
 "typeDefinition": {
 "name": "documento",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"]
 },
 {
 "isRequired": true,
 "typeDefinition": {
 "name": "nombre",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"]
 },
 {
 "isRequired": true,
 "typeDefinition": {
 "name": "telefono",
 "type": "number",
 "fieldType": "number"
 },
 "supportedValueTypes": ["OBJECT_PROPERTY"]
 },
 {
 "isRequired": true,
 "typeDefinition": {
 "name": "comentario",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["STATIC_VALUE"]
 },
 {
 "isRequired": true,
 "typeDefinition": {
 "name": "nombreMarcador",
 "type": "string",
 "fieldType": "text"
 },
 "supportedValueTypes": ["STATIC_VALUE"]
 }
 ],
 "labels": {
 "en": {
 "inputFieldLabels": {
 "ref": "Hubspot Record ID",
 "documento": "Contact DNI",
 "nombre": "Contact Name",
 "telefono": "Contact Telephone",
 "comentario": "Comments for the call",
 "nombreMarcador": "Counter Name"
 },
 "actionName": "Webhook Ucontact",
 "actionDescription": "This action perform an http request to ucontact webhook",
 "appDisplayName": "MM Ucontact",
 "actionCardContent": "This action perform an http request to ucontact webhook"
 },
 "es": {
 "inputFieldLabels": {
 "ref": "ID del contacto de hubspot",
 "documento": "DNI del contacto",
 "nombre": "Nombre del Contacto",
 "telefono": "Teléfono del Contacto",
 "comentario": "Comentarios para la llamada",
 "nombreMarcador": "Nombre del marcador"
 },
 "actionName": "Webhook Ucontact",
 "actionDescription": "Este action envia consume el Webhook de ucontact para iniciar una llamada programada",
 "appDisplayName": "MM Ucontact",
 "actionCardContent": "Este action envia consume el Webhook de ucontact para iniciar una llamada programada"
 }
 },
 "functions": [
 {
 "functionType": "PRE_ACTION_EXECUTION",
 "functionSource": "exports.main = (event, callback) => {\r\n const transformRequest = (request) => {\r\n return {\r\n webhookUrl: request.webhookUrl,\r\n httpMethod: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n Accept: 'application/json'\r\n },\r\n body: JSON.stringify({\r\n ref: request.inputFields.ref,\r\n documento: request.inputFields.documento,\r\n nombre: request.inputFields.nombre,\r\n telefono: request.inputFields.telefono,\r\n comentario: request.inputFields.comentario,\r\n nombreMarcador: request.inputFields.nombreMarcador\r\n })\r\n };\r\n };\r\n\r\n callback(transformRequest(event));\r\n}"
 }
 ]
}

@JMartínez5 - I’m sure the community can help here, but might I suggest that it would be easier to understand and debug a simpler test case that includes the actual HTTP request being made and failing.

Steve

Hi @SteveHTM What do you mean by “the actual HTTP request being made”?, the action supposed to trigger a post request to the actionUrl, but there is not request incoming to the servers and the logs says “The response body for this request was empty”, so it is being really difficult to find the error.

After spending several hours debugging, I finally identified and resolved the issue. The problem was that my custom action had required fields, but some of the contacts I was enrolling didn’t have values for all these fields. As a result, the execution failed without providing a detailed error description, making troubleshooting quite challenging.

To resolve this, I tested the workflow by enrolling a contact where I ensured that all the required contact properties were filled. And voilà, the execution succeeded without any issues!