← Use cases

USE CASES

The draft that waits for your tap

Persona
Sam, DevRel at a developer-tools company.
Scene
A thread about Sam's product takes off on Hacker News. By the time Sam notices, the conversation has moved on.

The old loop

Search HN by hand. Draft a post. Paste it into three tools.

The new loop

Three small processes on the Relay:

  1. Keyword pulse counts mentions every hour. When the count shifts, a model writes a one-line read on why, and publishes it to team.findings.
  2. A drafting process, written by Sam’s AI, wakes on that signal and publishes a draft to content.draft.
  3. The outbound courier wakes on content.draft and hands it to Sam’s n8n webhook, which posts it. It’s leashed, so every draft waits for Sam’s tap.

The drafting process isn’t a shipped blueprint: your AI writes this one.

The one capability that matters

Composition with a leash on the last step. Watching and thinking run free; sending waits.

The synth

blueprints/keyword-pulse.yaml
# Multi-source synthesis. Reads two HN feeds (newest + front page),
# counts keyword mentions across both, and when the pulse changes, reasons
# about what's going on and publishes an insight signal for other processes.
blueprint:
  id: keyword-pulse
  title: Keyword pulse analyst
  description: >-
    Watches how much a keyword is being talked about across Hacker News, and
    when the volume shifts, writes a one-line read on what's driving it —
    published as a signal other processes can act on. Edit the query in both URLs.
config:
  synth:
    name: Keyword pulse
    goal: Tell the team when chatter about my keyword shifts, and why.
    schedule_seconds: 3600
  sources:
    - id: newest
      primitive: rest_api
      config:
        url: "https://hn.algolia.com/api/v1/search_by_date?query=claude&tags=story"
        items_path: hits
        max_pages: 1
    - id: front
      primitive: rest_api
      config:
        url: "https://hn.algolia.com/api/v1/search?query=claude&tags=front_page"
        items_path: hits
        max_pages: 1
  transforms:
    - id: newest_count
      primitive: count_matches
      config:
        text: $sources.newest.items
        field: title
        pattern: claude
    - id: front_count
      primitive: count_matches
      config:
        text: $sources.front.items
        field: title
        pattern: claude
  fast_path:
    primitive: fast_path_diff
    inputs:
      current: $transforms.newest_count.count
      previous: $state.last_count
  reasoning:
    primitive: llm_reason
    triggered_by: fast_path
    model_tier: economy
    budget_usd_per_day: 0.02
    input: >-
      New-story mentions: {$transforms.newest_count.count}. Front-page
      mentions: {$transforms.front_count.count}. Recent titles:
      {$transforms.newest_count.matches}
    output_schema:
      insight: string
      direction: string
      confidence: float
  actions:
    - if: "$reasoning.confidence > 0.5"
      primitive: publish_signal
      config:
        topic: team.findings
        payload:
          insight: $reasoning.insight
          direction: $reasoning.direction
          mentions: $transforms.newest_count.count
    - always: true
      primitive: write_state
      config:
        last_count: $transforms.newest_count.count
        checked_at: $tick.started_at
blueprints/n8n-courier.yaml
# The safe path to the outside world. Listens for drafts on the
# Relay and POSTs them to YOUR automation layer (an n8n / Zapier / Make
# webhook), which does the platform work with its own credentials. Deploys in
# approval mode — every outbound payload waits for your one-tap approval until
# you flip it to autonomous. See PRIMITIVES.md for the n8n starter workflow.
blueprint:
  id: n8n-courier
  title: Outbound courier (via your n8n)
  description: >-
    Safely moves drafts out to the world. Listens for `content.draft` signals
    from teammates and sends each one to your n8n/Zapier webhook, which posts
    it wherever you've wired (X, LinkedIn, Slack, …). Starts in approval mode —
    nothing leaves without your tap.
config:
  synth:
    name: Courier
    goal: Send approved drafts to my automation webhook for publishing.
    schedule_seconds: null
    trigger:
      type: signal
      topic: content.draft
  approval_mode: required
  requires_credentials:
    - WORKFLOW_URL
    - WORKFLOW_TOKEN
  sources:
    - id: drafts
      primitive: signal_subscribe
      config:
        topic: content.draft
  fast_path:
    primitive: fast_path_diff
    inputs:
      current: $sources.drafts.ts
      previous: $state.last_sent_ts
  actions:
    - if: $fast_path.triggered
      primitive: post_to_api
      config:
        url: $secrets.WORKFLOW_URL
        headers:
          Authorization: "Bearer {$secrets.WORKFLOW_TOKEN}"
        body:
          text: $sources.drafts.payload.text
    - always: true
      primitive: write_state
      config:
        last_sent_ts: $sources.drafts.ts

What it costs

Cost: the pulse's model budget is capped at two cents a day; the courier makes no model calls.

Try it