Pardon the mess

You are viewing docs related to an older version of Sequin. We’re in the process of updating our provider-specific guides and will be done in a few weeks (May 2024). Please click here to view the latest version of the docs.

If you’re interested in Linear and want to learn more about what’s changing, send us a note.

Supported objects

Collection NameReadWrite
Issues
Teams
Users
Projects
Milestones
Cycles
Comments
Labels
Documents
Attachments
Webhooks

Setup & installation

To connect Sequin to Linear, you need to generate an API key from your Linear settings and add it to Sequin.

Generate an API key from Linear

Steps:

  1. Go to your Linear settings, find the API section.
  2. Generate a new API key by clicking on the “New API key” button.
  3. Choose the scopes for the API key according to the access level you wish to grant Sequin.
  4. Copy the generated API key.

Install Sequin with Linear

  1. In the Sequin console, click Add sync and select Linear.
  2. Enter the API key you generated from Linear.
  3. Select the collections and data you want to sync.

After you’ve set up the sync, Sequin will backfill your database with your Linear data.

The syncing process

We first backfill your database with all your Linear data. Backfilling typically completes in a few minutes. For larger Linear workspaces this can take longer - if you have a workspace with millions of objects this may take up to an hour. We’ll email you when your backfill is complete and Sequin has loaded all your data into your database.

After the initial backfill, we’ll rely on Linear webhooks to monitor changes. Webhooks allow Sequin to instantly capture changes to your Linear data. We backstop webhooks with an occasional polling process to ensure we don’t miss any events. This means changes on Linear should propagate to your database in just a few seconds.

Learn more about [our syncing process]/syncs.

Read and write Linear data using SQL

After synchronization, access your Linear data using SQL through Sequin’s Postgres Proxy.

Here’s how Linear data may appear in your database:

db7hea89oah3tas=> \dt

                 List of relations
 Schema |         Name         | Type  |  Owner
--------+----------------------+-------+----------
 public | _sync_cdc            | table | sequin
 public | issues               | table | sequin
 public | teams                | table | sequin
 public | users                | table | sequin
 public | projects             | table | sequin
 public | milestones           | table | sequin
 public | cycles               | table | sequin
 public | comments             | table | sequin
 public | labels               | table | sequin
 public | attachments          | table | sequin
(10 rows)

Querying Issues

Example of querying the issues table:

select
    id,
    title,
    description,
    state,
    priority,
    creator_id,
    assignee_id,
    created_at,
    updated_at
from
    issues
where
    team_id = 'linear_team_id';

Which returns a row like:

-[ RECORD 1 ]+-------------------------
id           | lin_abcdefghijk
title        | Implement OAuth 2.0 flow
description  | Implement the OAuth 2.0 flow to allow users to authenticate using external providers.
state        | todo
priority     | high
creator_id   | lin_creator123
assignee_id  | lin_assignee456
created_at   | 2023-11-01T10:00:00.000Z
updated_at   | 2023-11-03T15:30:00.000Z

Updating an Issue

To update an issue’s state:

update issues
set state = 'completed'
where id = 'lin_abcdefghijk';

Sequin validates the write through the Linear API in real time so your change applies to Linear and your database immediately.

If a write to Linear through Sequin fails, Sequin returns the error as a Postgres error and rolls back the transaction. For example, if you try to update an issue that doesn’t exist, Sequin returns the following error:

db7hea89oah3tas=> update issues set state = 'completed' where id = 'lin_abcdefghijk';
ERROR:  [Linear] Issue `lin_abcdefghijk` not found

Next steps

Your Linear tables are now available as fully readable and writeable tables in your database. You can query for all your data using SQL, and mutate data thanks to Sequin’s Postgres Proxy. To build on this foundation, here are some next steps:

  • Setup your ORM to work with your synced tables.
  • Edit the Linear objects and properties you’re syncing at any time.
  • Create views on your Linear data to tailor your schema to your needs.
  • Invite your team to your Sequin account and start building!

If you need assistance setting up your sync, just send us a note. We’re around and eager to help.

Was this page helpful?