> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invokehq.run/llms.txt
> Use this file to discover all available pages before exploring further.

# linear-issues

> Use Invoke idempotency keys to ensure your agent never creates two Linear issues for the same work, even when the HTTP response is lost on retry.

When an agent creates a Linear issue and the HTTP response is lost, retrying creates a duplicate. Invoke prevents this by checking whether the issue already exists before allowing a retry.

## The problem

Your agent calls `linear.create_issue` and the response is dropped. The agent retries. Without idempotency enforcement, two identical issues land in the same team backlog.

## Solution: write-once-checkable with idempotency key

Classify `linear.create_issue` as `write-once-checkable` and always pass an `idempotencyKey`. On retry, Invoke checks whether the issue already exists in the team's backlog before allowing a second creation:

```typescript theme={null}
const result = await invoke.call({
  tool: "linear.create_issue",
  params: {
    team_id: "team_eng",
    title: "Fix checkout timeout bug",
    priority: 2
  },
  agentId: "eng-agent",
  idempotencyKey: "linear:issue:checkout-timeout:team_eng"
})

if (result.status === "reconciled") {
  // issue already existed — no duplicate created
}
```

## How Invoke checks for duplicates

When an unknown outcome occurs, Invoke calls `POST /outcomes/reconcile` with the current state of the Linear team's backlog. If an issue with a matching title already exists, the outcome is `already_succeeded` and the retry is blocked.

```bash theme={null}
curl -X POST https://api.invokehq.run/outcomes/reconcile \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "intent": "create_issue",
      "tool": "linear.create_issue",
      "params": { "title": "Fix checkout timeout bug", "team_id": "team_eng" }
    },
    "outcome": "UNKNOWN",
    "current_state": { "issue_exists": true, "title": "Fix checkout timeout bug" },
    "conditions": { "issue_exists": true }
  }'
```

## Next steps

* [Reconciliation](/concepts/reconciliation) — full reconciliation documentation
* [Tool Safety Classes](/concepts/tool-safety-classes) — how write-once-checkable works
* [POST /outcomes/reconcile](/api/outcomes-reconcile) — full API reference
