Skip to content

Linear

Linear issues, history, comments, projects, cycles, initiatives and customers as SQL tables

Connector software
Free and open source
Service credentials
Required
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/linear/index.md to help me query Linear with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Find projects that need attention

Uses your connected account. Set up the connector and credentials to run it with your data.

SELECT name, health, lead, target_date
FROM linear.main.projects
WHERE health IN ('atRisk', 'offTrack')
ORDER BY target_date

Quick start

Choose where to run Linear, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'linear' AS linear (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-linear'
);

3. Add service credentials

After attaching, create the secret for the service you want to query in the same SQL session. Replace the placeholders with your service settings.

linear credentials

A Linear personal API key or OAuth 2.0 access token (plus an optional GraphQL endpoint)

Get these credentials →
secret.sql
CREATE SECRET linear (
    TYPE linear,
    api_key      '<LINEAR_API_KEY>',  -- secret
    access_token '<ACCESS_TOKEN>',  -- secret
    base_url     '<base_url>'
);
Credential fields and requirements →

4. Run a query

query.sql
SELECT name, health, lead, target_date
FROM linear.main.projects
WHERE health IN ('atRisk', 'offTrack')
ORDER BY target_date
More example queries →
Technical details
Verified connector release
v0.2.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach the release directly

Uses the verified release each time you attach the connector.

