AI & RAG

Index Closed-Lost Salesforce Deals into the Battlecard Knowledge Base

On every closed-lost opportunity in Salesforce, this workflow extracts the loss reason and competitor, summarizes the notes, and writes a clean.

CategoryAI & RAG
Enginesim
Difficultyintermediate
Triggerevent
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerOpportunity set to Closed Lost in SalesforceSalesforce
  • LogicSkip if competitor or loss reason missing
  • ActionSummarize notes into structured win-loss recordOpenAI
  • ActionEmbed and upsert into knowledge basePostgreSQLPostgres
  • OutputPost capture digest to SlackSlack

What it does

Whenever a deal is marked closed-lost in Salesforce, it captures the loss reason, the winning competitor, and the free-text notes, distills them into a structured win-loss entry, and stores it as an embedded record so your answerbot can retrieve it later.

When to use it

Use it to keep your battlecard knowledge base fresh automatically instead of relying on someone to manually copy CRM notes. Ideal once you have a Slack or chat answerbot that reads from the same Postgres vector store.

How it works

  1. 1A Salesforce opportunity moves to Closed Lost, firing the trigger.
  2. 2A filter confirms a competitor and loss reason are present; deals without them are skipped.
  3. 3The opportunity notes are summarized by an LLM into a structured win-loss record (competitor, objection, what we missed).
  4. 4The summary is embedded and upserted into the Postgres knowledge base keyed by competitor.
  5. 5A short digest is posted so the team knows a new loss was captured.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect SalesforceAccounts, opportunities, cases.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  3. 3
    Connect OpenAIModels, embeddings, files.
  4. 4
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.