A Hacker News digest on Telegram, picked by an AI agent
On weekdays a code step fetches the day’s posts on your topic, an agent picks the 3 to 7 worth reading, and the digest arrives on Telegram. Links already sent are not sent again.
- Telegram
- Schedule
- Code step
- blueprint: signal-digest
“Every weekday at 8am, send me a Telegram digest of the posts worth reading about AI agents for SRE on Hacker News and Reddit.”

The run, step by step

What the sentence sets up
| What | Name | What it does |
|---|---|---|
| Workflow | signal_digest | Weekday schedule. Fetches posts in a code step, has digest_writer pick and summarise them, sends the digest, remembers the links it sent. |
| Agent | digest_writer | Ranks the posts and writes the digest. No tools. |
| Code step | tools/fetch_posts.ts | TypeScript run with Deno. May reach only hn.algolia.com and www.reddit.com. |
| Chat | Telegram | Where the digest arrives. |
weekday schedule ─► fetch (code: HN + Reddit, minus links already sent) ─┬─ new posts ─► write (digest_writer) ─► send ─► remember seen
└─ none ─► (test run only) "Nothing new"Apply it with one request
The web chat and distri apply both call POST /v1/blueprints/apply. This request and its response are from a run on Distri’s staging server on 20 Nov 2026; the response is trimmed.
curl -s -X POST "$DISTRI_API/blueprints/apply" \
-H "Authorization: Bearer $TOKEN" -H "X-Workspace-Id: $WORKSPACE" \
-H 'Content-Type: application/json' \
-d '{"sample": "signal-digest", "params": {"topic": "AI agents"}}'
{
"blueprint": "signal-digest",
"status": "pending",
"items": [
{ "kind": "agent", "name": "digest_writer", "action": "created" },
{ "kind": "workflow", "name": "signal_digest", "action": "created" }
],
"pending": [
{ "title": "Choose a default model", "done": true },
{ "title": "Connect Telegram", "done": false }
],
"message": "Set up. 1 step needs you: Connect Telegram."
}
The same with the CLI
distri apply samples/signal-digest --set topic="AI agents for SRE" --set timezone=Europe/Lisbon --wait --test
Parameters
| Param | Default | Meaning |
|---|---|---|
topic | required | What the digest follows, e.g. "AI agents for SRE". |
hour | 8 | Hour of the day, 0 to 23, in your time zone. |
timezone | UTC | IANA name, e.g. Europe/Lisbon. |
Why a code step and an agent
Fetching is deterministic, so it is code: fetch_posts.ts asks Hacker News (through Algolia's search API) for the last day's stories on the topic, and Reddit for its newest posts, then drops every link already in the workflow's seen state. The judgement is the model's: digest_writer keeps the 3 to 7 posts that are about the topic and worth reading, and writes one line per post with why it is worth reading.
If nothing new turned up, the scheduled run sends nothing; a test run says "Nothing new" so you know it is set up.
Where the code runs
The fetch step is a @distri/tool module. Its front matter declares the only hosts it may reach: hn.algolia.com and www.reddit.com. On a self-hosted Distri server it runs with the server's Deno; on Distri Cloud it runs in a sandbox. You can run it on its own:
echo '{"topic":"AI agents"}' | deno run --allow-net=hn.algolia.com,www.reddit.com --allow-read \
--import-map=<(echo '{"imports":{"jsr:@distri/tool":"../../distri-tool/mod.ts"}}') \
../../distri-tool/run.ts ./tools/fetch_posts.ts
The blueprint
Plain files in samples/signal-digest. Copy the folder, change the prompt or the schedule, and apply it again.
blueprint.toml
name = "signal-digest"
title = "Signal digest"
category = "gtm"
about = "A morning digest on Telegram of the Hacker News and Reddit posts worth your time on a topic. Never repeats a link."
prompt = "Every weekday at 8am, send me a Telegram digest of the posts worth reading about AI agents for SRE on Hacker News and Reddit."
[params.topic]
ask = "What topic should the digest follow?"
example = "AI agents for SRE"
[params.hour]
ask = "At what hour should it arrive (0-23, in your time zone)?"
default = "8"
required = false
[params.timezone]
ask = "Which time zone (IANA name)?"
default = "UTC"
required = false
[channel]
kind = "telegram"
agent = "digest_writer"
workflows = ["signal_digest"]
[test]
workflow = "signal_digest"
input = { test = true }
expect = "A digest with links about the topic arrives on Telegram"
agents/digest_writer.md
---
name = "digest_writer"
description = "Picks the posts worth reading about {{params.topic}} and writes a short digest"
max_iterations = 4
tool_format = "provider"
runtime = "server"
[tools]
builtin = ["final"]
---
# ROLE
You write a short daily digest about **{{params.topic}}** for a busy reader.
# TASK
You get a JSON list of new posts (title, url, source, points, comments). Pick the 3 to 7 that are genuinely about {{params.topic}} and worth reading: original work, data, launches, strong discussions. Skip duplicates, memes, job posts and anything off-topic.
Write the digest as Markdown, nothing else:
- one line per post: `• [title](url) — why it is worth reading (one short clause) · source`
- end with one line: what the day's posts have in common, if anything.
If nothing is worth reading, reply with exactly: `Nothing worth your time today on {{params.topic}}.`
workflows/signal_digest.json
{
"agent_type": "workflow_agent",
"name": "signal_digest",
"description": "Weekday digest of new Hacker News and Reddit posts about {{params.topic}}, sent to the owner on Telegram.",
"version": "0.1.0",
"definition": {
"id": "signal_digest",
"steps": [
{
"id": "fetch",
"label": "Fetch new posts",
"input": { "topic": "{{params.topic}}", "seen": "{state.seen}" },
"kind": { "type": "code", "module": "tools/fetch_posts.ts" }
},
{
"id": "anything_new",
"label": "Anything new?",
"depends_on": ["fetch"],
"kind": {
"type": "condition",
"expression": "{steps.fetch.count} > 0",
"then": ["write", "send", "remember"],
"else": ["quiet"]
}
},
{
"id": "write",
"label": "Write the digest",
"kind": {
"type": "agent_run",
"agent_id": "digest_writer",
"prompt": "New posts about {{params.topic}} (JSON): {steps.fetch.posts}"
}
},
{
"id": "send",
"label": "Send it",
"depends_on": ["write"],
"kind": { "type": "notify", "to": "owner", "text": "📰 *{{params.topic}}*\n\n{steps.write.output}" }
},
{
"id": "remember",
"label": "Remember what was sent",
"depends_on": ["send"],
"when": "!{input.test}",
"kind": { "type": "set_state", "values": { "seen": "{steps.fetch.seen_next}" } }
},
{
"id": "quiet",
"label": "Nothing new",
"when": "{input.test}",
"kind": { "type": "notify", "to": "owner", "text": "📰 Nothing new about {{params.topic}} in the last day. The digest is set up and will arrive on weekdays at {{params.hour}}:00." }
}
],
"entry_points": [
{
"id": "main",
"label": "Morning digest",
"starts_at": "fetch",
"triggers": [
{ "type": "schedule", "cron": "0 0 {{params.hour}} * * 1-5", "timezone": "{{params.timezone}}", "enabled": true, "input": {} }
]
}
]
}
}
tools/fetch_posts.ts
// ---
// [permissions]
// net = ["hn.algolia.com", "www.reddit.com"]
// [tool]
// timeout = 45
// ---
// Fetch the last day's posts about a topic from Hacker News (Algolia) and Reddit, minus the
// ones already sent (`seen`). Returns the new posts and the updated `seen` list.
import { defineTool, s } from "jsr:@distri/tool";
type Post = { id: string; title: string; url: string; source: string; points: number; comments: number };
async function hackerNews(topic: string, since: number): Promise<Post[]> {
const q = new URLSearchParams({
query: topic,
tags: "story",
numericFilters: `created_at_i>${since}`,
hitsPerPage: "40",
});
const res = await fetch(`https://hn.algolia.com/api/v1/search_by_date?${q}`);
if (!res.ok) throw new Error(`hacker news: HTTP ${res.status}`);
const body = await res.json();
return (body.hits ?? []).map((h: Record<string, unknown>) => ({
id: `hn:${h.objectID}`,
title: String(h.title ?? ""),
url: String(h.url ?? `https://news.ycombinator.com/item?id=${h.objectID}`),
source: "Hacker News",
points: Number(h.points ?? 0),
comments: Number(h.num_comments ?? 0),
}));
}
async function reddit(topic: string): Promise<Post[]> {
const q = new URLSearchParams({ q: topic, sort: "top", t: "day", limit: "40" });
const res = await fetch(`https://www.reddit.com/search.json?${q}`, {
headers: { "user-agent": "distri-signal-digest/1.0" },
});
if (!res.ok) return []; // Reddit rate-limits anonymous clients; Hacker News alone is fine.
const body = await res.json();
return (body.data?.children ?? []).map((c: { data: Record<string, unknown> }) => ({
id: `reddit:${c.data.id}`,
title: String(c.data.title ?? ""),
url: `https://www.reddit.com${c.data.permalink}`,
source: `r/${c.data.subreddit}`,
points: Number(c.data.score ?? 0),
comments: Number(c.data.num_comments ?? 0),
}));
}
export const tool = defineTool({
name: "fetch_posts",
description: "New posts about a topic from Hacker News and Reddit, minus ones already sent",
input: s.object({
topic: s.string(),
seen: s.optional(s.array(s.string())),
hours: s.optional(s.number()),
}),
async run({ topic, seen, hours }, ctx) {
const since = Math.floor(Date.now() / 1000) - (hours ?? 24) * 3600;
const prior = Array.isArray(seen) ? seen : [];
const already = new Set(prior);
const [hn, rd] = await Promise.all([hackerNews(topic, since), reddit(topic)]);
const fresh = [...hn, ...rd]
.filter((p) => p.title && !already.has(p.id))
.sort((a, b) => b.points + b.comments - (a.points + a.comments))
.slice(0, 30);
ctx.log(`hn=${hn.length} reddit=${rd.length} new=${fresh.length}`);
const next = [...fresh.map((p) => p.id), ...prior].slice(0, 500);
return { posts: fresh, count: fresh.length, seen_next: next };
},
});
Put it in your product
Every agent Distri runs can also be embedded in your own app with @distri/react or a script tag, and call your product’s functions in the signed-in user’s session. The AI gateway records each model call against the end user, so you see the cost per customer and can cap it.
Questions
- Can it follow other sources?
- Add a fetch function to tools/fetch_posts.ts and its host to the net permissions in the file’s front matter. The agent and the workflow do not change.
- Will it send the same link twice?
- No. After each scheduled digest the workflow stores the links it sent in its state, and the next fetch leaves them out.
- Can I send it to Slack instead of Telegram?
- The blueprint is set up for Telegram. Distri agents also answer on Slack, WhatsApp and Discord; see Channels.
Set up your first agent with one sentence.
Distri is open source under the MIT licence: self-host it, or start on Distri Cloud’s free tier. Pricing

