• Learn how AI and automation actually work in your Help Desk. Ask our experts how to improve team speed and customer happiness! AMA Nov 17-21.

    Ask us anything

CMS Development

RMandhan
Member

Custom Workflow Action - Workflow ID

SOLVE

Hello,

 

I have created custom workflow action in hubspot. Now I have to send current workflow id in which my custom workflow action is used to the custom workflow action's webhook url i.e action url in HubSpot. How Can I achieve this.

 

I have tried by using get all workflows and fetch workflow data by workflow id apis of hubspot.

 

What I did is I called all the workflows based on the oauth access token and from that I got all the workflow id's from the workflow id's I called fetch workflow data by workflow id api. In this api I receive actions of each workflow then I put the condition if the action involves Custom action and created type like "EXTENSION" then return the workflow Id. 

 

This works but this is working if the workflow is created before installing the custom app to the test hubspot account. This is not working for the current workflow id.

 

Please It will be great if someone can help to find the solution for how to send current workflow id in which my custom workflow action is used to the custom workflow action's webhook url i.e action url in HubSpot

 

 

Thanks & Regards,

Richa

1 Accepted solution
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Custom Workflow Action - Workflow ID

SOLVE

Hi @RMandhan 

To send the current workflow ID in which your custom workflow action is used to the custom workflow action's webhook URL (action URL) in HubSpot, you can follow these steps:

1. Retrieve Workflow ID within Custom Action: In your custom workflow action code, you need to retrieve the current workflow ID dynamically. The workflow ID can be accessed from the context of the custom action.

2. Pass Workflow ID to the Webhook URL: Once you have the workflow ID, you can include it as a parameter in the webhook URL that you provide for the custom workflow action. Modify the URL to include the placeholder for the workflow ID. For example, you can use `{workflowId}` as a placeholder in the URL.

Example:
```
https://example.com/webhook/{workflowId}
```

Replace `https://example.com/webhook/` with your actual webhook URL, which should be the base URL that receives the webhook requests. `{workflowId}` will be replaced with the actual workflow ID dynamically.

3. Replace Placeholder in Action URL: Within your custom workflow action code, replace the `{workflowId}` placeholder in the action URL with the actual workflow ID value retrieved in step 1. This will ensure that the workflow ID is passed correctly to the webhook URL.

Example (JavaScript):
```javascript
var workflowId = /* Retrieve workflow ID dynamically */;
var actionUrl = "https://example.com/webhook/{workflowId}";

actionUrl = actionUrl.replace("{workflowId}", workflowId);

// Use the modified actionUrl in your custom workflow action code to send requests to the webhook URL.
```

Adapt the code to the programming language or framework you are using for your custom workflow action.

Hope this will helps you out. Please mark it as Solution Accepted & Upvote to help other Community member.

Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

0 Upvotes
2 Replies 2
RMandhan
Member

Custom Workflow Action - Workflow ID

SOLVE

Thank You @GRajput .. Your reply is useful to me. I found the workflow Id from the context.

GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

Custom Workflow Action - Workflow ID

SOLVE

Hi @RMandhan 

To send the current workflow ID in which your custom workflow action is used to the custom workflow action's webhook URL (action URL) in HubSpot, you can follow these steps:

1. Retrieve Workflow ID within Custom Action: In your custom workflow action code, you need to retrieve the current workflow ID dynamically. The workflow ID can be accessed from the context of the custom action.

2. Pass Workflow ID to the Webhook URL: Once you have the workflow ID, you can include it as a parameter in the webhook URL that you provide for the custom workflow action. Modify the URL to include the placeholder for the workflow ID. For example, you can use `{workflowId}` as a placeholder in the URL.

Example:
```
https://example.com/webhook/{workflowId}
```

Replace `https://example.com/webhook/` with your actual webhook URL, which should be the base URL that receives the webhook requests. `{workflowId}` will be replaced with the actual workflow ID dynamically.

3. Replace Placeholder in Action URL: Within your custom workflow action code, replace the `{workflowId}` placeholder in the action URL with the actual workflow ID value retrieved in step 1. This will ensure that the workflow ID is passed correctly to the webhook URL.

Example (JavaScript):
```javascript
var workflowId = /* Retrieve workflow ID dynamically */;
var actionUrl = "https://example.com/webhook/{workflowId}";

actionUrl = actionUrl.replace("{workflowId}", workflowId);

// Use the modified actionUrl in your custom workflow action code to send requests to the webhook URL.
```

Adapt the code to the programming language or framework you are using for your custom workflow action.

Hope this will helps you out. Please mark it as Solution Accepted & Upvote to help other Community member.

Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


0 Upvotes