# Linear

Create, query, comment on, list, and update Linear issues and project data from workflows.

## When to Use

- Creating Linear issues from workflows
- Listing/querying issues, teams, users, or projects for downstream automation
- Hydrating an issue by UUID or exact identifier
- Reading or creating issue comments
- Updating issue title or state from workflow outputs
- Triggering Linear actions from internal process automations

The first-class Linear node covers the operations listed below, not the entire Linear API. For an advanced query or mutation that is not represented here, select the same Linear connection in the generic `GraphQL` node and call `https://api.linear.app/graphql`. `HTTP Request` can also use the Linear connection when direct HTTP response handling is needed. Keep authentication in the connection rather than workflow headers.

## Configuration

**connection** - Linear connection to use
- Select a Linear API key or OAuth connection from Settings → Connections
- Required

**operation** - Action to perform
- `list_issues`: Fetch issues with optional filters, sort controls, and limit
- `query_issues`: Fetch issues with exact GraphQL filters, sort controls, limit, and cursor pagination
- `get_issue`: Fetch one hydrated issue by issue UUID or exact issue identifier
- `create_issue`: Create a new issue in a team by team UUID
- `update_issue`: Update an existing issue by issue UUID or identifier
- `delete_issue`: Delete an issue by issue UUID or identifier
- `archive_issue`: Archive an issue by issue UUID or identifier
- `list_projects`: Fetch projects
- `query_projects`: Fetch projects with exact GraphQL filters
- `get_project`: Fetch one project by project UUID
- `create_project`: Create a project from a raw `ProjectCreateInput` object
- `update_project`: Update a project from a raw `ProjectUpdateInput` object
- `delete_project`: Delete a project by ID
- `archive_project`: Archive a project by ID
- `list_teams`: Fetch teams
- `get_team`: Fetch one team by team UUID
- `list_users`: Fetch users
- `get_user`: Fetch one user by user UUID
- `query_users`: Fetch users with exact GraphQL filters
- `list_issue_comments`: Fetch comments for one issue by UUID or identifier
- `comment_issue`: Create a comment on one issue by UUID or identifier
- `update_comment`: Update a comment by ID
- `delete_comment`: Delete a comment by ID

### GraphQL filter and pagination semantics

- Filters map directly to Linear GraphQL filter objects using exact `eq`, `gt`, or `lt` operators.
- Name, email, key, and identifier filters are exact. There is no fuzzy search, ranked matching, URL parsing, or name-to-ID resolution.
- Every reference an operation writes is a flat id field (`team_id`, `project_id`, `assignee_id`, `state_id`, `issue_id`). Nothing is resolved from a human name, key, or email before a write; obtain ids from the list/query operations.
- `issue_id` accepts a UUID or a Linear identifier such as `CAN-123`. Every other id field must be a UUID.
- List/query operations auto-paginate internally until `limit` items are collected or Linear has no next page.
- `after` is the starting Linear cursor. Returned `pageInfo` comes from the last fetched page.
- `sort_by` maps to Linear's `orderBy`, which is always descending. There is no sort-direction control.

### Operation fields

**list_issues**
- `team_id` - optional team UUID filter (supports `{{ input.* }}` interpolation)
- `state` - optional issue state name filter (supports `{{ input.* }}` interpolation)
- `options` - advanced filter list
  - person filters: `assignee_id`, `assignee_email`, `creator_id`, `creator_email`, `subscriber_id`
  - project/team/state filters: `project_id`, `project_name`, `team_id`, `team_key`, `state_id`, `state_name`
  - label filters: `label_id`, `label_name`
  - date filters: `created_after`, `created_before`, `updated_after`, `updated_before`
  - graph filters: `priority`, `parent_issue_id`, `cycle_id`
  - `value` text block: interpolatable per row
- blank entries are skipped, duplicate keys use the last entry
- ID filters require UUIDs. Blank/null optional filters are omitted. Invalid typed values fail before Linear is called.
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor

**query_issues**
- `options` - exact issue filters with the same keys and validation rules as `list_issues`
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor
- output shape is Linear's `issues` connection with `nodes` and `pageInfo`

**get_issue**
- `issue_id` - required issue UUID or identifier such as `CAN-123` (supports `{{ input.* }}` interpolation)
- no URL parsing or fuzzy identifier matching

