Skip to main content

Advanced

React to events by emailing Deck

Some context is best captured the moment it happens. A meeting gets booked, a deal moves stage, a transcript finishes uploading — instead of polling on a schedule, hook into the event and email Deck right then.

The pattern

A webhook flow has three steps:

  1. Receive — a small HTTP endpoint accepts the webhook (Calendly, Cal.com, Granola, Stripe, Linear, your own backend — anyone who sends them).
  2. Compose — pull the fields you care about and write a short email body.
  3. Send — email your assistant address with a subject prefix that routes the event to the right project. Deck files it.

Then, when you want to act on what's been filed — a meeting prep brief, a deal-stage recap, a daily summary of events — either ask Deck directly or set up a scheduled task that runs on top of the stored events on a cadence.

A worked example: a new meeting was just booked

A Cal.com booking fires a webhook. Your endpoint emails one short note to Deck with the booking details so the meeting lives in your calendar context.

new_meeting_handler.py
DECK_EMAIL = "your-name@agent.hellodeck.ai"

def notify(invitee_name, invitee_email, start, end, event_type, notes=""):
creds = get_credentials()

body = f"""New meeting booked. Store this in my calendar context.

## New meeting
- **With:** {invitee_name} ({invitee_email})
- **When:** {start}{end}
- **Type:** {event_type}
- **Notes:** {notes or 'None'}
"""
send_email(creds, DECK_EMAIL, f"Brain — New meeting: {invitee_name}", body)

Cal.com payload → handler:

def handle_calcom(payload):
booking = payload["payload"]
invitee = (booking.get("attendees") or [{}])[0]
notify(
invitee_name=invitee.get("name", "Unknown"),
invitee_email=invitee.get("email", ""),
start=booking.get("startTime", ""),
end=booking.get("endTime", ""),
event_type=booking.get("title", "Meeting"),
notes=booking.get("description", ""),
)

Now Deck has the meeting on file. To get prep before the call, pair this with a scheduled task — for example, a daily 7 AM brief: "for every meeting on today's calendar, give me what I have on the person in Pipeline — past threads, stage, any commitments still open." Or ask Deck directly anytime: "I have a meeting with Jane at Acme this afternoon — what do I know about her?"

Event-to-email recipes

Event sourceTriggerWhat you email Deck
Calendly / Cal.comNew meeting bookedFile the meeting in Brain; daily task pulls prep from Pipeline.
Fireflies / GranolaRecording finishedFile the transcript in Pipeline against the right deal.
HubSpot / SalesforceDeal stage changesFile the stage move in Pipeline; weekly task surfaces what's drifted.
Linear / JiraIssue marked blockedFile the block in Product; scheduled task digests blockers daily.
StripeSubscription created or cancelledFile the event in Pipeline; weekly task flags churn-risk patterns.
GitHubPR merged on critical repoFile the PR summary in Product.
Your own backendAnything importantAnything you want filed for later querying.

Where to host the endpoint

You need a public URL that accepts a POST. Some good options:

OptionBest forNotes
PipedreamNo-code or low-code, free tierBuilt-in HTTP trigger + email sender. You can write the body in a JS/Python step. Best place to start if you don't already have infra.
Cloudflare WorkersFast, free, low-friction codeOne file, deploy with wrangler. Great for stateless webhook receivers.
Vercel / Next.js API routesYou already have a Vercel appDrop a file in app/api/webhooks/[source]/route.ts and you're done.
AWS Lambda + API GatewayYou're already on AWSFamiliar if your team already has the stack. More moving parts.
Modal @web_endpointPython team, want code-firstOne decorator turns a function into a URL. Pairs well with the cron examples.
Zapier / Make.comPure no-code, you want clicks instead of codeWebhook → "Send email" step. Slightly less flexible bodies.

Security and reliability

  • Verify webhook signatures. Most providers sign their webhooks (HMAC). Verify before sending the email so a stranger can't pipe junk into your assistant.
  • Retry on failure. If sending the email fails, log it and retry. Most hosts (Pipedream, Cloudflare, Lambda) handle this if you don't swallow the error.
  • Rate-limit your own endpoint. If a source could fire a thousand events in a minute, batch them on your side before emailing Deck.
  • Gate noisy sources at the edge. Drop or coalesce events in your handler before they hit Deck — a single source that fires hundreds of times an hour will bury the signal you actually wanted.

Common questions

Can I do this without writing any code?

Yes. Pipedream, Zapier, and Make.com all let you wire "when X happens, send this email" with a few clicks. Point them at your assistant address, build the subject + body from the payload fields, and deploy.

What if my source doesn't send webhooks?

Use the scheduled snapshots pattern instead — poll the API on a schedule and email any new items.

Will Deck send anything to the webhook source?

No. Deck's replies only go back to you, and only in response to messages you've sent. Webhooks file events into Deck; nothing flows the other direction.

How do I act on filed events?

Either ask Deck directly when you want context ("what new meetings landed today?") or set up a scheduled task that runs on top of the stored events on a cadence ("every weekday at 7 AM, give me prep for today's meetings").

Next