manifest: qloops.loop/v1

# Process multiple feed items consistently and collect the results without repeating the same manual steps.
# OpenRouter example: configure the model explicitly. CLI acceptance uses the caller interface.

id: feed-fanout
name: "Feed fan-out — a lane per entry"
version: 1.1.0
description: >
  Reads a feed and handles each entry separately: its own model call, its own
  outgoing message. Truncation is reported, never silent.
owner: oleg
enabled: true

triggers:
  - kind: manual

settings:
  budgetUsd: 0.15

steps:
  - id: ff-fetch
    kind: fetch
    config:
      name: "Fetch feed"
      url: "{{env.QLOOP_SOURCE_URL}}"
      format: rss
      limit: "20"
      timeoutSec: "30"

  - id: ff-lane
    kind: fan-out
    config:
      name: "Per entry"
      over: "{{steps.Fetch feed.output.entries}}"
      maxItems: "5"
    then:
      - id: ff-take
        kind: llm-call
        config:
          name: "Take on this one"
          maxTokens: "200"
          instructions: |
            One item from a feed:
              title: {{item.title}}
              link:  {{item.link}}

            Write ONE sentence: what it is, and who would care. No preamble.

      - id: ff-send
        kind: api-request
        config:
          name: "Send this one"
          method: POST
          url: "{{env.QLOOP_WEBHOOK_URL}}"
          expect: "2xx"
          timeoutSec: "30"
          body: '{"i":"{{index}}","title":"{{item.title}}","link":"{{item.link}}","take":"{{steps.Take on this one.output.text}}"}'