**create_issue**
- `team_id` - required team UUID (supports `{{ input.* }}` interpolation)
- `title` - issue title (supports `{{ input.* }}` interpolation)
- `description` - optional issue description (supports `{{ input.* }}` interpolation)
- `attachments` - optional attachment value or array of values (supports interpolation from `input.*` or upstream `output.*`; accepts runtime binary and media-object references)
- `options` - advanced field list
  - `key` picker: `assignee_id`, `labels`, `priority`, `project_id`, `state_id`
  - `value` text block: interpolatable per row
- blank entries are skipped, duplicate keys use the last entry
- ID options and comma-separated `labels` require UUIDs. Blank/null optional values are omitted. Invalid typed values fail before Linear is called.
- returns Linear's mutation payload with a hydrated `issue` object

**update_issue**
- `issue_id` - required issue UUID or identifier such as `CAN-123` (supports `{{ input.* }}` interpolation)
- `title` - optional new title (supports `{{ input.* }}` interpolation)
- `description` - optional new description (supports `{{ input.* }}` interpolation)
- `attachments` - optional attachment value or array of values (supports interpolation from `input.*` or upstream `output.*`; accepts runtime binary and media-object references)
- `options` - advanced field list
  - `key` picker: `assignee_id`, `labels`, `priority`, `project_id`, `state_id`
  - `value` text block: interpolatable per row
- blank entries are skipped, duplicate keys use the last entry
- ID options and comma-separated `labels` require UUIDs. Blank/null optional values are omitted. Invalid typed values fail before Linear is called.
- returns Linear's mutation payload with a hydrated `issue` object

**delete_issue**
- `issue_id` - required issue UUID or identifier such as `CAN-123` (supports `{{ input.* }}` interpolation)
- returns Linear's mutation payload

**archive_issue**
- `issue_id` - required issue UUID or identifier such as `CAN-123` (supports `{{ input.* }}` interpolation)
- returns Linear's mutation payload

**list_projects**
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor

**query_projects**
- `options` - exact project filters: `id`, `name`, `slug_id`, `team_id`, `status_name`
- ID filters require UUIDs. Name, slug, and status filters use exact GraphQL equality.
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor

**get_project**
- `project_id` - required project UUID (supports `{{ input.* }}` interpolation)

**create_project**
- `input` - required non-empty Linear `ProjectCreateInput` object, sent as-is
- returns Linear's mutation payload with a hydrated `project` object

**update_project**
- `project_id` - required project UUID (supports `{{ input.* }}` interpolation)
- `input` - required non-empty Linear `ProjectUpdateInput` object, sent as-is
- returns Linear's mutation payload with a hydrated `project` object

**delete_project**
- `project_id` - required project UUID (supports `{{ input.* }}` interpolation)
- returns Linear's mutation payload

**archive_project**
- `project_id` - required project UUID (supports `{{ input.* }}` interpolation)
- returns Linear's mutation payload

**list_teams**
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor

**get_team**
- `team_id` - required team UUID (supports `{{ input.* }}` interpolation)

**list_users**
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor

**get_user**
- `user_id` - required user UUID (supports `{{ input.* }}` interpolation)

**query_users**
- `options` - exact user filters: `id`, `email`, `name`, `display_name`, `active`
- `id` requires a UUID. `active` requires `true` or `false`.
- `sort_by` - `created_at` or `updated_at`
- `limit` - total max items to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor

**list_issue_comments**
- `issue_id` - required issue UUID or identifier such as `CAN-123` (supports `{{ input.* }}` interpolation)
- `limit` - total max comments to return across internally fetched pages (default 50)
- `after` - optional starting Linear cursor
- output shape is `{ issue: { id, identifier, comments: { nodes, pageInfo } } }`

**comment_issue**
- `issue_id` - required issue UUID or identifier such as `CAN-123` (supports `{{ input.* }}` interpolation)
- `body` - required non-blank comment body (supports `{{ input.* }}` interpolation)
- `attachments` - optional attachment value or array of values (supports interpolation from `input.*` or upstream `output.*`; accepts runtime binary and media-object references)
- returns Linear's mutation payload with a hydrated `comment` object

**update_comment**
- `comment_id` - required comment UUID (supports `{{ input.* }}` interpolation)
- `body` - required non-blank comment body (supports `{{ input.* }}` interpolation)
- `attachments` - optional attachment value or array of values (supports interpolation from `input.*` or upstream `output.*`; accepts runtime binary and media-object references)
- returns Linear's mutation payload with a hydrated `comment` object

