Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.useterse.ai/llms.txt

Use this file to discover all available pages before exploring further.

Alert the team in Slack when a deal hits a key stage.

Start from a project scaffold

terse init acme-revenue
cd acme-revenue
terse integrate
terse generate

What it does

  1. Triggers on a CRM stage change.
  2. Filters for a specific stage (e.g. contract-sent).
  3. Posts a formatted alert to Slack.

Core workflow

import { createJob, TerseAgent, Trigger } from "terse-sdk"

import { Attio, AttioList, Slack, SlackChannel } from "./terse.generated"

createJob({
    name: "crm-slack-alerts",
    triggers: [Attio.onRecordUpdated({ list: AttioList.Pipeline.OpenDeals })],
    filter: (event: Trigger) => event.record.values.stage === "contract-sent",
    onTrigger: async (event: Trigger) => {
        const agent = TerseAgent.create({
            prompt: "You alert the deal desk when a contract is sent.",
            skills: [Attio.skill({ lists: [AttioList.Pipeline.OpenDeals] }), Slack.skill({ channel: SlackChannel.DealDesk })]
        })

        await agent.tools.slack.sendMessage({
            channelId: SlackChannel.DealDesk.channelId,
            message: `Contract sent for ${event.record.values.company_name} by ${event.record.values.owner_name}.`
        })
    }
})

Customize

  • Change the filter for the stage transition you care about.
  • Route by owner or segment if the whole team does not need every alert.
  • Add agent.runAndWait() if you want the workflow to include recommended next actions.