HubSpot Contact Retrieval Triggered by Slack Slash Command - n8n Workflow

Use this n8n workflow to instantly look up HubSpot contact details (by email or ID) directly from a Slack slash command, boosting sales and support efficiency. Deploy this n8n template today.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Sales Representatives who need immediate customer context without leaving Slack.
Support Agents requiring quick access to customer phone numbers and emails.
CRM Administrators looking to integrate HubSpot data directly into communication channels.
n8n users building real-time, interactive automation n8n templates.


  • Technical teams seeking efficient solutions using a custom n8n trigger.

Overview

In fast-paced sales and support environments, delays caused by switching between communication apps and the CRM (HubSpot) are costly. This specialized n8n workflow eliminates that friction by allowing users to initiate a contact lookup directly within Slack using a simple slash command. The custom n8n trigger immediately launches the automation, intelligently determines whether the input is an email address or a contact ID, performs the necessary HubSpot API call, and returns a cleanly formatted contact card to the Slack channel. This robust n8n node structure ensures rapid access to critical customer data, dramatically improving response times and operational efficiency. This entire n8n template is designed for ease of deployment and high performance.

How it Works

This automation begins with an n8n trigger set up as a Slack Slash Command Webhook.


  1. Incoming Trigger: The ๐ŸŒ Incoming Slash Command Webhook node receives the payload from Slack when a user executes the /hubspot-contact-lookup command.

  2. Input Validation: The ๐Ÿ” Check if Message Exists n8n node uses an If condition to ensure the user provided a search term. If no text is found, the workflow stops and returns an error response.

  3. Input Parsing and Routing: The โœ‚๏ธ Parse Search Input Code n8n node analyzes the input text. It uses regex to classify the input as either email or id. It also captures essential Slack context (like responseUrl).

  4. Conditional Execution: The ๐Ÿ”€ Determine Search Type If n8n node directs the flow: the true branch executes a search by email, and the false branch executes a retrieval by contact ID.

  5. HubSpot Data Retrieval: Two separate HubSpot n8n node paths handle the API call. One searches by email filter; the other performs a direct get operation by ID.

  6. Data Formatting: The subsequent Code n8n nodes (๐Ÿ“ Format Contact Info) process the retrieved HubSpot data, extracting properties (name, email, phone) and compiling them into a Markdown-formatted message string suitable for Slack.

  7. Final Delivery: The ๐Ÿ’ฌ Send Contact Info to Slack Slack n8n node sends the fully formatted contact message back to the channel or via the response URL provided by the initial n8n trigger.

Installation Guide


  1. Import: Copy the JSON provided for this n8n workflow and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Slack Setup (Trigger): Set up a new Slash Command in your Slack workspace. Point the request URL to the Webhook URL generated by the ๐ŸŒ Incoming Slash Command n8n trigger node (remember to set the path to hubspot-contact-lookup).

  3. Credential Setup:

HubSpot: Create or update your HubSpot API credentials (App Token) and link them to the HubSpot n8n node (Email Search and Get by ID).
Slack: Create or update your Slack API credentials (or use a Webhook URL if preferred) and link them to the ๐Ÿ’ฌ Send Contact Info to Slack n8n node.

  1. Activate: Save the n8n workflow and ensure it is marked as 'Active' to start listening for the Slack n8n trigger.

Node Details

๐ŸŒ Incoming Slash Command (Webhook)
Function: Serves as the primary n8n trigger, initiating the workflow upon receiving a POST request from Slack's slash command functionality.
Key Configuration: Configured to listen on the path /hubspot-contact-lookup.
โœ‚๏ธ Parse Search Input (Code)
Function: Cleans the user input and uses a regular expression to dynamically determine if the search term is an email address (searchType: 'email') or a contact ID (searchType: 'id'). This custom n8n node logic dictates the downstream flow.
๐Ÿ”€ Determine Search Type (If)
Function: Routes the n8n workflow execution based on the searchType determined by the Code n8n node, ensuring the correct HubSpot API call is made.
๐Ÿ“ง Search Contact by Email (HubSpot)
Function: Executes the contact search operation in HubSpot, specifically using the email property as a filter.
Key Configuration: Retrieves essential properties: firstname, lastname, email, and phone.
๐Ÿ†” Get Contact by ID (HubSpot)
Function: Retrieves a single HubSpot contact record when the input is classified as an ID.
๐Ÿ“ Format Contact Info (Code)
Function: These Code n8n node steps transform the raw data returned by the HubSpot n8n node into a user-friendly, Markdown-formatted message string for display in Slack.
๐Ÿ’ฌ Send Contact Info to Slack (Slack)
Function: The final action in this n8n workflow, posting the generated contact card message back to the specified Slack channel.

Related n8n Workflows

Free

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by

๐Ÿš€ Founder of iTechNotion โ€” we build custom AI-powered automation workflows for startups, agencies, and founders. ๐Ÿ’ก Specializing in agentic AI systems, content automation, sales funnels, and digital workers. ๐Ÿ”ง 14+ years in tech | Building scalable no-code/low-code solutions using n8n, OpenAI, and other API-first tools. ๐Ÿ“ฌ Letโ€™s automate what slows you down.

Featured*