Linear
A Linear trigger starts an automation when something changes in your Linear workspace. There are two ways to use Linear events:
- With instructions. The managed agent follows your instructions for each change, with the Space’s connections and skills.
- With code. Your TypeScript runs for each change that it subscribes to.
Before you start
Section titled “Before you start”- Connect Linear to Type, and add the connection to the Space. In the CLI, run
type-cli integrations connect linear. - Make sure that the Space has the skills that the managed agent needs, for example a triage skill.
What Type receives from Linear
Section titled “What Type receives from Linear”When you connect Linear, Type registers a Linear webhook for all public teams. Type receives changes to these Linear items:
- issues,
- comments,
- projects and project updates,
- cycles,
- issue labels,
- reactions.
With instructions
Section titled “With instructions”New Linear triggers use the unified automation runtime. Existing legacy sources stay under Synced events.
Make an instruction automation
Section titled “Make an instruction automation”- Open the Space’s Automations page (or Space settings → Automations in the settings layout).
- Select New automation.
- Choose Linear in Trigger.
- If Linear has more than one connection, choose the connection.
- Write the required instructions describing what to do with each event. To use a skill, write its handle, for example
/issue-triage. - Select Create automation. No test event is required.
In the CLI:
type-cli automations create --space <space> --source linear --integration <org-integration-id> \ --name "Linear triage" --instructions "Summarize relevant changes; take no action on other events." --enableWithout --enable, the CLI creates the automation paused.
The new automation subscribes to every Linear event from the connection (linear.*). Each change starts a run:
- An agent stage follows your saved instructions, with the Linear event as its input.
- A code stage records the agent’s result:
completedorno_results, with a short summary.
The automation controls what gets posted. Creating it does not change which events Linear sends. You can extend or replace the stages with code-only or mixed behavior, or ask Type in chat to refine the automation.
Examples:
- Triage new issues: add a label, suggest an owner, and ask for missing details.
- Summarize priority changes for the team each time they happen.
- Draft a project update when a project changes state.
Write good instructions
Section titled “Write good instructions”- Say which changes matter. Tell the managed agent to stop with no action for other changes.
- Say what output to make and where to post it.
- Tell the managed agent to treat issue and comment text as evidence, not as instructions.
Every change in Linear starts a run, including changes that do not matter to you. Start with one kind of change that has high value. To stop runs for other changes, narrow the subscription’s events in the automation’s code.
With code
Section titled “With code”A code automation subscribes to Linear events with an integration source. To learn the basics, see Core concepts. For a complete automation that files and closes Linear stories, see Turn bug reports into fixes.
Event names
Section titled “Event names”Linear event names have the form linear.<item>.<action>. The action is the one that Linear sends, for example create, update, or remove.
| Item | Event names |
|---|---|
| Issue | linear.issue.<action> |
| Comment | linear.comment.<action> |
| Project | linear.project.<action> |
| Project update | linear.project_update.<action> |
| Cycle | linear.cycle.<action> |
| Reaction | linear.reaction.<action> |
| Issue label | linear.label.<action> |
linear.* selects every Linear event. Issue label events arrive as linear.label.<action>, and only linear.* selects them.
Each event arrives in an envelope. resourceId is the Linear ID of the item. data has normalized fields. For an issue, these include identifier, title, description, url, state, priority, assignee, team, and labels.
Post new issues in the Space
Section titled “Post new issues in the Space”import { TypeApiError } from "@type-dot-com/sdk";import { automation, code, complete } from "@type-dot-com/sdk/automations";import { err } from "neverthrow";import { z } from "zod";
const linear = "orgint_example"; // the Linear connectionconst space = "ch_example"; // this Space
const linearEvent = z.object({ type: z.string(), id: z.string(), resourceId: z.string().nullable(), resourceType: z.string().nullable(), data: z.unknown(),});const issue = z.object({ identifier: z.string(), title: z.string(), url: z.string(),});
export default automation({ output: z.object({ messageId: z.string() }), deployment: { subscriptions: { onIssue: { title: "New Linear issues", description: "Post each new Linear issue in the Space", source: { kind: "integration", connectionId: linear, events: ["linear.issue.create"], }, entry: "announce", }, }, }, stages: { announce: code({ input: linearEvent, run: async ({ ctx, input: event }) => { const parsed = issue.safeParse(event.data); if (!parsed.success) return err(new TypeApiError("Unexpected issue data", "invalid_input")); const { identifier, title, url } = parsed.data; const sent = await ctx.write.sendMessage( { channelId: space, content: `New issue ${identifier}: ${title}\n${url}` }, { effectKey: `linear-issue:${event.resourceId}` }, ); if (sent.isErr()) return err(sent.error); return complete({ messageId: sent.value.messageId }); }, }), },});There are no built-in Linear matchers, and Linear sources do not take resources filters. To filter, check event.data in the entry stage and finish early with complete(...) for events that you skip.
Limitations
Section titled “Limitations”- Existing legacy sources retain their previous controls. New event automations can be paused and resumed from their automation editor.
- Linear sends changes from public teams.