Code & Snippets

Connection Strength Router — specific partner vs random.

Reads a company's connection-strength field and routes the Zap to the partner with that relationship — or to a random senior partner if no relationship exists. Pairs with the intro / congrats outreach Zaps.

Sourcing
JavaScript · 17 lines
C.1

Download

Grab the source file. Drop it into your service, set the required environment variables, and deploy.

Download connection_router.jsJavaScript · 17 lines
C.2

How it works

The gist

One-liner router that reads a company's connection-strength field and decides who drafts the outreach:

  • Specific — we have a relationship on file. Route the Zap to the partner who owns that relationship so the email comes from the right voice.
  • Random — no relationship. Route to a random senior partner from the pool so the founder still hears from a real person, not a generic inbox.

Pairs with the intro / congrats outreach Zaps that fire when a new company deal lands — this snippet is the gate that picks who the email is actually from.

The flow

  1. InputinputData["connection strength"] (string field from the CRM; bracket access because of the space in the key).
  2. Empty check. Null, undefined, or whitespace-only → Random.
  3. Otherwise → Specific. Downstream branches in the Zap key off this single field: Specific fans out into per-partner sub-branches (one per owning partner), Random picks from a small pool of senior partners.
  4. Return { result }. One field, two values, trivial to branch on.

Why this exists

The hardest part of outbound from a fund isn't writing the email — it's deciding who sends it. This snippet is the boring two-line decision that keeps the rest of the outreach automation honest: relationship in CRM, that partner sends; no relationship, the pool sends. No founder ever gets "hi, I'm an automation" as the From line.

C.3

Used in these automations

This snippet powers the end-to-end automations below. Open either for the full tool chain, prompts, and job-to-be-done context.

C.4

Source

Full source, exactly as shipped. The download above is byte-identical.

connection_router.jsJavaScript
// Read the connection strength field for a company. If we have one,
// the Zap routes to the partner with that relationship (Specific). If
// not, the Zap routes to a random senior partner from the pool (Random).
//
// Pairs with the intro / congrats outreach Zaps that fire when a new
// company deal lands and someone has to actually be assigned to draft.

// Get the input value
const connectionStrength = inputData["connection strength"];

// Check if empty, null, or undefined
if (!connectionStrength || connectionStrength.trim() === "") {
  return { result: "Random" };
} else {
  return { result: "Specific" };
}