Skip to main content
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:
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.
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