draft_outreach
Produce two outreach draft variants (A/B) for a lead given an angle. Both drafts are warm and kind by design (P10) — variants differ in angle of helpfulness (subject hook, opening framing, call-to-action) not in tone. Drafts are written to lead_drafts as pending_review. Returns IDs + previews. Use after synthesize_lead_hypothesis to draft initial outreach.
[write-tier — first use may require a manager's approval; a from-now-on approval makes future calls seamless, a just-once approval re-asks next time.]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| angle | Yes | The outreach angle to use (e.g., 'deeper_lp3_discovery', 'lighter_touch_different_hook', 'jurisdiction_clarification', 'kind_check_in'). Take from synthesize_lead_hypothesis.suggested_angle if unsure. | |
| lead_id | Yes | UUID of the lead. | |
| reply_to | No | Optional Reply-To address to carry on the eventual send (CONTRACT-1 agent thread address). Stamped into both drafts' metadata (best-effort — the metadata column is additive); send_lead_draft reads it at send time and passes it to send_email. Never changes what is drafted. | |
| companyId | Yes | FreedomOS company id to act within (you must be a member). Required for company-scoped tools. | |
| from_name | No | Optional sender display name (e.g., 'Acme Team', 'Alex at Acme'). Used in draft signature. When omitted, the CONTRACT-5 chain resolves it: the company's mcp_connections.resend.auth_config.from_name, else a generic 'Team'. Sequence callers pass the sequence's owning agent's name here (the top of the chain). | |
| eligible_at | No | Optional ISO timestamp — the earliest real time this draft may be sent (2026-07-13 send-timing gate). For a sequence step, pass now + that step's delay_hours (an ESTIMATE; the send-gate re-stamps it to the real value once the prior step actually resolves). Omitted → eligible immediately (the correct default for step 1 and for manual one-off drafts). | |
| sequence_id | No | Optional. The outreach_sequences.id the step belongs to. Pass it together with sequence_step_id to enable the A/B prior-stats bias — step ids repeat across sequences (step1…stepN), so stats are only comparable within one sequence. Also persisted on the draft row so the send-gate can resolve "the next step's draft" by an exact join instead of guessing. Omitted → no bias, no sequence linkage (manual one-off draft). | |
| company_context | No | Optional short summary of the company the lead arrived at (e.g., 'Acme Health — pharmacy compounding compliance consulting'). Helps the model pitch correctly. | |
| journey_summary | Yes | Short prose summary of what we know about this lead (their state, recent activity, what they engaged with). Used as context for the draft. Synthesis.intent_summary + 1-2 notes works well. | |
| sequence_step_id | No | Optional. If this draft is part of an auto-mode sequence step, pass the step_id from outreach_sequences. Otherwise omit (manual one-off draft). | |
| regenerated_reason | No | Optional (regenerate-on-signal, 2026-07-15). When the sequencer re-drafts a not-yet-sent step after a meaningful lead signal (temperature flip to hot, a click), it passes a short human-readable reason (e.g. 'redrafted after they clicked'). Stamped into both drafts' metadata.regenerated_reason so the review card can show WHY the copy was refreshed. Never changes drafting logic — provenance only. | |
| variant_b_guidance | No | Optional (CONTRACT-3). Sequence-designed seed for the B variant — a distilled subject+body angle persisted on the sequence step (steps jsonb, additive variant_b_guidance key). When present, variant_b is grounded in this guidance while variant_a stays the model's best independent take on the main angle. Omitted → both variants generated exactly as before. |