> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenpartner.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HubSpot workflows

> Use HubSpot deals, forms, contacts, and companies in your Keen workflows.

The HubSpot integration connects HubSpot activity to your Keen workflows. After you connect your HubSpot account, you can trigger workflows when HubSpot deals or forms change, and you can create or update HubSpot contacts, deals, and companies from a workflow.

## What you can do

Start workflows from these HubSpot events:

* A new deal is created
* A deal is updated
* A deal moves to a different stage
* A HubSpot form is submitted

Add these HubSpot actions to a workflow:

* Create a contact
* Update a contact
* Create a deal
* Update a deal
* Create a company
* Update a company

## Connect HubSpot

<Steps>
  <Step title="Open Workflows">Open **Workflows** in Keen.</Step>

  <Step title="Create or edit a workflow">
    Create a new workflow or edit an existing one.
  </Step>

  <Step title="Add a HubSpot trigger or action">
    Add a HubSpot trigger or HubSpot action to the workflow. If HubSpot is not
    connected yet, click **Connect**.
  </Step>

  <Step title="Approve access in HubSpot">
    A HubSpot window opens. Sign in to HubSpot if prompted, choose the HubSpot
    account you want to connect, and approve the requested permissions.
  </Step>

  <Step title="Return to Keen">
    Return to Keen. HubSpot now shows as connected, and you can use HubSpot
    triggers, fields, pipelines, stages, forms, and actions in your workflows.
  </Step>
</Steps>

## Use HubSpot triggers

When you choose a HubSpot trigger, Keen listens for matching activity in your connected HubSpot account.

For deal-based triggers, you can optionally choose a specific pipeline. For the Deal Stage Changed trigger, you can also choose a specific stage. If you leave these filters blank, the workflow runs for matching deals across any pipeline or stage.

For the Form Submission trigger, you can optionally choose a specific HubSpot form. If you leave the form blank, the workflow runs for submissions from any HubSpot form.

## Use HubSpot actions

HubSpot actions send information from your workflow back to HubSpot. For example, you can:

* Create a HubSpot deal when a new lead is created in Keen
* Update a HubSpot deal when a lead status changes
* Create a HubSpot company, contact and deal from submitted form data
* Update an existing HubSpot contact after a partner action

When you configure an action, map the fields from your workflow into the HubSpot fields you want to update. You can use values from the trigger or from previous workflow steps.

## Example workflow

A common workflow looks like this:

1. **Trigger**: HubSpot form submission
2. **Filter**: continue only if the submitted form is a partner lead form
3. **Action**: create a lead in Keen
4. **Action**: notify your team in Slack

## Troubleshooting

<AccordionGroup>
  <Accordion title="The HubSpot window does not open">
    Check that pop-ups are allowed in your browser, then try connecting again.
  </Accordion>

  <Accordion title="HubSpot does not show as connected after approval">
    Refresh Keen and try connecting again.
  </Accordion>

  <Accordion title="A pipeline, stage, form, or field is missing">
    Make sure your HubSpot user has access to it in HubSpot, then reconnect the
    integration.
  </Accordion>

  <Accordion title="A workflow does not run">
    Check that the workflow is active and that any selected pipeline, stage, or
    form filters match the HubSpot event.
  </Accordion>
</AccordionGroup>
