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.

Triggers define the event that starts your workflow. Each trigger is tied to an integration and fires when a specific event occurs. Your onTrigger handler receives a typed event object with the payload. In TypeScript, terse generate writes a single Triggers object in src/terse.generated.ts. Import Triggers and call the nested helpers (for example Triggers.github.onPROpened(...), Triggers.slack.onMessage(...)). System triggers use Triggers.schedule, Triggers.webhook, and Triggers.webMonitor instead of separate Schedule / Webhook / WebMonitor exports.

Integration triggers

GitHub

TriggerEvent typeDescription
Triggers.github.onPROpened()GithubPRTriggerA pull request is opened
Triggers.github.onPush()GithubPushTriggerCode is pushed to a branch
Triggers.github.trigger()GithubTriggerOther GitHub events you configure
Config: Scoped to specific repositories via repo parameter.
triggers: [Triggers.github.onPROpened({ repo: Repos.MyOrg.MyRepo })]

Slack

TriggerEvent typeDescription
Triggers.slack.onMessage()SlackTriggerA message is posted in a channel
Triggers.slack.onDm()SlackTriggerA direct message is received
Config: Scoped to specific channels or users.
triggers: [Triggers.slack.onMessage({ channel: SlackChannel.Engineering })]

Linear

TriggerEvent typeDescription
Triggers.linear.onIssueCreated()LinearIssueCreatedTriggerAn issue is created
Triggers.linear.onIssueUpdated()LinearIssueUpdatedTriggerAn issue is updated
Config: Optionally scoped to a team and/or project using generated LinearTeam / LinearProject constants (same pattern as SlackChannel for Slack).
triggers: [Triggers.linear.onIssueCreated({ team: LinearTeam.Engineering, project: LinearProject.Backend })]

Attio

Connect Attio under Integrations, configure which Attio events start each workflow in the Terse app, then run terse generate. When Attio input triggers are enabled for your workspace, Triggers.attio appears in src/terse.generated.ts. Each helper maps to an AttioEventType value (also exported from terse-sdk). Use Triggers.attio.trigger({ eventTypes: [...], object?: … }) when you need several event types or you pick the type at runtime. For record webhooks, pass object: AttioObject.YourObject to scope deliveries to one CRM object; omit object on onRecordCreated, onRecordUpdated, onRecordMerged, and onRecordDeleted when you want the union of every generated object’s attribute shape.
AreaExamples
RecordsTriggers.attio.onRecordCreated(), onRecordUpdated(), onRecordMerged(), onRecordDeleted()
Lists & entriesonListCreated(), onListEntryCreated(), onListEntryUpdated(), …
Notes & commentsonNoteCreated(), onCommentCreated(), onCommentResolved(), …
Tasks & workspaceonTaskCreated(), onWorkspaceMemberCreated(), onCallRecordingCreated(), …
Event types: Prefer the helper that matches your handler (for example AttioRecordCreatedTrigger), or AttioTrigger for the union when you use trigger().
import { Triggers } from "./terse.generated"

triggers: [Triggers.attio.onRecordCreated({ object: AttioObject.People })]

Gmail

TriggerEvent typeDescription
Triggers.gmail.onEmail()GmailTriggerA new email is received
triggers: [Triggers.gmail.onEmail()]

HeyReach

HeyReach fires when LinkedIn outreach events occur (messages, connection requests, campaign milestones, and more). Connect HeyReach under Integrations in the Terse app, then run terse generate so Triggers.heyReach and typed HeyReachCampaign constants appear in src/terse.generated.ts. Each helper maps to one HeyReachEventType value (also exported from terse-sdk). Use Triggers.heyReach.trigger({ eventType: HeyReachEventType.MESSAGE_REPLY_RECEIVED }) when you want to pick the event type dynamically.
TriggerEvent type
Triggers.heyReach.onConnectionRequestSent()HeyReachConnectionRequestSentTrigger
Triggers.heyReach.onConnectionRequestAccepted()HeyReachConnectionRequestAcceptedTrigger
Triggers.heyReach.onMessageSent()HeyReachMessageSentTrigger
Triggers.heyReach.onMessageReplyReceived()HeyReachMessageReplyReceivedTrigger
Triggers.heyReach.onInmailSent()HeyReachInmailSentTrigger
Triggers.heyReach.onInmailReplyReceived()HeyReachInmailReplyReceivedTrigger
Triggers.heyReach.onFollowSent()HeyReachFollowSentTrigger
Triggers.heyReach.onLikedPost()HeyReachLikedPostTrigger
Triggers.heyReach.onViewedProfile()HeyReachViewedProfileTrigger
Triggers.heyReach.onCampaignCompleted()HeyReachCampaignCompletedTrigger
Triggers.heyReach.onLeadTagUpdated()HeyReachLeadTagUpdatedTrigger
Config: Pass campaigns with generated HeyReachCampaign instances to handle only those campaigns; omit it to receive events from all campaigns.
import { Triggers } from "./terse.generated"

