Skip to main content

Scenario

Your #wins and #losses channels (or #deal-updates) capture the language of victory and defeat. This job combines both, feeds them to Mavera’s Brand Voice endpoint, and extracts two complementary voices: a “winning voice” (confidence, proof, momentum) and a “recovery voice” (empathy, resilience, learning). Both are useful for marketing — wins for case studies and sales enablement, losses for retention and re-engagement campaigns. Flow: Slack conversations.history (#wins + #losses) → Concatenate → Mavera POST /brand-voices → Two brand voices + test generation

Code

Example Output

Error Handling

Win channels often have 3-5x more messages than loss channels. The code takes the last 50 from each to balance the voice extraction.
Wins often get cross-posted. Deduplicate by matching the first 100 chars of message text before building the corpus.
Win/loss messages may contain deal sizes, customer names, and competitive details. The Brand Voice endpoint extracts patterns, not specifics — but review the voice traits to confirm no PII leaked through.