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