triggers: [Triggers.heyReach.onMessageReplyReceived()]

WorkOS

TriggerEvent typeDescription
Triggers.workOS.trigger()WorkOSTrigger (union)A WorkOS event you select with eventTypes
Config: Filtered by event types (user.created, organization.created, organization_membership.created, invitation.created, etc.). Prefer the typed helpers on Triggers.workOS (for example onUserCreated()) when they match your use case.
import { WorkOSEventType } from "terse-sdk"

triggers: [Triggers.workOS.trigger({ eventTypes: [WorkOSEventType.USER_CREATED] })]

Web Monitor

Track web changes continuously and get notified when there are updates. You can add multiple Triggers.webMonitor.onEvent(...) triggers to the same workflow. Terse runs each monitor independently and calls the same onTrigger handler for every matching event.
TriggerEvent typeDescription
Triggers.webMonitor.onEvent()WebMonitorTriggerFires when scheduled web monitoring detects relevant changes
import { createJob, TerseAgent } from "terse-sdk"
import * as z from "zod"
import { Skills, SlackChannel, Triggers } from "./terse.generated"

const outputSchema = z.object({
    summary: z.string(),
    sentiment: z.enum(["positive", "negative", "neutral"])
})

createJob({
    name: "Web monitor trigger",
    triggers: [
        Triggers.webMonitor.onEvent({
            query: "What are a16z's latest investments?",
            frequency: { number: 1, unit: "day" },
            outputSchema
        })
    ],
    onTrigger: async event => {
        const summary = event.payload.summary
        const sentiment = event.payload.sentiment
        const sources = event.sourceUrls.join(", ")

        const agent = TerseAgent.create({
            prompt:
                "You are alerted when the web monitor finds new material. Read the event (query, payload, and structured fields), decide what matters, and post a concise summary to Slack.",
            skills: [Skills.slack({ channel: SlackChannel.AllTerseInc })]
        })

        await agent.runAndWait(
            `${event.formatForAgentRunner()}\n\nSummary: ${summary}\nSentiment: ${sentiment}\nSources: ${sources}`
        )
    }
})
If you need to annotate monitor events manually, import WebMonitorTriggerFor from terse-sdk and bind it to your Zod schema:
import type { WebMonitorTriggerFor } from "terse-sdk";
import * as z from "zod";

const outputSchema = z.object({
  summary: z.string(),
  sentiment: z.enum(["positive", "negative", "neutral"]),
});

type MonitorEvent = WebMonitorTriggerFor<typeof outputSchema>

Writing effective queries

The monitor matches by intent, not keywords. Write your query as a natural sentence describing what you care about — not a search string. Do:
  • Write in plain language: "What are a16z's latest investments?"
  • Track narratives and social buzz: "What are people saying on Twitter about Cloud agents?"
  • Be specific about subject and signal: "FDA approval decisions for GLP-1 drugs"
  • Combine related signals: "OpenAI or Anthropic model releases and benchmark results"
Don’t:
  • Use Boolean operators (AND, OR, NOT) — this is not a search engine
  • Include specific dates — monitors track new developments going forward, not history
  • Write keyword dumps: "acme corp acme funding raise series B"
Choosing frequency:
FrequencyBest for
1hBreaking news, social signals, fast-moving markets
1dPress releases, blog posts, job postings, pricing page changes
1wRegulatory filings, quarterly reports, slow competitive signals

System triggers

Schedule

TriggerEvent typeDescription
Triggers.schedule.cron()CronTriggerFires on a cron schedule
triggers: [Triggers.schedule.cron({ expression: "0 9 * * 1" })] // Every Monday at 9am

Webhook

TriggerEvent typeDescription
Triggers.webhook.onRequest()WebhookTriggerFires when an HTTP request hits the generated webhook URL
Webhook URLs are auto-generated on deploy and remain stable across redeploys. After terse deploy, the CLI prints that URL for each affected workflow so you can copy it straight into your caller or load test. Pass a type argument to Triggers.webhook.onRequest<YourPayload>() so onTrigger and filter see your JSON body shape on event.body (defaults to unknown when omitted).
triggers: [Triggers.webhook.onRequest()]

Common event interface

All triggers resolve to the shared canonical Trigger payload shape. Your handler receives the concrete subtype for the trigger you selected.
interface Trigger {
  readonly integrationType: string
  readonly eventType: string
}
Each trigger subtype adds its own canonical fields, such as Slack message metadata, GitHub PR data, webhook request bodies, or cron trigger context.