**delete_comment**
- `comment_id` - required comment UUID (supports `{{ input.* }}` interpolation)
- returns Linear's mutation payload

### Attachment semantics

- `attachments` is a `TextBlock`: bind it to one attachment or an array using forms such as `{{ input.attachment }}`, `{{ input.attachments }}`, or `{{ output.file }}`. There is no implicit attachment socket or special input path.
- Values may be runtime `NodeData::Binary`, an attachment wrapper (`binary`, optional `filename`/`content_type`), or a `object_id` reference. A flat array may combine those forms. Runtime binary data is uploaded to Linear; media-object references are resolved in the current workspace and uploaded before the mutation.
- Uploaded attachments are represented as Markdown links in the issue description or comment body. Existing Markdown in `description` and `body` is preserved; attachments do not replace or rewrite that text.
- Uploads are performed before the issue/comment mutation. If a later upload fails, earlier uploads may remain in Linear; attachment handling is not transactional and can therefore leave partial uploads.

**retry** - Whether each Linear request is sent again after a failure that passes: a rate limit, a busy server, a dropped connection. Off by default; see [Retries](http_get.md#retries). Queries (the `list_*`, `query_*` and `get_*` operations) are reads, sent again freely even though Linear's API takes them as `POST`. Mutations and the attachment upload negotiation are writes, sent again only when Linear refused them before acting: the connection never opened, or Linear answered 425 or 429. An attachment's bytes go to the upload URL as a `PUT`, sent again freely.

## Inputs

**input** - Any input
- Used to trigger the node
- Input data can be referenced by interpolation in operation fields

## Outputs

**output** - Linear GraphQL response data
- Returns the `data` object from Linear
- Returns an array/object shape depending on the selected operation
- Issue list/query/create/update/get operations return hydrated issue fields including timestamps, creator/assignee/team/state, labels, project, priority, URL, and description
- `list_users` and `query_users` return user nodes with profile/status metadata
- `list_projects` and `query_projects` return project nodes with status, lead, team, and label metadata
- List/query connections include merged `nodes` and `pageInfo { hasNextPage hasPreviousPage startCursor endCursor }` from the last fetched page

## Examples

Create an issue from a workflow item:

```json
{
  "connection": "Linear",
  "operation": {
    "op": "create_issue",
    "team_id": { "content": "{{ input.team_id }}" },
    "title": { "content": "Follow up on {{ input.incident_id }}" },
    "description": { "content": "{{ input.summary }}" },
    "options": [
      { "key": "assignee_id", "value": { "content": "{{ input.assignee_id }}" } }
    ]
  }
}
```

List latest issues by update time:

```json
{
  "connection": "Linear",
  "operation": {
    "op": "list_issues",
    "sort_by": "updated_at",
    "limit": 25
  }
}
```

List issues assigned to a person under a project:

```json
{
  "connection": "Linear",
  "operation": {
    "op": "list_issues",
    "options": [
      { "key": "assignee_id", "value": { "content": "{{ input.user_id }}" } },
      { "key": "project_id", "value": { "content": "{{ input.project_id }}" } }
    ],
    "sort_by": "updated_at",
    "limit": 25
  }
}
```

Query issues with exact filters and a cursor:

```json
{
  "connection": "Linear",
  "operation": {
    "op": "query_issues",
    "options": [
      { "key": "assignee_email", "value": { "content": "{{ input.email }}" } },
      { "key": "team_key", "value": { "content": "ENG" } },
      { "key": "priority", "value": { "content": "2" } }
    ],
    "after": { "content": "{{ input.cursor }}" },
    "limit": 25
  }
}
```

Comment on an issue:

```json
{
  "connection": "Linear",
  "operation": {
    "op": "comment_issue",
    "issue_id": { "content": "{{ input.issue_id }}" },
    "body": { "content": "{{ input.comment }}" }
  }
}
```

List teams before routing work:

```json
{
  "connection": "Linear",
  "operation": {
    "op": "list_teams"
  }
}
```

## Tips

- Use a Linear API key or OAuth connection.
- The node requires a selected connection before it can run.
- The API key is sent raw in `Authorization`; do not prefix it with `Bearer`.
- Dynamic text fields are `TextBlock` values and support MiniJinja templates like `{{ input.field }}`.
- If Linear returns a GraphQL error, the node surfaces the GraphQL error payload directly.
