# Salesforce + Calendly

Connect Calendly bookings to Salesforce lead follow-up with a custom Agent Worker.

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

## Example

A prospect schedules a discovery meeting. The worker matches the invitee with a Salesforce lead and, where the prospect has agreed, calls and records the result for the sales team.

## How it works

1. **Verify the Calendly event.** Subscribe to invitee.created and invitee.canceled, and verify the signature and timestamp on the original webhook body. For reliable delivery, use your own receiver to verify and durably store the event, respond within Calendly's 15-second read timeout, then forward a normalized event with a stable event_id to the authenticated Worker webhook. Reuse the same ID and body on retry. An accepted replay returns the existing run even if it failed; inspect its receipt and reconcile any side effects before sending a recovery event with a new event_id. The direct private URL runs synchronously; every delivery that starts a run is billed, including retries.
2. **Match the lead.** Look up the invitee in the selected Salesforce org using the agreed identity field. Decide what to do when there are no matches or several matches.
3. **Follow up and log the result.** Check the recipient's phone and permission, then place the approved call and log its ID and observed outcome to the right lead or task. Reconcile reschedules before initiating another call.

## What you need

- Calendly webhook subscription access, a signing key and your own durable receiver for the handoff described above.
- Salesforce org access and scoped permissions for the lead lookup and chosen write.
- An enabled Agent Worker, a funded wallet for calls, and an authorized phone number.

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 Calendly bookings to Salesforce lead follow-up. Verify signed events, match the right lead, handle reschedules and call only with permission. Log the call receipt and show tests and costs before activating the worker.
```

## Provider documentation

- [Calendly webhook subscriptions](https://developer.calendly.com/docs/api-guides/receive-data-from-scheduled-events-in-real-time-with-webhook-subscriptions)
- [Calendly webhook signatures](https://developer.calendly.com/api-docs/overview/webhooks/webhook-signatures)
- [Calendly webhook timeouts](https://developer.calendly.com/api-docs/overview/webhooks/webhook-timeouts)
- [Salesforce: create records with REST](https://developer.salesforce.com/docs/marketing/marketing-cloud-growth/guide/mc-manage-objects-create-rest.html)

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