ATTACH 'linear' AS linear (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Linear issue tracking as SQL: issues with state history, comments, attachments and relations, plus teams, projects, cycles, initiatives and customers, read-only from the Linear GraphQL API.

Catalog

Everything linear exposes once attached — read straight from the worker's released build.

linear 1 schema
main 13 tables · 5 functions

Linear issues, their history and discussion, and workspace planning objects, read-only.

Schema examples (12)
Examples (12)

Open ENG issues by priority (both predicates become one IssueFilter)

SELECT key, title, status, assignee
FROM linear.main.issues()
WHERE team_key = 'ENG' AND state = 'open'
ORDER BY priority, key;

Issues created since October by workflow state

SELECT status, count(*) AS issues
FROM linear.main.issues()
WHERE created_at >= TIMESTAMPTZ '2026-10-01'
GROUP BY status
ORDER BY issues DESC;

State transitions of one issue

SELECT created_at, actor, from_state, to_state
FROM linear.main.issue_history(issue_key := 'ENG-1')
WHERE is_state_change
ORDER BY created_at;

Cycle time (first started → completed) per ENG issue

SELECT issue_key,
  (epoch(max(created_at) FILTER (WHERE to_state_type = 'completed')) - epoch(min(created_at) FILTER (WHERE to_state_type = 'started'))) / 3600 AS cycle_time_hours
FROM linear.main.issue_history()
WHERE team_key = 'ENG'
GROUP BY issue_key
ORDER BY issue_key;
8 more examples

The discussion on one issue

SELECT created_at, user_login, body
FROM linear.main.comments(issue_key := 'ENG-1')
ORDER BY created_at;

Most active commenters since October

SELECT user_login, count(*) AS comments
FROM linear.main.comments()
WHERE created_at >= TIMESTAMPTZ '2026-10-01'
GROUP BY user_login
ORDER BY comments DESC;

Links attached to one issue

SELECT title, url, source_type
FROM linear.main.attachments(issue_key := 'ENG-1')
ORDER BY title;

Attachments by integration

SELECT source_type, count(*)
FROM linear.main.attachments()
GROUP BY source_type
ORDER BY source_type;

What blocks what

SELECT issue_key, related_issue_key
FROM linear.main.issue_relations()
WHERE type = 'blocks'
ORDER BY issue_key;

Teams and whether they use cycles

SELECT key, name, cycles_enabled FROM linear.main.teams ORDER BY key;

The ENG board's columns in order

SELECT name, type
FROM linear.main.workflow_states
WHERE team_key = 'ENG'
ORDER BY position;

Labels and their scope

SELECT name, coalesce(team_key, '(workspace)') AS scope
FROM linear.main.labels
WHERE NOT is_group
ORDER BY name;
Tables
audit_entries 1 example10 cols

The Linear workspace audit log (requires an admin API key)

Columns
idnot null VARCHAR
Audit entry UUID.
type VARCHAR
Event type, e.g. user.login. Pushed down.
created_at TIMESTAMP WITH TIME ZONE
When it happened. Pushed down.
user_login VARCHAR
Actor's display name. Pushed down.
actor_id VARCHAR
Actor's user UUID. Pushed down.
ip VARCHAR
Client IP address. Pushed down.
country_code VARCHAR
Two-letter country of the IP. Pushed down.
metadata JSON
Event-specific details as JSON.
request_information JSON
Request details (user agent …) as JSON.
updated_at TIMESTAMP WITH TIME ZONE
When the entry last changed.
ConstraintsPRIMARY KEY (id)
Example

Recent sign-ins

SELECT created_at, user_login, ip
FROM linear.main.audit_entries
WHERE type = 'user.login'
ORDER BY created_at DESC;
Link
customer_needs 1 example14 cols

Customer requests (needs) linked to Linear issues and projects

Columns
idnot null VARCHAR
Customer need UUID.
customer VARCHAR
Customer name. Pushed down.
customer_id VARCHAR
Customer UUID. Pushed down.
issue_key VARCHAR
Identifier of the linked issue. Pushed down.
issue_id VARCHAR
UUID of the linked issue. Pushed down.
project VARCHAR
Name of the linked project. Pushed down.
project_id VARCHAR
UUID of the linked project.
priority INTEGER
Importance score from 0 to 1 (higher number = more important; 0 normal, 1 important). Pushed down.
body VARCHAR
The request text (Markdown).
user_login VARCHAR
Creator's display name.
html_url VARCHAR
Link to the request's source, if any.
created_at TIMESTAMP WITH TIME ZONE
When the request was recorded. Pushed down.
updated_at TIMESTAMP WITH TIME ZONE
When it last changed.
archived_at TIMESTAMP WITH TIME ZONE
When it was archived.
ConstraintsPRIMARY KEY (id)
Example

Most-requested issues

SELECT issue_key, count(*) AS requests, list(DISTINCT customer) AS customers
FROM linear.main.customer_needs
WHERE issue_key IS NOT NULL
GROUP BY issue_key
ORDER BY requests DESC;
Link
customers 1 example14 cols

Customers tracked in Linear (Linear Customers / Asks)

Columns
idnot null VARCHAR
Customer UUID.
name VARCHAR
Customer name. Pushed down.
domains VARCHAR[]
Email / web domains of the customer.
external_ids VARCHAR[]
IDs of the customer in other systems (CRM).
revenue BIGINT
Annual revenue amount in the workspace's currency units, as entered. Pushed down.
size DOUBLE
Company size as a number of employees, as entered.
status VARCHAR
Customer status name.
tier VARCHAR
Customer tier name.
owner VARCHAR
Owner's display name. Pushed down.
approximate_need_count DOUBLE
Approximate number of customer requests.
html_url VARCHAR
Link to the customer.
created_at TIMESTAMP WITH TIME ZONE
When the customer was added.
updated_at TIMESTAMP WITH TIME ZONE
When it last changed.
archived_at TIMESTAMP WITH TIME ZONE
When it was archived.
ConstraintsPRIMARY KEY (id)
Example

Customers by revenue

SELECT name, tier, revenue
FROM linear.main.customers
ORDER BY revenue DESC NULLS LAST;
Link
cycles 1 example18 cols

Linear cycles (sprints) of every team

Columns
idnot null VARCHAR
Cycle UUID.
number INTEGER
Sequence number of the cycle within its team (1, 2, 3 …). Pushed down.
name VARCHAR
Optional cycle name.
team_key VARCHAR
Team key. Pushed down.
team_id VARCHAR
Team UUID. Pushed down.
starts_at TIMESTAMP WITH TIME ZONE
Cycle start. Pushed down.
ends_at TIMESTAMP WITH TIME ZONE
Cycle end. Pushed down.
completed_at TIMESTAMP WITH TIME ZONE
When the cycle was completed.
is_active BOOLEAN
The team's current cycle. Pushed down.
is_future BOOLEAN
Starts in the future. Pushed down.
is_past BOOLEAN
Already ended. Pushed down.
is_next BOOLEAN
The next cycle. Pushed down.
is_previous BOOLEAN
The previous cycle. Pushed down.
progress DOUBLE
Completed fraction of the scope, a ratio from 0 to 1.
description VARCHAR
Cycle description.
created_at TIMESTAMP WITH TIME ZONE
When the cycle was created.
updated_at TIMESTAMP WITH TIME ZONE
When the cycle last changed.
archived_at TIMESTAMP WITH TIME ZONE
When the cycle was archived.
ConstraintsPRIMARY KEY (id)
Example

Each team's active cycle

SELECT team_key, number, starts_at, ends_at
FROM linear.main.cycles
WHERE is_active
ORDER BY team_key;
Link
initiatives 1 example15 cols

Linear initiatives (groups of projects toward a company goal)

Columns
idnot null VARCHAR
Initiative UUID.
name VARCHAR
Initiative name. Pushed down.
description VARCHAR
Free-text summary written by the owner.
status VARCHAR
Proposed, Planned, Active, Completed or Canceled. Pushed down.
health VARCHAR
onTrack, atRisk or offTrack; NULL if never reported. Pushed down.
owner VARCHAR
Owner's display name. Pushed down.
user_login VARCHAR
Creator's display name.
target_date DATE
Calendar day the work is due to be finished.
project_names VARCHAR[]
Names of the initiative's projects (first 50).
html_url VARCHAR
Link to the initiative.
started_at TIMESTAMP WITH TIME ZONE
When the initiative started.
completed_at TIMESTAMP WITH TIME ZONE
When it was completed.
created_at TIMESTAMP WITH TIME ZONE
When it was created.
updated_at TIMESTAMP WITH TIME ZONE
When it last changed.
archived_at TIMESTAMP WITH TIME ZONE
When it was archived.
ConstraintsPRIMARY KEY (id)
Example

Initiatives and how many projects each has

SELECT name, status, len(project_names) AS projects
FROM linear.main.initiatives
ORDER BY name;
Link
labels 1 example11 cols

Linear issue labels (workspace and team labels, groups and their children)

Columns
idnot null VARCHAR
Label UUID.
name VARCHAR
Label name. Pushed down.
description VARCHAR
Label description.
color VARCHAR
Label color (hex).
is_group BOOLEAN
Whether this is a label group. Pushed down.
parent_id VARCHAR
UUID of the group the label belongs to.
parent_name VARCHAR
Name of the group the label belongs to. Pushed down.
team_key VARCHAR
Team key for team labels; NULL for workspace labels. Pushed down.
created_at TIMESTAMP WITH TIME ZONE
When the label was created.
updated_at TIMESTAMP WITH TIME ZONE
When the label last changed.
archived_at TIMESTAMP WITH TIME ZONE
When the label was archived.
ConstraintsPRIMARY KEY (id)
Example

Labels and their scope

SELECT name, coalesce(team_key, '(workspace)') AS scope
FROM linear.main.labels
WHERE NOT is_group
ORDER BY name;
Link
project_milestones 1 example11 cols

Milestones of Linear projects with status, progress and target dates

Columns
idnot null VARCHAR
Milestone UUID.
name VARCHAR
Milestone name. Pushed down.
project VARCHAR
Project name. Pushed down.
project_id VARCHAR
Project UUID. Pushed down.
status VARCHAR
unstarted, next, overdue or done.
progress DOUBLE
Completed fraction of the scope, a ratio from 0 to 1.
target_date DATE
Calendar day the work is due to be finished.
description VARCHAR
Milestone description (Markdown).
created_at TIMESTAMP WITH TIME ZONE
When the milestone was created.
updated_at TIMESTAMP WITH TIME ZONE
When the milestone last changed.
archived_at TIMESTAMP WITH TIME ZONE
When the milestone was archived.
ConstraintsPRIMARY KEY (id)
Example

Milestones per project

SELECT project, name, status, target_date
FROM linear.main.project_milestones
ORDER BY project, target_date;
Link
project_updates 1 example13 cols

Project status updates with their health (on track / at risk / off track)

Columns
idnot null VARCHAR
Project update UUID.
project VARCHAR
Project name. Pushed down.
project_id VARCHAR
Project UUID. Pushed down.
health VARCHAR
onTrack, atRisk or offTrack.
body VARCHAR
Update text as Markdown.
user_login VARCHAR
Author's display name. Pushed down.
comment_count INTEGER
Number of comments on the update.
is_stale BOOLEAN
Whether Linear considers the update stale.
html_url VARCHAR
Link to the update.
created_at TIMESTAMP WITH TIME ZONE
When the update was posted. Pushed down.
updated_at TIMESTAMP WITH TIME ZONE
When the update last changed.
edited_at TIMESTAMP WITH TIME ZONE
When the body was last edited.
archived_at TIMESTAMP WITH TIME ZONE
When the update was archived.
ConstraintsPRIMARY KEY (id)
Example

Latest reported health per project

SELECT project, arg_max(health, created_at) AS latest_health
FROM linear.main.project_updates
GROUP BY project
ORDER BY project;
Link
projects 1 example22 cols

Linear projects with status, health, lead, dates and progress

Columns
idnot null VARCHAR
Project UUID.
name VARCHAR
Project name. Pushed down.
slug_id VARCHAR
Project slug used in URLs.
description VARCHAR
Short description.
status VARCHAR
Project status name. Pushed down.
status_type VARCHAR
backlog, planned, started, paused, completed or canceled. Pushed down.
health VARCHAR
onTrack, atRisk or offTrack (from the latest update); NULL if never reported. Pushed down.
health_updated_at TIMESTAMP WITH TIME ZONE
When health was last reported.
priority INTEGER
Priority score from 0 to 4 (lower number = more urgent; 0 = none, 1 urgent … 4 low). Pushed down.
progress DOUBLE
Completed fraction of the scope, a ratio from 0 to 1 (completed / total estimate points).
lead VARCHAR
Project lead's display name. Pushed down.
user_login VARCHAR
Creator's display name.
team_keys VARCHAR[]
Keys of the teams working on the project (first 20).
start_date DATE
Planned start date.
target_date DATE
Calendar day the work is due to be finished.
started_at TIMESTAMP WITH TIME ZONE
When work started.
completed_at TIMESTAMP WITH TIME ZONE
When the project was completed.
canceled_at TIMESTAMP WITH TIME ZONE
When the project was canceled.
html_url VARCHAR
Link to the project in Linear.
created_at TIMESTAMP WITH TIME ZONE
When the project was created.
updated_at TIMESTAMP WITH TIME ZONE
When the project last changed.
archived_at TIMESTAMP WITH TIME ZONE
When the project was archived.
ConstraintsPRIMARY KEY (id)
Example

Projects in trouble

SELECT name, health, lead, target_date
FROM linear.main.projects
WHERE health IN ('atRisk', 'offTrack')
ORDER BY target_date;
Link
roadmaps 1 example10 cols

Linear roadmaps (the older project grouping that initiatives replace)

Columns
idnot null VARCHAR
Roadmap UUID.
name VARCHAR
Roadmap name.
description VARCHAR
Free-text summary written by the owner.
owner VARCHAR
Owner's display name.
user_login VARCHAR
Creator's display name.
project_names VARCHAR[]
Names of the roadmap's projects (first 50).
html_url VARCHAR
Link to the roadmap.
created_at TIMESTAMP WITH TIME ZONE
When it was created.
updated_at TIMESTAMP WITH TIME ZONE
When it last changed.
archived_at TIMESTAMP WITH TIME ZONE
When it was archived.
ConstraintsPRIMARY KEY (id)
Example

Roadmaps and their projects

SELECT name, project_names FROM linear.main.roadmaps ORDER BY name;
Link
teams 1 example17 cols

Linear teams: their keys, names, privacy and cycle / triage settings

Columns
idnot null VARCHAR
Team UUID.
key VARCHAR
Team key used in issue identifiers. Pushed down.
name VARCHAR
Team name. Pushed down.
display_name VARCHAR
Team display name (includes the parent for sub-teams).
description VARCHAR
Team description.
private BOOLEAN
Whether the team is private. Pushed down.
parent_key VARCHAR
Key of the parent team for sub-teams.
color VARCHAR
Team color (hex).
icon VARCHAR
Team icon name.
timezone VARCHAR
Team timezone (cycles start in it).
cycles_enabled BOOLEAN
Whether the team uses cycles.
cycle_duration INTEGER
Cycle length in weeks.
triage_enabled BOOLEAN
Whether triage is enabled.
issue_estimation_type VARCHAR
Estimate scale: notUsed, exponential, fibonacci, linear or tShirt.
created_at TIMESTAMP WITH TIME ZONE
When the team was created. Pushed down.
updated_at TIMESTAMP WITH TIME ZONE
When the team last changed. Pushed down.
archived_at TIMESTAMP WITH TIME ZONE
When the team was archived.
ConstraintsPRIMARY KEY (id)
Example

Teams and whether they use cycles

SELECT key, name, cycles_enabled FROM linear.main.teams ORDER BY key;
Link
users 1 example17 cols

Linear users (members, guests, disabled users and app users)

Columns
idnot null VARCHAR
User UUID.
display_name VARCHAR
Display name (unique nickname). Pushed down.
user_login VARCHAR
Alias of display_name (tracker-aligned login). Pushed down.
name VARCHAR
Full name. Pushed down.
email VARCHAR
Email address; NULL when the key's scope may not read it. Pushed down.
active BOOLEAN
False for disabled (suspended) users. Pushed down.
admin BOOLEAN
Workspace admin. Pushed down.
guest BOOLEAN
Guest user (limited to some teams).
app BOOLEAN
An app / agent user rather than a person. Pushed down.
is_me BOOLEAN
The user who owns the API key. Pushed down.
title VARCHAR
Job title.
timezone VARCHAR
User timezone.
html_url VARCHAR
Link to the user's profile in Linear.
last_seen TIMESTAMP WITH TIME ZONE
When the user was last online.
created_at TIMESTAMP WITH TIME ZONE
When the user joined.
updated_at TIMESTAMP WITH TIME ZONE
When the user last changed.
archived_at TIMESTAMP WITH TIME ZONE
When the user was archived.
ConstraintsPRIMARY KEY (id)
Example

Active users

SELECT display_name, name, admin
FROM linear.main.users
WHERE active
ORDER BY display_name;
Link
workflow_states 1 example11 cols

Workflow states (issue statuses) of every Linear team

Columns
idnot null VARCHAR
Workflow state UUID.
name VARCHAR
State name. Pushed down.
type VARCHAR
triage, backlog, unstarted, started, completed or canceled. Pushed down.
team_key VARCHAR
Key of the team the state belongs to. Pushed down.
team_id VARCHAR
UUID of the team. Pushed down.
position DOUBLE
Sort order (ordinal rank) of the column on the team's board; lower is further left.
color VARCHAR
State color (hex).
description VARCHAR
State description.
created_at TIMESTAMP WITH TIME ZONE
When the state was created.
updated_at TIMESTAMP WITH TIME ZONE
When the state last changed.
archived_at TIMESTAMP WITH TIME ZONE
When the state was archived.
ConstraintsPRIMARY KEY (id)
Example

The ENG board's columns in order

SELECT name, type
FROM linear.main.workflow_states
WHERE team_key = 'ENG'
ORDER BY position;
Link
Table functions
attachments (issue_key := VARCHAR, page_size := BIGINT) 2 examples

Attachments (links to pull requests, designs, error reports…) on Linear issues

Named arguments
issue_key := VARCHAR
Only this issue's attachments, by identifier such as ENG-1 (or its internal id); NULL lists all attachments. · default null
page_size := BIGINT
Rows requested per GraphQL page (1–250; lowered automatically to stay inside Linear's complexity budget). · default 100
Returns columns
id VARCHAR
Attachment UUID.
issue_id VARCHAR
UUID of the issue.
issue_key VARCHAR
Identifier of the issue. = / IN reads only those issues.
title VARCHAR
Attachment title.
subtitle VARCHAR
Attachment subtitle.
url VARCHAR
The linked URL.
source_type VARCHAR
Integration that created it, e.g. github, figma, sentry.
user_login VARCHAR
Creator's display name.
metadata JSON
Integration-specific metadata (e.g. pull request state) as JSON.
created_at TIMESTAMP WITH TIME ZONE
When it was attached.
updated_at TIMESTAMP WITH TIME ZONE
When it last changed.
Examples (2)

Links attached to one issue

SELECT title, url, source_type
FROM linear.main.attachments(issue_key := 'ENG-1')
ORDER BY title;

Attachments by integration

SELECT source_type, count(*)
FROM linear.main.attachments()
GROUP BY source_type
ORDER BY source_type;
Link
comments (include_archived := BOOLEAN, issue_key := VARCHAR, page_size := BIGINT) 2 examples

Comments on Linear issues (Markdown bodies), with filters pushed into CommentFilter

Named arguments
include_archived := BOOLEAN
Include archived objects (Linear's includeArchived); default false, as in the Linear app. · default false
issue_key := VARCHAR
Only comments on this issue, by identifier such as ENG-1 (or its internal id); NULL reads all comments. · default null
page_size := BIGINT
Rows requested per GraphQL page (1–250; lowered automatically to stay inside Linear's complexity budget). · default 100
Returns columns
id VARCHAR
Comment UUID.
issue_id VARCHAR
UUID of the issue commented on (NULL for project-update comments).
issue_key VARCHAR
Identifier of the issue commented on.
team_key VARCHAR
Team key of the issue.
body VARCHAR
Comment body as Markdown.
user_login VARCHAR
Author's display name.
user_id VARCHAR
Author's user UUID.
user_name VARCHAR
Author's full name.
parent_id VARCHAR
Parent comment UUID for threaded replies.
project_update_id VARCHAR
Project update UUID when the comment is on a project update.
html_url VARCHAR
Link to the comment in the Linear app.
created_at TIMESTAMP WITH TIME ZONE
When the comment was posted.
updated_at TIMESTAMP WITH TIME ZONE
When the comment last changed.
edited_at TIMESTAMP WITH TIME ZONE
When the body was last edited.
resolved_at TIMESTAMP WITH TIME ZONE
When the thread was resolved.
archived_at TIMESTAMP WITH TIME ZONE
When the comment was archived.
Examples (2)

The discussion on one issue

SELECT created_at, user_login, body
FROM linear.main.comments(issue_key := 'ENG-1')
ORDER BY created_at;

Most active commenters since October

SELECT user_login, count(*) AS comments
FROM linear.main.comments()
WHERE created_at >= TIMESTAMPTZ '2026-10-01'
GROUP BY user_login
ORDER BY comments DESC;
Link
issue_history (include_archived := BOOLEAN, issue_key := VARCHAR, page_size := BIGINT) 2 examples

Change history of Linear issues: state transitions, reassignments, label and estimate changes

Named arguments
include_archived := BOOLEAN
Include archived issues and history entries. · default false
issue_key := VARCHAR
Only this issue, by identifier such as ENG-123 (or its internal id); NULL reads every issue. · default null
page_size := BIGINT
Rows requested per GraphQL page (1–250; lowered automatically to stay inside Linear's complexity budget). · default 50
Returns columns
id VARCHAR
History entry UUID.
issue_id VARCHAR
UUID of the issue that changed.
issue_key VARCHAR
Identifier of the issue that changed, e.g. ENG-123. = / IN reads only those issues.
team_key VARCHAR
Team key of the issue.
created_at TIMESTAMP WITH TIME ZONE
When the change happened.
actor VARCHAR
Display name of the user who made the change (NULL for automations and integrations).
actor_id VARCHAR
UUID of the user who made the change.
is_state_change BOOLEAN
True when this entry moved the issue to a workflow state (filter on it for state transitions).
from_state VARCHAR
Workflow state name before the change (NULL when the issue was created).
from_state_type VARCHAR
Workflow state type before the change.
to_state VARCHAR
Workflow state name after the change.
to_state_type VARCHAR
Workflow state type after the change (e.g. started, completed).
from_state_id VARCHAR
Workflow state UUID before the change.
to_state_id VARCHAR
Workflow state UUID after the change.
from_assignee VARCHAR
Assignee display name before the change.
to_assignee VARCHAR
Assignee display name after the change.
from_priority INTEGER
Priority before the change.
to_priority INTEGER
Priority after the change.
from_estimate DOUBLE
Estimate before the change.
to_estimate DOUBLE
Estimate after the change.
from_title VARCHAR
Title before a rename.
to_title VARCHAR
Title after a rename.
from_cycle_id VARCHAR
Cycle UUID before the change.
to_cycle_id VARCHAR
Cycle UUID after the change.
from_project_id VARCHAR
Project UUID before the change.
to_project_id VARCHAR
Project UUID after the change.
from_parent_id VARCHAR
Parent issue UUID before the change.
to_parent_id VARCHAR
Parent issue UUID after the change.
added_labels VARCHAR[]
Names of labels added by this change.
removed_labels VARCHAR[]
Names of labels removed by this change.
archived BOOLEAN
True when this change archived the issue.
auto_closed BOOLEAN
True when Linear closed the issue automatically.
auto_archived BOOLEAN
True when Linear archived the issue automatically.
updated_description BOOLEAN
True when the description was edited.
Examples (2)

State transitions of one issue

SELECT created_at, actor, from_state, to_state
FROM linear.main.issue_history(issue_key := 'ENG-1')
WHERE is_state_change
ORDER BY created_at;

Cycle time (first started → completed) per ENG issue

SELECT issue_key,
  (epoch(max(created_at) FILTER (WHERE to_state_type = 'completed')) - epoch(min(created_at) FILTER (WHERE to_state_type = 'started'))) / 3600 AS cycle_time_hours
FROM linear.main.issue_history()
WHERE team_key = 'ENG'
GROUP BY issue_key
ORDER BY issue_key;
Link
issue_relations (issue_key := VARCHAR, page_size := BIGINT) 1 example

Relations between Linear issues: blocks, duplicate, related, similar

Named arguments
issue_key := VARCHAR
Only relations from this issue, by identifier such as ENG-1 (or its internal id); NULL lists all relations. · default null
page_size := BIGINT
Rows requested per GraphQL page (1–250; lowered automatically to stay inside Linear's complexity budget). · default 100
Returns columns
id VARCHAR
Relation UUID.
type VARCHAR
blocks, duplicate, related or similar.
issue_id VARCHAR
UUID of the source issue.
issue_key VARCHAR
Identifier of the source issue (the blocker, the duplicate).
related_issue_id VARCHAR
UUID of the target issue.
related_issue_key VARCHAR
Identifier of the target issue (the blocked issue, the original).
created_at TIMESTAMP WITH TIME ZONE
When the relation was created.
updated_at TIMESTAMP WITH TIME ZONE
When the relation last changed.
Example

What blocks what

SELECT issue_key, related_issue_key
FROM linear.main.issue_relations()
WHERE type = 'blocks'
ORDER BY issue_key;
Link
issues (filter := VARCHAR, include_archived := BOOLEAN, page_size := BIGINT) 2 examples

Linear issues, with SQL filters pushed into Linear's IssueFilter and GraphQL projection

Named arguments
filter := VARCHAR
Optional raw Linear IssueFilter as JSON, ANDed with the pushed WHERE filters. · default null
include_archived := BOOLEAN
Include archived objects (Linear's includeArchived); default false, as in the Linear app. · default false
page_size := BIGINT
Rows requested per GraphQL page (1–250; lowered automatically to stay inside Linear's complexity budget). · default 100
Returns columns
id VARCHAR
Linear issue UUID.
key VARCHAR
Issue identifier, e.g. ENG-123.
number BIGINT
Issue number within its team (the 123 of ENG-123).
repo VARCHAR
Team key (tracker-aligned alias of team_key).
team_key VARCHAR
Team key, e.g. ENG.
team_id VARCHAR
Team UUID.
title VARCHAR
Issue title.
state VARCHAR
'open' or 'closed' (GitHub vocabulary): closed = a completed or canceled workflow state.
status VARCHAR
Workflow state name, e.g. 'In Progress'.
status_type VARCHAR
triage, backlog, unstarted, started, completed or canceled.
state_id VARCHAR
Workflow state UUID.
priority INTEGER
Priority: 0 none, 1 urgent, 2 high, 3 medium, 4 low.
priority_label VARCHAR
Priority name: No priority, Urgent, High, Medium or Low.
estimate DOUBLE
Estimate in the team's points scale; NULL when not estimated.
assignee VARCHAR
Assignee's display name (unique nickname).
assignee_id VARCHAR
Assignee's user UUID.
assignee_name VARCHAR
Assignee's full name.
assignees VARCHAR[]
Assignee display names (at most one in Linear); tracker-aligned.
user_login VARCHAR
Creator's display name (tracker-aligned: the author).
creator_id VARCHAR
Creator's user UUID.
labels VARCHAR[]
Label names (first 50).
label_ids VARCHAR[]
Label UUIDs.
project VARCHAR
Project name.
project_id VARCHAR
Project UUID.
project_milestone VARCHAR
Project milestone name.
milestone VARCHAR
Alias of project_milestone (tracker-aligned).
cycle_number INTEGER
Number of the cycle (sprint) the issue is in.
cycle_id VARCHAR
Cycle UUID.
parent_key VARCHAR
Identifier of the parent issue for sub-issues.
parent_id VARCHAR
UUID of the parent issue.
due_date DATE
Due date, if set.
body VARCHAR
Issue description as Markdown.
html_url VARCHAR
Link to the issue in the Linear app.
branch_name VARCHAR
Suggested git branch name.
created_at TIMESTAMP WITH TIME ZONE
When the issue was created.
updated_at TIMESTAMP WITH TIME ZONE
When the issue last changed.
started_at TIMESTAMP WITH TIME ZONE
When the issue entered a started state.
completed_at TIMESTAMP WITH TIME ZONE
When the issue was completed.
canceled_at TIMESTAMP WITH TIME ZONE
When the issue was canceled.
closed_at TIMESTAMP WITH TIME ZONE
completed_at, else canceled_at; NULL while open.
triaged_at TIMESTAMP WITH TIME ZONE
When the issue left triage.
archived_at TIMESTAMP WITH TIME ZONE
When archived (needs include_archived := true).
Examples (2)

Open ENG issues by priority (both predicates become one IssueFilter)

SELECT key, title, status, assignee
FROM linear.main.issues()
WHERE team_key = 'ENG' AND state = 'open'
ORDER BY priority, key;

Issues created since October by workflow state

SELECT status, count(*) AS issues
FROM linear.main.issues()
WHERE created_at >= TIMESTAMPTZ '2026-10-01'
GROUP BY status
ORDER BY issues DESC;
Link

Credentials

The secret type linear declares, as reported by the worker itself.

linear

How to get these credentials

A Linear personal API key or OAuth 2.0 access token (plus an optional GraphQL endpoint)

secret.sql
CREATE SECRET linear (
    TYPE linear,
    api_key      '<LINEAR_API_KEY>',  -- secret
    access_token '<ACCESS_TOKEN>',  -- secret
    base_url     '<base_url>'
);
Key Type Required Description
api_key secret VARCHAR — Personal API key (lin_api_…, Settings > Security & access). Sent as `Authorization: <key>`.
access_token secret VARCHAR — OAuth 2.0 access token (read scope is enough). Sent as `Authorization: Bearer <token>`.
base_url VARCHAR — GraphQL endpoint; default https://api.linear.app/graphql (http:// is accepted only for 127.0.0.1/localhost).

The worker doesn't mark which keys are required.

Create the secret in the same session, after attaching linear — the worker registers its secret types at ATTACH. Keys marked secret are masked in duckdb_secrets(); angle-bracket values are placeholders. Read credentials from your environment or secret store in your application and pass them through your SQL client’s parameter bindings. Keep real values out of saved SQL and history. Native DuckDB and Haybarn do not provide a SQL getenv() function.

Try these queries

issues_columns — The issues() result columns (binds only; create a linear secret and drop LIMIT 0 for rows)

SELECT key, title, state, status, assignee, created_at
FROM linear.main.issues()
LIMIT 0;

Uses issues

issue_history_columns — The issue_history() result columns (binds only; create a linear secret and drop LIMIT 0 for rows)

SELECT issue_key, created_at, from_state, to_state, actor
FROM linear.main.issue_history()
LIMIT 0;

Uses issue_history

The discussion on one issue

SELECT created_at, user_login, body
FROM linear.main.comments(issue_key := 'ENG-1')
ORDER BY created_at

Uses comments

Links attached to one issue

SELECT title, url, source_type
FROM linear.main.attachments(issue_key := 'ENG-1')
ORDER BY title

Uses attachments

What blocks what

SELECT issue_key, related_issue_key
FROM linear.main.issue_relations()
WHERE type = 'blocks'
ORDER BY issue_key

Uses issue_relations

Teams and whether they use cycles

SELECT key, name, cycles_enabled FROM linear.main.teams ORDER BY key

Uses teams

17 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • List the keys and titles of open issues in the ENG team.
  • How many Linear issues have Urgent priority?
  • How many ENG issues are in each workflow state?
  • Which issues are assigned to ada and not closed yet?
  • Which issues carry the Bug label?
  • How long did ENG-1 spend between entering In Progress and reaching Done?

Linear is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.