Skip to content

OBJ-18: Cursor Automations Bridge — WorkGraph ↔ Cursor Event-Driven Pipeline #28

@G9Pedro

Description

@G9Pedro

Summary

Build a bidirectional bridge between WorkGraph threads and Cursor Automations, enabling:

  • WorkGraph → Cursor: Thread triggers dispatch Cursor cloud agents via webhook
  • Cursor → WorkGraph: Agent results (PRs, evidence) flow back into WorkGraph as evidence on the originating thread

Context

Cursor launched Automations (March 5, 2026) with:

  • Event triggers: Linear issues, GitHub PRs (open/merge/push), Slack, PagerDuty, webhooks, cron
  • Built-in tools: Open PRs, comment on PRs, request reviewers, Slack, MCP
  • Cloud sandboxes per run with memory across runs

This maps directly to WorkGraph's trigger→run→evidence model (OBJ-07). OBJ-11 (Background Dispatch Adapters) is partially solved by Cursor's infrastructure.

What to Build

1. Cursor Automation Adapter (adapter-cursor-automation.ts)

  • New runtime adapter alongside existing adapter-cursor-cloud.ts
  • Dispatches work via Cursor Automations webhook endpoint
  • Receives completion callbacks (PR opened, agent finished)
  • Maps Cursor agent output to WorkGraph evidence primitives

2. WorkGraph Webhook Receiver

  • HTTP endpoint that Cursor Automations can POST to on completion
  • Parses Cursor agent results (branch, PR URL, files changed, lines added)
  • Creates evidence records on the originating WorkGraph thread
  • Updates thread/run status

3. Linear ↔ WorkGraph Sync (Optional)

  • Linear trigger fires → Cursor agent dispatched → PR opened
  • PR merged trigger → Linear issue marked Done → next issue advanced
  • Eliminates manual pipeline orchestration entirely

4. Automation Templates

  • Pre-built automation configs for common patterns:
    • Security review on push to main
    • Bug triage (Linear issue → investigate → fix PR)
    • Test coverage (nightly scan → add tests → PR)
    • Pipeline advance (PR merged → next issue)

Architecture

Linear Issue Created
    ↓ (Cursor Automation trigger)
Cursor Cloud Agent spins up
    ↓ (reads repo, writes code)
Opens PR on GitHub
    ↓ (webhook to WorkGraph)
WorkGraph creates Evidence on Thread
    ↓ (PR merged trigger)
Next Linear issue advanced
    ↓ (cycle repeats)

Dependencies

  • OBJ-07 (Trigger → Run → Evidence Loop) — foundation
  • OBJ-11 (Background Dispatch Adapters) — partially superseded
  • Existing adapter-cursor-cloud.ts — reference implementation

Definition of Done

  • Cursor Automation adapter dispatches agents via webhook
  • Results flow back as WorkGraph evidence
  • At least one automation template works end-to-end
  • All existing tests pass + new adapter tests
  • pnpm test passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions