createJob() in TypeScript. In the Terse app and across these docs, we call them workflows. Same thing, different name.
Anatomy of a job
Every job has four parts:Name
A unique string identifier. Terse uses this to match the job across deploys, so if you rename it, the platform treats it as a new job. Keep names stable and descriptive.Triggers
The event that starts the job. A trigger is always tied to an integration (Attio record created, Slack message received, GitHub PR opened) or to the system (cron schedule, webhook). A job can have multiple triggers, but each execution is started by exactly one event.Skills
The integrations available to the model during agentic calls (run and runAndWait). Skills don’t limit what your code can do with deterministic tool calls. They only control what the LLM can reach for when it’s reasoning.
Handler
The function that runs when the trigger fires. It receives the trigger event and aTerseAgent instance. Inside the handler, you can make deterministic tool calls, run the model, parse structured output, or combine all three.
What happens when a job runs
- Trigger fires. An event arrives from the connected integration or on the configured schedule.
- Filter evaluates. If you defined a
filterfunction, Terse calls it with the event. Returnfalseto skip the run entirely. No tokens spent, no side effects. - Handler executes. Your
onTrigger(TypeScript) runs with the event payload and aTerseAgent. You control the logic: call tools deterministically, hand off to the model, or both. - Run is recorded. Every execution, whether it succeeds or fails, is logged in Activity with the full action trace so you can inspect what happened.
Deterministic vs. agentic
Inside a handler, you have two ways to get things done:| Approach | How | When to use |
|---|---|---|
| Deterministic | agent.tools.* or executeTool() | You know exactly which tool to call and with what parameters |
| Agentic | run() or runAndWait() | You need the model to reason, summarize, classify, or decide |
Filtering events
Not every event needs a full run. Usefilter to skip events that don’t match your criteria before the handler executes.
Tool approvals
For jobs that write to production systems, you can require human approval before specific tools execute. List the tool names intoolApprovals (TypeScript). During local testing, the CLI prompts in your terminal. In production, approval requests appear in the Terse app under Notifications.
Lifecycle
Jobs follow a straightforward path from code to production:- Define. For TypeScript, register workflows with top-level
createJob()insrc/terse.jobs.ts(or split across files and import them for side effects). For Python, define jobs insrc/main.py. - Generate. Run
terse generateto get typed helpers for your integrations. - Test. Run
terse testto execute against real sample events locally. - Deploy. Run
terse deployto package and host serverlessly. New jobs are created, existing jobs are updated, and removed jobs are cleaned up. - Monitor. View runs, actions, and failures in the Activity tab.
Where to go next
Deterministic tool calls
Call integration tools directly from code, no LLM in the loop.
Triggers reference
Every available trigger and its event payload.
