# HubSpot + Slack

Call a HubSpot lead who requested a callback, then share a concise call receipt in the right Slack channel.

This is an example to build and test for the user's accounts, not a preconfigured connector.

## Example

A prospect requests a demo callback. A HubSpot workflow sends the approved request to an Agent Worker, which places the call and posts its final status and call ID to a private sales channel in Slack.

## How it works

1. **Send the callback request.** In a HubSpot contact workflow, use Send a webhook to POST type lead.created and only the fields needed: a stable request ID as event_id, the contact record_id, phone number and recorded permission to call. Set X-Thoughtly-Trigger as the request header with the worker's secret. Reuse the same event ID and body for a retry; use a new request ID for a new callback.
2. **Place an authorized call.** Have the worker validate the phone number and permission, then call with a stable key based on event_id. When adapting the new-lead playbook, use event_id rather than record_id for the call key so a later callback request from the same contact is not suppressed. Enable on_call_ended for calls this worker starts. Test valid, missing-permission and duplicate events before activation; fixture runs simulate calls and cannot reach Slack.
3. **Share the receipt safely.** On call.ended, use the original contact ID and the call ID, status and available duration to post a minimal message with Slack chat.postMessage. Do not include a transcript or phone number unless approved for that channel. Check Slack's ok field and retain the returned channel and timestamp. Keep pending messages in your durable outbox; on a rate limit, have a separate scheduler retry after Retry-After. A call-ended run has a 30-second limit and is not automatically rerun after failure. Inspect the channel before retrying an uncertain post and monitor failed runs. A completed call alone does not prove a person answered.

## What you need

- HubSpot Data Hub Professional or Enterprise for the webhook action, plus permissions to edit and publish the contact workflow. Store a stable ID for each callback request.
- A Slack app installed in the chosen workspace with chat:write and access to the chosen channel. Store its bot token in the worker's Vault and allow the slack.com host.
- An enabled Agent Worker, approved execution and per-call limits, a funded wallet, and a phone number with permission to call. Worker runs and phone calls are billed separately.

Agent Worker runs are billed separately from calls and texts. Check instance availability, [pricing](/docs#pricing), permissions and the user's approved limits. Test with fictional data before activation. Preserve stable event IDs and reconcile an uncertain write before retrying it.

## Prompt

```text
Help me connect HubSpot and Slack with an Agent Worker. When an eligible contact requests a callback, validate permission and call once using a stable request ID. After the call ends, post only its status, call ID and available duration to my approved Slack channel. Show required HubSpot and Slack access, simulate valid and rejected events, handle uncertain Slack writes, and show costs before activation.
```

## Provider documentation

- [HubSpot workflow webhooks](https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows)
- [Slack chat.postMessage](https://docs.slack.dev/reference/methods/chat.postMessage/)
- [Slack rate limits](https://docs.slack.dev/apis/web-api/rate-limits/)

[Agent Worker webhook playbook](/recipes/crm-trigger-call.md) · [Connection guide](/docs#worker-connections)
