You can trigger Respell spells directly from your HubSpot workflows using a Custom Code action. This allows you to automate actions based on HubSpot events and data.
In this guide, we’ll show you how to set up a workflow that triggers a spell to make a phone call using Bland AI.
Create a Spell with Manual Inputs in Respell
Add a Custom Code Action in Your HubSpot Workflow
Get Your Respell API Credentials and Inputs
Open your spell in Respell.
Click on the </>
API tab.
Note your API Key, Spell ID, and Input Parameters.
Set the Properties to Include in the Code
name
and phone
.event.inputFields
.Copy and Update the Code
Copy the code below and update it with your credentials from step 3.
Note: Customize this code to use any contact properties from HubSpot as inputs to your spell.
Here is an example of the Custom Code action in HubSpot:
If you want to use the spell’s output in future steps of your HubSpot workflow, set wait: true
and modify the code to handle the response.
Modify the Code to Wait for the Spell’s Output
Note: Ensure that the keys in result.outputs
match the actual output keys from your spell.
Replace Placeholder Values
<YOUR_RESPELL_API_KEY>
: Your Respell API key. It’s recommended to store this securely using HubSpot’s Secrets feature.<YOUR_SPELL_ID>
: The ID of the spell you want to trigger.inputs
object based on your spell’s required inputs.transcript
and answered_by
in the callback
function to match the data you need from the spell’s response.How to Find the Output Keys for Your Spell:
Open your spell in Respell.
Important: Make sure you have a Display Outputs step in your spell.
Click on the </>
API tab.
Ensure the “Wait for the spell run to finish” option is checked.
Review the output structure displayed to identify the correct keys.
Use HubSpot’s Secrets Feature: Store sensitive information like your Respell API key securely by using HubSpot’s Secrets feature.
RESPELL_API_KEY
with your API key as the value.process.env.RESPELL_API_KEY
.Access Workflow Data: Use event.inputFields
to access data from any action in your workflow, allowing you to pass dynamic data to your spell.
Error Handling: Add error handling to manage API request failures or unexpected responses.
Logging for Debugging: Use console.log()
statements to log information for debugging purposes. These logs can be viewed in the workflow execution history.
<YOUR_SPELL_ID>
with your actual spell ID.RESPELL_API_KEY
.By following these steps, you can seamlessly integrate Respell spells into your HubSpot workflows to automate phone calls using Bland AI, enhancing your automation and efficiency.
You can trigger Respell spells directly from your HubSpot workflows using a Custom Code action. This allows you to automate actions based on HubSpot events and data.
In this guide, we’ll show you how to set up a workflow that triggers a spell to make a phone call using Bland AI.
Create a Spell with Manual Inputs in Respell
Add a Custom Code Action in Your HubSpot Workflow
Get Your Respell API Credentials and Inputs
Open your spell in Respell.
Click on the </>
API tab.
Note your API Key, Spell ID, and Input Parameters.
Set the Properties to Include in the Code
name
and phone
.event.inputFields
.Copy and Update the Code
Copy the code below and update it with your credentials from step 3.
Note: Customize this code to use any contact properties from HubSpot as inputs to your spell.
Here is an example of the Custom Code action in HubSpot:
If you want to use the spell’s output in future steps of your HubSpot workflow, set wait: true
and modify the code to handle the response.
Modify the Code to Wait for the Spell’s Output
Note: Ensure that the keys in result.outputs
match the actual output keys from your spell.
Replace Placeholder Values
<YOUR_RESPELL_API_KEY>
: Your Respell API key. It’s recommended to store this securely using HubSpot’s Secrets feature.<YOUR_SPELL_ID>
: The ID of the spell you want to trigger.inputs
object based on your spell’s required inputs.transcript
and answered_by
in the callback
function to match the data you need from the spell’s response.How to Find the Output Keys for Your Spell:
Open your spell in Respell.
Important: Make sure you have a Display Outputs step in your spell.
Click on the </>
API tab.
Ensure the “Wait for the spell run to finish” option is checked.
Review the output structure displayed to identify the correct keys.
Use HubSpot’s Secrets Feature: Store sensitive information like your Respell API key securely by using HubSpot’s Secrets feature.
RESPELL_API_KEY
with your API key as the value.process.env.RESPELL_API_KEY
.Access Workflow Data: Use event.inputFields
to access data from any action in your workflow, allowing you to pass dynamic data to your spell.
Error Handling: Add error handling to manage API request failures or unexpected responses.
Logging for Debugging: Use console.log()
statements to log information for debugging purposes. These logs can be viewed in the workflow execution history.
<YOUR_SPELL_ID>
with your actual spell ID.RESPELL_API_KEY
.By following these steps, you can seamlessly integrate Respell spells into your HubSpot workflows to automate phone calls using Bland AI, enhancing your automation and efficiency.